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/perl -w- | |
use strict; | |
use warnings; | |
use DateTime; | |
use Data::Dumper; | |
my $locale = DateTime->DefaultLocale; | |
print Dumper($locale); |
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/perl -w- | |
use strict; | |
use warnings; | |
use autodie; | |
my $URL = "https://www.packtpub.com/packt/offers/free-learning"; | |
my $CMD = "curl -s -S $URL"; | |
my ($match_title, $bookname) = (0, ""); |
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 | |
MSG="$1" | |
[ -z "$MSG" ] && exit | |
RES="/tmp/sendMessage.$$" | |
LOG="/tmp/bot_sendmessage.log" | |
BOTTOKEN="${HOME}/.tgbot-token" |
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 | |
MAILSVR="mailscan.in.psu.ac.th" | |
R4=`echo "quit" | nc -w 3 -4 $MAILSVR 25` | |
R6=`echo "quit" | nc -w 3 -6 $MAILSVR 25` | |
D=`date '+%Y%m%d %H:%M'` | |
echo -n "$D " |
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/sh | |
# --------------------------------------------------------------------- # | |
# pkgorphremove : Remove Orphaned Packages. # | |
# Loop repeate removing/purging orphan packages # | |
# # | |
# version 0.1 : 2004-08-08 (cj) initial. # | |
# --------------------------------------------------------------------- # | |
while [ "`deborphan`" ] |
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 | |
# --------------------------------------------------------------------- # | |
# pkgupgrade - Upgrade debian package on the system. # | |
# # | |
# version 0.1 - cj (200x-xx-xx) init. # | |
# version 0.2 - cj (2013-07-17) comment, and start/finished time # | |
# added. # | |
# --------------------------------------------------------------------- # |
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/sh | |
# ********************************************************************* # | |
# pkgupdate : script for calling from crontab to update debian # | |
# packages on a machine using apt-get # | |
# Mainly this is a two commands # | |
# # | |
# apt-get update && apt-get upgrade -y -d upgrade # | |
# # | |
# but made readable report from the output of those # |
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/sh | |
# --------------------------------------------------------------------- # | |
# setnextfreeunixid : Set nextfreeunixid in ldap server allow # | |
# smbldap-tools to start adding account at the # | |
# appropriate place. # | |
# # | |
# version 0.1 : cj (2004-12-20) initial. # | |
# --------------------------------------------------------------------- # |
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/perl -w- | |
# --------------------------------------------------------------------- # | |
# ban-ip-ssh-attack - using iptable to filter ip that try to # | |
# guess root's and other account's password. # | |
# # | |
# version 0.1 - cj (2005-05-05) initial version. # | |
# version 0.2 - cj (2005-05-09) working version. # | |
# version 0.3 - cj (2005-05-31) takasila version. # | |
# --------------------------------------------------------------------- # |
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 | |
MYSQLDIR="/var/lib/mysql" | |
cd $MYSQLDIR | |
LIST=$( find . -maxdepth 1 -type d -mtime +365 -print |\ | |
sed -e 's/^\.\///' |\ | |
grep ^s4 ) | |
for d in $LIST; do | |
echo "drop database $d;" |
OlderNewer