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 | |
[ -z "$1" ] && echo "Usage: $0 www.example.com" && exit | |
SERVERNAME="$1" | |
echo |\ | |
openssl s_client \ | |
-showcerts \ | |
-servername $SERVERNAME \ |
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 | |
while true; do | |
date; | |
dig @8.8.8.8 ftp.coe.psu.ac.th +trace | egrep -v 'NSEC|RRSIG|DS|^\.|^th\.'; | |
sleep 10; | |
done |
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 | |
ssh-keygen -l -f ~/.ssh/id_rsa.pub |\ | |
awk '{ print $2 }' |\ | |
sed -e 's/://g' -e 's/^/key-hash ssh-rsa /' -e 's/$/ user@hostname/' |
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 | |
CONF="${HOME}/.getcmd.conf" | |
[ ! -f "$CONF" ] && echo "No config file ${CONF}" && exit | |
source $CONF | |
[ -z "CMDSVR" ] && echo "CMDSVR is not defined" && exit | |
[ -z "CMDPATH" ] && echo "CMDPATH is not defined" && exit | |
[ -z "DONE" ] && echo "DONE is not defined" && exit |
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
rm -f result.txt; cat ~/.passphrase | gpg --batch --passphrase-fd 0 result.txt.asc 2> /dev/null; echo $? |
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 | |
sudo /opt/vc/bin/vcgencmd measure_temp | cut -f2 -d= | cut -f1 -d\' |
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 | |
t=$(cat /sys/class/thermal/thermal_zone0/temp) | |
t1=$(expr $t / 1000) | |
t2=$(expr $t % 1000) | |
echo $t1.$t2 |
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 | |
IFS='' | |
sudo iwlist wlan0 scanning |\ | |
grep -E 'Quality|Cell|ESSID' |\ | |
while read line; do | |
printf "%s" $line | |
ISESSID=`echo $line | grep ESSID` | |
[ "$ISESSID" ] && printf "\n" | |
done |\ |
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 | |
BINDIR="${HOME}/bin" | |
WORKDIR="/tmp/wifi" | |
WIFISCAN="$BINDIR/wifi-scan" | |
SENDPHOTO="$BINDIR/botSendPhoto" | |
TEXT2PNG="$BINDIR/text2png" | |
[ ! -d $WORKDIR ] && mkdir -p $WORKDIR | |
cd $WORKDIR || exit |
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 | |
BINDIR="${HOME}/bin" | |
WORKDIR="/tmp/capture" | |
SENDPHOTO="$BINDIR/botSendPhoto" # see botSendPhoto.sh script | |
## mode 777 is needed since we capture screen as 'pi' user | |
[ ! -d $WORKDIR ] && mkdir -m 0777 -p $WORKDIR | |
cd $WORKDIR || exit |