Skip to content

Instantly share code, notes, and snippets.

View netkiller's full-sized avatar
🎯
Focusing

Neo Chan netkiller

🎯
Focusing
View GitHub Profile
@netkiller
netkiller / backup.db.sh
Created September 3, 2013 06:39
MySQL Backup Script
#!/bin/bash
###################################
# $Id: backup 381 2012-04-03 09:49:08Z netkiller $
# Author: netkiller@msn.com
# Home: http://netkiller.github.com
###################################
BACKUP_HOST="localhost"
BACKUP_USER="root"
BACKUP_PASS=""
BACKUP_DIR=/opt/backup
@netkiller
netkiller / lighttpd
Created September 15, 2013 02:36
lighttpd startup shell
#!/bin/bash
# lighttpd init file for web server
#
# chkconfig: - 100 100
# description: Security, speed, compliance, and flexibility--all of these describe LightTPD which is rapidly redefining efficiency of a webserver;
# as it is designed and optimized for high performance environments.
# author: Neo Chen<netkiller@msn.com>
#
# processname: $PROG
# config:
#!/bin/bash
# memcached init file for memcached
#
# chkconfig: - 100 100
# description: a distributed memory object caching system
# author: Neo Chen<netkiller@msn.com>
#
# processname: /usr/sbin/memcached
# config:
# pidfile: /var/run/memcached
@netkiller
netkiller / gitpull
Created September 24, 2013 05:19
batch git pull
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
def t s
p s
Thread.new { system s }
end
`find ~/workspace/ -maxdepth 1 -type d`.each_line do |x|
#print x
@netkiller
netkiller / webservice
Created November 11, 2013 09:14
Web Service Security
<?php
/*
* =====================================
* Website: http://netkiller.github.com
* Author: neo <netkiller@msn.com>
* Email: netkiller@msn.com
* =====================================
*/
class Logging {
@netkiller
netkiller / mysql.cron
Last active December 30, 2015 23:59
mysql日志切割工具
#!/bin/bash
USER=backup
PASS=SaJePoM6BAPOmOFOd7Xo3e1A52vEPE
LOGDIR=/backup/dblog
DATADIR=/var/lib/mysql
LOG=mysql.log
LOG_ERROR=mysql_error.log
LOG_SLOW_QUERIES=slow.log
SOCKET="/var/lib/mysql/mysql.sock"
#Number of copies
<?php
class Form{
private $forms = array();
private $element = array();
private $attributes = array();
public $id,$name,$method,$action;
public function Form($id = '', $name = '', $method = 'post', $action = ''){
$this->id = $id;
$this->name = $name;
$this->method = $method;
@netkiller
netkiller / Withdrawal
Last active August 29, 2015 13:58
Withdrawal
<?php
class Withdrawal{
public $money = 0;
function __construct($money){
$this->money = $money;
}
public function total(){
return $this->money;
}
@netkiller
netkiller / daemon.sh
Created June 27, 2014 14:50
Shell Daemon start | stop | restart | status
$ cat schedule.sh
#!/bin/bash
##############################################
# $Author: netkiller $
# $Id: shell.xml 449 2012-08-10 10:38:08Z netkiller $
# http://netkiller.github.io
##############################################
NAME=schedule
BASEDIR='/www'
PROG=$(basename $0)
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64.*;
//import org.apache.commons.codec.binary.Base64;
/**
* @author netkiller
*
*/