Skip to content

Instantly share code, notes, and snippets.

View dennyhalim's full-sized avatar

DennyHalim.com dennyhalim

View GitHub Profile
#!/bin/bash
# Easy Website Creation Tool with SuExec and FastCGI, version 0.1.1
# Made by Kijin Sung (kijinbear@gmail.com)
# 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
@dennyhalim
dennyhalim / lftp-backup.txt
Created October 7, 2009 19:29
lftp scripting
open ftp.someserver.com
user username,password
mirror /remote/folder /local/folder/
exit
# execute this using
# lftp -f lftp-backup.txt
<?PHP
require_once("./includes/corefunctions.php");
// Load the AMCMS3 functions^M
require_once("./includes/db.php");
// Get the database configuration settings & connect to DB.^M
require_once("./includes/config.php");
// Load the admin's preferences
/**
* /includes/rssfunctions.php