Skip to content

Instantly share code, notes, and snippets.

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

Andres Hernandez tonejito

🐰
= ^ . ^ =
View GitHub Profile
@tonejito
tonejito / vimrc
Created April 30, 2014 00:31 — forked from anonymous/vimrc
" = ^ . ^ =
syntax on
set hlsearch
filetype on
au BufNewFile,BufRead *.xD set filetype=php
@tonejito
tonejito / vimrc
Created April 30, 2014 00:32
php syntax for xD files in vim
" = ^ . ^ =
syntax on
set hlsearch
filetype on
au BufNewFile,BufRead *.xD set filetype=php
@tonejito
tonejito / drupal2pgpass
Last active August 29, 2015 14:01
drupal2pgpass - Convert drupal 6 pgsql db_url to .pgpass format and set permissions
#!/bin/bash
# drupal2pgpass
# Convert drupal 6 pgsql db_url to .pgpass format and set permissions
# Andres Hernandez (tonejito)
# May 2014
# http://wiki.postgresql.org/wiki/Pgpass
# https://api.drupal.org/api/drupal/developer!globals.php/global/db_url/6
# https://api.drupal.org/api/drupal/sites!default!default.settings.php/6
@tonejito
tonejito / hibernate.sh
Created May 29, 2014 04:56
Clear swap and hibernate laptop
#!/bin/bash
# hibernate.sh
# Clear swap and hibernate laptop
# Andres Hernandez - Tonejito
# May 2014
#
# Requires /etc/sudoers.d/hibernate for this script to work automagically
#
# Released under the BSD License
@tonejito
tonejito / install-vmware-certs.sh
Created June 5, 2014 01:42
install-vmware-certs.sh - Fix VMware cert error by installing CA certificate into ssl capath
#!/bin/bash
# install certificate into CApath
# I use relative paths to keep compatibility with chroot'd environments
cd /etc/ssl/certs/
ln -vsf ../../../usr/lib/vmware-ovftool/certs/cacert.pem vmware.pem
# Regenerate openssl CA database
c_rehash > /dev/null
@tonejito
tonejito / apache2-vhosts.sh
Created June 5, 2014 18:15
apache2-vhosts.sh - List Apache httpd VirtualHost entries
#!/bin/bash
for bin in which apache2ctl grep awk sort
do
if [ ! -x "`which $bin`" ]
then
exit 1
fi
done
@tonejito
tonejito / f.sed
Last active March 23, 2021 20:08
Idioma de la 'f'
#!/usr/bin/sed -f
s/\([aeiou]\)/\1f\1/g
s/\([AEIOU]\)/\1f\1/g
s/\([áéíóúü]\)/\1f\1/g
s/\([ÁÉÍÓÚÜ]\)/\1f\1/g
@tonejito
tonejito / display-site-info
Created September 3, 2014 01:01
Display Apache HTTPD VirtualHost ServerName, ServerAlias and DocumentRoot for each loaded site
#!/bin/bash
#
# ./display-site-info
#
# Andres Hernandez - tonejito_AT_comunidad_DOT_unam_DOT_mx
# Display Apache HTTPD VirtualHost ServerName, ServerAlias and DocumentRoot for each loaded site
# Released under the BSD License
for bin in which apache2ctl awk sed xargs egrep
do
@tonejito
tonejito / die.sh
Created September 8, 2014 00:34
Wipe partition data and MBR
#!/bin/bash -vx
#
# Wipe partition data and MBR
#
# Andres Hernandez (tonejito) - tonejito_AT_comunidad_DOT_unam_DOT_mx
#
# Released under the GPLv3 license
for x in /dev/sda?
do
@tonejito
tonejito / zap
Last active June 25, 2018 16:12
zap LAMP stack
#!/bin/bash
# = ^ . ^ =
# 0750 root:staff /usr/local/sbin/zap
# Restart services, clear cache and re-enable swap
# Andres Hernandez - tonejito
# https://gist.github.com/tonejito/c16666facf5da68584d6