Skip to content

Instantly share code, notes, and snippets.

View ChatchaiJ's full-sized avatar

Chatchai Jantaraprim ChatchaiJ

View GitHub Profile
@ChatchaiJ
ChatchaiJ / install-changetrack
Created December 8, 2015 07:00
Install changetrack on debian/ubuntu host
#!/bin/bash
# --------------------------------------------------------------------- #
# install-changetrack - Install changetrack on debian/ubuntu host. #
# #
# version 0.1 - cj (2010-08-24) init. #
# --------------------------------------------------------------------- #
ADMIN="sysadmin@localhost"
CONF="/etc/changetrack.conf"
@ChatchaiJ
ChatchaiJ / psuautosigned.sh
Created December 8, 2015 07:10
Signed-in with PSU Login to access internet
#!/bin/sh
# --------------------------------------------------------------------- #
# psuautosigned Signed-in with PSU Login to access internet. #
# #
# version 0.1 - cj (2010-06-11) modified from engautosign-3 #
# version 0.1a - cj (2010-06-14) read login/password from user #
# if any of them doesn't provide from $CONF #
# version 0.1b - cj (2010-06-15) uses of function bug fixed. #
# thanks to aj. Panyarak for this. #
@ChatchaiJ
ChatchaiJ / buildvdimage.sh
Created December 8, 2015 07:20
Build raw disk image for VirtualBox and install debian system on it
#!/bin/bash
# --------------------------------------------------------------------- #
# buildvdimage - Build raw disk image for VirtualBox and install #
# debian system on it. So we can start using the new #
# virtual machine immediately without to install and #
# configure that system manually. #
# #
# Part of this script was modified from #
# http://blog.quinthar.com/2008/07/ #
@ChatchaiJ
ChatchaiJ / debmirror-checkspeed.sh
Created December 8, 2015 07:23
Check Debian Mirror Speed
#!/bin/bash
SITES="
ftp.th.debian.org
ftp.kr.debian.org
ftp.jp.debian.org
ftp.tw.debian.org
ftp.nz.debian.org
ftp.debianclub.org
mirror1.ku.ac.th
@ChatchaiJ
ChatchaiJ / dmesg-datestamp.sh
Created December 8, 2015 07:26
Show dmesg in time/date stamp like in system log.
#!/bin/sh
# --------------------------------------------------------------------- #
# dmesg-datestamp - Show dmesg in time/date stamp like in system #
# log. Since my brain can't interpret uptime #
# that well. #
# #
# version 0.1 - cj (2013-03-25) init. #
# --------------------------------------------------------------------- #
@ChatchaiJ
ChatchaiJ / dmtc.sh
Created December 8, 2015 07:27
Debian Mirror Trace Check
#!/bin/bash
# --------------------------------------------------------------------- #
# dmtc - Debian Mirror Trace Check #
# Check projects/trace directory in debian's mirror to #
# see which mirror has more up-to-date data. #
# #
# version 0.1 - cj (2013-05-17) init. #
# version 0.2 - cj (2013-05-17) some bug fixed. #
# version 0.2a - cj (2013-05-18) archive in progress detection added. #
@ChatchaiJ
ChatchaiJ / mirrorstate
Created December 8, 2015 07:36
Check debian mirror state, keep in log file, and also sending mail to admins.
#!/bin/sh
# --------------------------------------------------------------------- #
# mirrorstate - Check debian mirror state, keep in log file, and also #
# sending mail to admins. #
# #
# version 0.1 - cj (2010-05-14) also monitor other up/down stream #
# push mirror. #
# version 0.1a - cj (2011-05-30) add ftp.jp.debian.org to the list. #
# version 0.1b - cj (2013-03-23) add ftp.kr.debian.org to the list. #
@ChatchaiJ
ChatchaiJ / ftp-debian-mirror-state
Created December 8, 2015 07:39
Get debian mirror status for CoE ftp from DMC -- debian mirror check!
#!/usr/bin/perl -w-
# --------------------------------------------------------------------- #
# ftp-debian-mirror-state Get debian mirror status for CoE ftp #
# from DMC -- debian mirror check! #
# #
# version 0.2 - cj (2007-08-14) fixed up version. #
# version 0.3 - cj (2010-01-25) change site name from #
# ftp.coe.psu.ac.th to ftp.th.debian.org. #
# version 0.4 - cj (2010-01-29) no proxy needed. Transparent proxy is #
@ChatchaiJ
ChatchaiJ / my-passwod-generator.sh
Created December 8, 2015 07:44
My Password Generator
#!/bin/sh
LOG="$HOME/.my_password_generator.log"
echo -n "Enter [Key]: "
stty -echo
read key
stty echo
# echo "[$key]" # -- for debug only -- #
echo "*******************"
@ChatchaiJ
ChatchaiJ / minimal-psuautosigned.sh
Created December 14, 2015 06:29
Minimal PSU Autosigned Script
#!/bin/bash
USER="YOUR-PASSPORT-ID"
PASSWD="YOUR-PASSPORT-PASSWORD"
COOKIES="cookies.txt"
/usr/bin/curl \
--connect-timeout 10 \
--max-time 10 \
-s -k \