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 | |
CAPTION="$1" | |
IMGFILE="$2" | |
SENDTO="$3" | |
[ -z "$CAPTION" ] && echo "No caption" && exit | |
[ -z "$IMGFILE" ] && echo "No image file" && exit | |
[ -z "$SENDTO" ] && echo "No one to sendto" && 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 | |
curl https://en.wikipedia.org/wiki/Provinces_of_Thailand |\ | |
grep '^<area' |\ | |
cut -f3 -d/ |\ | |
cut -f1 -d\" |\ | |
sed -e 's/_Province//' \ | |
> province.txt |
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 | |
D="`date +%Y/%m/%d`" | |
F="`date +%H%M`.jpg" | |
DS="${HOME}/Pictures/ScreenShot/$D" | |
DC="${HOME}/Pictures/CameraShot/$D" | |
[ ! -d "$DS" ] && mkdir -p $DS | |
[ ! -d "$DC" ] && mkdir -p $DC |
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 | |
acpi -bi |
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 | |
D="${HOME}/Pictures/ScreenShot/`date +%Y/%m/%d`" | |
F="`date +%H%M`.jpg" | |
[ ! -d "$D" ] && mkdir -p $D | |
DISPLAY=:0.0 scrot -z -d 5 -q 25 "$D/$F" |
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 | |
docker run --name zabbix-web \ | |
--link zabbix-server:zabbix-server \ | |
--link mysql-server:mysql \ | |
-p 80:80 \ | |
-e DB_SERVER_HOST="mysql-server" \ | |
-e MYSQL_USER="root" \ | |
-e MYSQL_PASSWORD="root" \ | |
-e ZBX_SERVER_HOST="zabbix-server" \ |
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 | |
docker run --name zabbix-server \ | |
--link mysql-server:mysql-server \ | |
-e DB_SERVER_HOST="mysql-server" \ | |
-e MYSQL_USER="root" \ | |
-e MYSQL_PASSWORD="root" \ | |
-d zabbix/zabbix-server-mysql:latest |
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 | |
VER="3.0.0" | |
ZABBIXSRC="zabbix-${VER}.tar.gz" | |
SQLDIR="zabbix-${VER}/database/mysql" | |
[ ! -f "$ZABBIXSRC" ] && echo "Source file '$ZABBIXSRC' does not exist?" && exit | |
tar -zxvf ${ZABBIXSRC} ${SQLDIR} |
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 | |
[ ! -d "$HOME/db/log" ] && mkdir -p $HOME/db/log | |
[ ! -d "$HOME/db/mysql" ] && mkdir -p $HOME/db/mysql | |
[ ! -d "$HOME/db/tmp" ] && { mkdir -p $HOME/db/tmp; chmod 777 $HOME/db/tmp; chmod +t $HOME/db/tmp; } | |
docker run --name mysql-server \ | |
-v $HOME/db/log:/var/log \ | |
-v $HOME/db/mysql:/var/lib/mysql \ | |
-v $HOME/db/tmp:/tmp \ |
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 os | |
import re | |
import subprocess | |
tty = subprocess.check_output("tty") | |
m = re.match(r"/dev/(.+)", tty) | |
line = ".+ " + m.group(1) + " .+" |