Skip to content

Instantly share code, notes, and snippets.

View dennyhalim's full-sized avatar

DennyHalim.com dennyhalim

View GitHub Profile
# This file holds a static list of host / network addresses to be blocked
# by the firewall via update-blocklist.
#
# Blank lines and comment lines are ignored; others should have one or
# more whitespace-delimited fields as follows:
#
# - a source specification (eg, an IP address or network
# address range in CIDR format) as the first field. NB:
# this is required.
# - an optional jump target (eg, DROP, REJECT, etc) as the
<?php
class Whois{
var $m_status = 0;
var $m_domain = '';
var $m_servers = array();
var $m_data = array();
var $m_connectiontimeout = 5;
var $m_sockettimeout = 30;
#!/bin/bash
# Easy Website Creation Tool with SuExec and FastCGI, version 0.1.1
# Made by Kijin Sung ([email protected])
# Based on http://www.linode.com/forums/viewtopic.php?t=2982
# With a few of my own modifications.
# Made for Ubuntu 8.04 LTS & Apache 2.2, free to port and modify.
# This script comes with no warranties whatsoever. Use at your own risk.
# If you don't understand what this script does, don't use it
<?php
/*
AM 10 August 2004
Choose a config file based on the access URL and load it
*/
require( dirname(__FILE__) . '/wp-includes/my-functions.php' );
if [[ "$TERM" != vt320 ]]; then
if ! which screen|grep "no screen"; then
if screen -ls|head -n3|tail -n2|cut -f2|cut -d. -f2-|grep -q
'^'main'$'; then
exec screen -r main
else
exec screen -S main
fi
fi
fi
DirectoryIndex /park-domain.php
#if you want to use htaccess redirect instead of php...
RewriteEngine On
#RewriteCond %{HTTP_USER_AGENT} !^Googlebot
RewriteRule (.*) http://www.ndparking.com/serve.php?lid=557555&dn=%{HTTP_HOST}&kw=$1 [R=301,L]
#!/bin/bash
#http://tuxopia.net/security_ssh_probe_block_script
AWK=/bin/awk
SORT=/bin/sort
GREP=/bin/grep
UNIQ=/bin/uniq
SED=/bin/sed
LOGFILE=/var/log/messages
BADCOUNT="5"
function loadjscssfile(filename, filetype){
if (filetype=="js"){ //if filename is a external JavaScript file
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", filename)
}
else if (filetype=="css"){ //if filename is an external CSS file
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
ssh username@from_server "tar czf - directory_to_get" | tar xzvf - -C path_where_to_put
#http://www.thingy-ma-jig.co.uk/blog/03-09-2008/using-tar-and-ssh-improve-scp-speeds
#http://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/
# info: http://it.dennyhalim.com/2009/10/perfect-mysql-backup.html
/bak/mysql/*/*.sql.gz {
daily
rotate 5
nocompress
postrotate
export HOME=/root
for i in `mysql --batch -e 'show databases' | tail -n +2`; do
if [ ! -e /bak/mysql/$i ]; then mkdir -m 700 /bak/mysql/$i; fi