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
#!/usr/bin/env bash | |
if [ $# -ne 1 ]; then | |
exit 1 | |
fi | |
filetype=`file -b "$1" | awk '{print $1}'` | |
if [ x$filetype == x ]; then | |
msg="ERROR: Could not determine the file type of \"$1\"" |
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
#!/usr/bin/env bash | |
DIR=$HOME/etc/get_password | |
. $DIR/get_password_string.txt | |
. $DIR/get_password_cycle.txt | |
ALGORITHM="sha1" # md4, md5, sha, sha1, ripemd160 and so on. | |
count=1 |
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
#!/usr/bin/env python | |
import urllib2 | |
import re | |
import os | |
import socket | |
#hostname = socket.gethostname() | |
hostname = "" | |
urlprovider = 'http://www.ugtop.com/' |
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
#!/usr/bin/env bash | |
ADDRESS="https://" | |
API_KEY="" | |
SECRET_KEY="" | |
USE_XMLLINT=0 # true => 1, false => 0 | |
if [ x$ADDRESS == x ] || [ x$API_KEY == x ] || [ x$SECRET_KEY == x ] || [ x$USE_XMLLINT == x ]; then | |
echo 'ERROR: Set all required valiables.' | |
exit 1 |
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
#!/usr/bin/env bash | |
DROPBOX_PATH="$HOME/Dropbox" | |
PREEXEC='sudo' | |
DUSTBOX='/tmp/rm' | |
DELETE_METHOD="$PREEXEC mv {} $DUSTBOX" | |
mkdir -p $DUSTBOX | |
$PREEXEC find $DROPBOX_PATH -name '*conflicted copy*' -exec $DELETE_METHOD \; |
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
#!/usr/bin/env python | |
import re | |
import os | |
file = "/root/etc/iptables/accept/cidr" | |
regex = re.compile('^([0-9]{1,3})(\.([0-9]{1,3})){3}/[0-9]{1,2}') | |
os.system("iptables -F") | |
os.system("iptables -A INPUT -i lo -p all -j ACCEPT") |
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
#!/usr/bin/env bash | |
NFS_SERVER=192.168.1.100 | |
MOUNT_POINT=/mnt/nfs | |
yum install -y cachefilesd | |
if test `grep 'SELINUX=disabled' /etc/selinux/config > /dev/null; echo $?` -ne 0; then | |
sed -i 's/^secctx/#secctx/g' /etc/cachefilesd.conf | |
fi | |
chkconfig cachefilesd on |
NewerOlder