This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
$scriptpath = $MyInvocation.MyCommand.Path | |
$dir = Split-Path $scriptpath | |
$TARGETDIR = $dir + "\log" | |
if(!(Test-Path -Path $TARGETDIR )) | |
{ | |
New-Item -ItemType directory -Path $dir -Name "log" | |
} | |
$logFile = $TARGETDIR + "\sync.log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
currentTime=`date +%k%M` | |
check_time_to_run() | |
{ | |
tempTime=$1 | |
if [ $tempTime -gt 630 -a $tempTime -lt 800 ]; then | |
echo "Time is between 5 AM and 8 AM. Running Fetch_news.sh." | |
sudo sh /home/pi/scripts/fetch_news.sh | |
else | |
echo "This is not between 5 AM and 8 AM. ABORTING !" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ipVar=$(/sbin/ifconfig $(netstat -nr | tail -1 | awk '{print $NF}') | awk -F: '/inet /{print $2}' | cut -f1 -d ' ') | |
curl https://api.pushbullet.com/v2/pushes \ | |
-u <API>: \ | |
-d device_iden="<ID>" \ | |
-d type="note" \ | |
-d title="Pi IP address" \ | |
-d body=$ipVar \ | |
-X POST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear | |
$scriptpath = $MyInvocation.MyCommand.Path | |
$dir = Split-Path $scriptpath | |
$source = $dir + "\IPlist.txt" | |
$computers= gc $source | |
$DNS_Resolve = $dir + "\DNS_Resolved.csv" | |
Clear-Content $DNS_Resolve -ErrorAction "SilentlyContinue" | |
$DNS_Unresolve = $dir + "\DNS_Unesolved.csv" | |
Clear-Content $DNS_Unresolve -ErrorAction "SilentlyContinue" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
from pushbullet import Device | |
apiKey = "#########################" | |
phone = Device(apiKey, ################) | |
torrentname = '\n'.join(sys.argv[1:]) | |
push = phone.push_note('Transmission: New download completed',torrentname + ' has been downloaded') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -s \ | |
-F "token=APP_TOKEN" \ | |
-F "user=USER_TOKEN" \ | |
-F "title=Download Finished" \ | |
-F "message=$TR_TORRENT_NAME: $TR_TIME_LOCALTIME" \ | |
https://api.pushover.net/1/messages > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | |
$WebApp=get-spwebapplication "http://webapplicationname" | |
foreach ($SPSite in $webApp.Sites) | |
{ | |
foreach($SPWeb in $SPSite.AllWebs) | |
{ | |