Skip to content

Instantly share code, notes, and snippets.

View tonejito's full-sized avatar
🐰
= ^ . ^ =

Andres Hernandez tonejito

🐰
= ^ . ^ =
View GitHub Profile
@tonejito
tonejito / _.sh
Created July 4, 2012 06:01
Shebang
#!/bin/sh
@tonejito
tonejito / ErrorDocument
Created November 5, 2012 06:30
Apache httpd 2.2.x ErrorDocument Deflector Shields
# = ^ . ^ =
#
# Apache httpd DeflectorShield
# Andres Hernandez (tonejito)
# http://tonejito.blogspot.com:80/
#
# 100 Informational
# 100 Continue
@tonejito
tonejito / belong.sh
Created January 28, 2013 20:27
./belong.sh - Get all users in group
#!/bin/sh
# = ^ . ^ =
#
# ./belong.sh - Get all users in group
# Andres Hernandez (tonejito)
# http://tonejito.blogspot.com:80/
SED=/bin/sed
AWK=/usr/bin/awk
GETENT=/usr/bin/getent
@tonejito
tonejito / skype-install.sh
Last active December 14, 2015 16:08
Install skype on Debian 7 "Wheezy" amd64 (might also work on Debian 6).
#!/bin/bash
# Download http://www.skype.com/en/download-skype/skype-for-linux/downloading/?type=debian32
wget -c 'http://download.skype.com/linux/skype-debian_4.1.0.20-1_i386.deb'
# Try to install (it will fail)
dpkg -i --force-architecture skype-debian_4.1.0.20-1_i386.deb
# Add i386 architecture to the system
dpkg --add-architecture i386
@tonejito
tonejito / get-installed.sh
Created March 20, 2013 23:55
Get installed packages in Debian 64-bit
#!/bin/bash
# Andres Hernandez - tonejito
# Get installed packages in Debian 64-bit
egrep '^Install' /var/log/apt/history.log | \
sed -e 's/Install: //g' -e 's/),\ /)\n/g' | \
egrep -E '(:amd64 )?\(.*\)' | \
grep -v automatic | \
sed -e 's/\(:amd64\ \)\?(.*)//g'
@tonejito
tonejito / pstree.sh
Created July 10, 2013 20:12
./pstree.sh - Display process tree in GNU/Linux without kernel pseudo processes
#!/bin/sh
# = ^ . ^ =
ps afx | egrep -v '\[kthreadd\]|\ \\_\ \[|egrep'
@tonejito
tonejito / find-love
Last active December 19, 2015 18:19
find-love - Helps to find love in life
#!/bin/bash -vx
# find-love - Helps to find love in life
# Andres Hernandez - tonejito
egrep '<3|love' /var/log/life &>/dev/null
LUCK=$?
case "$LUCK"
in
@tonejito
tonejito / optical-media-size
Last active December 23, 2015 16:49
Optical Media Size
Floppy 1474560
CD 737280000
DVD 4707319808
DVD DL 8547991552
HD-DVD 16106127360
HD-DVD DL 32212254720
BD 25025314816
BD DL 50050629632
@tonejito
tonejito / thesis-vm
Created September 25, 2013 05:15
thesis-vm - Launches a serial console enabled VM and connects to ttyS0 with gnu screen Andres Hernandez - tonejito September 2013
#!/bin/bash
# thesis-vm - Launches a serial console enabled VM and connects to ttyS0 with gnu screen
# Andres Hernandez - tonejito
# September 2013
RM=rm
TEE=tee
SED=sed
GREP=grep
ECHO=echo
@tonejito
tonejito / httpd-debug.sh
Created March 5, 2014 06:51
Run apache in DEBUG mode with logging to stdout and optional trace of opened files
#!/bin/bash -vx
# httpd-debug.sh
# Run apache in DEBUG mode with logging to stdout and trace of opened files
# Andres Hernandez - tonejito -
STRACE=`which strace`
APACHE_DEBUG="/usr/sbin/apache2 -X -e debug"