This file contains 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 | |
### Author: cHoo | |
### Date: August 2019 | |
### Description: Script to dump database. | |
### Version: | |
#### 1.01 - update messages. | |
#### 1.10 - 20210912 backup file size. | |
# Import global variable in this setting-global is consisting of LINE API key | |
CONFLE="/opt/scripts/setting-global.ini" |
This file contains 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 | |
### Author: cHoo | |
### Date: September 2019 | |
### Version: 1.0 | |
### Description: Check diskspace used and alert if used up to 90% | |
# | |
# Import global variable | |
# | |
CONFLE="/opt/scripts/setting.ini" | |
if [ -f $CONFLE ] |
This file contains 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 | |
### Author: cHoo | |
### Date: August 2019 | |
### Description: | |
### Version: | |
### 1.0 - initial first release | |
# | |
# Import global variable | |
# | |
CONFLE="/opt/scripts/setting-global.ini" |
This file contains 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 : | |
do | |
LOGTIME=`date '+%Y-%m-%d_%H:%M:%S'` | |
TEMPDEG=`/usr/bin/vcgencmd measure_temp` | |
VOLTS=`/usr/bin/vcgencmd measure_volts` | |
echo "$HOSTNAME $LOGTIME $VOLTS $TEMPDEG" | |
sleep 5 | |
done |
This file contains 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
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi | |
deb http://archive.raspberrypi.org/debian/ buster main | |
# Uncomment line below then 'apt-get update' to enable 'apt-get source' | |
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi |
This file contains 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 | |
TODAY=`date '+%Y%m%d'` | |
read -r SHUTDAY < shutdown.txt | |
echo $SHUTDAY | |
if [ "$SHUTDAY" == "$TODAY" ] | |
then | |
sudo reboot | |
else | |
echo 'not reach the time yet' |
This file contains 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 | |
# Convert from total seconds to H:M:s | |
RUNTIME=$1 | |
RUNSEC=$(($RUNTIME%60)) | |
RUNMIN=$(((($RUNTIME - $RUNSEC)/60)%60)) | |
RUNHRS=$(($RUNTIME/3600)) | |
echo $RUNHRS:$RUNMIN:$RUNSEC |
This file contains 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
[global] | |
workgroup = WORKGROUP | |
log file = /var/log/samba/log.%m | |
max log size = 1000 | |
logging = file | |
panic action = /usr/share/samba/panic-action %d | |
server role = standalone server | |
obey pam restrictions = yes | |
unix password sync = yes | |
passwd program = /usr/bin/passwd %u |
This file contains 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
names = ['1','2','a','b'] | |
# test or proof of concept | |
print('0' in names) | |
print('a' in names) | |
search = 'xxx' | |
if search in names: | |
print('Found') | |
else: |
This file contains 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 | |
### Author: cHoo | |
### Date: September 2019 | |
### Description: Script to check host port | |
### Version: | |
#### 1.0 - initial | |
### Syntax | |
#### chkport.sh hostaddress port [servicename] | |
#### Ex. chkport.sh 192.168.1.1 80 http |