a.k.a. what to do when your ISP starts blocking sites :(
Set the SOCKS proxy to local SSH tunnel
networksetup -setsocksfirewallproxy "Ethernet" localhost 8080
To clear the domain and port
#!/bin/bash | |
MUSER='root' # db username | |
MPASS='root' # db password | |
# db array to be deleted | |
declare -a DROP_DBS=(knowpath mydb xhprof ) | |
# loop dbs and delete db | |
DBS=`(mysql -u$MUSER -p$MPASS -Bse 'SHOW DATABASES')` |
tcpdump -s 0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420' | |
http://unix.stackexchange.com/questions/19485/how-to-monitor-incoming-http-requests |
#!/bin/bash | |
# first back up the database | |
now=$(date +"%Y-%m-%d_%H:%M") | |
select_mode() | |
{ | |
echo "Select the running mode: | |
1. Local Server | |
2. Production Server |
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
#!/bin/sh | |
### System Setup ### | |
NOW=`date +%Y-%m-%d` | |
KEEPDAYS=5 | |
# | |
### SSH Info ### | |
SHOST="" # XXXX is mt gs number | |
SUSER="" # mt_domain is primary mt domain | |
SDIR="/home/hezhl/data/tmp" # Remote temp save path | |
PORT=22 |
SET SESSION sql_mode= 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; |
<?php | |
define('DB_HOST', 'localhost'); | |
define('DB_USER', 'nshore_admin'); | |
define('DB_PASS', 'w00d$ide'); | |
define('DB_NAME', 'npclients_wp'); | |
/** | |
* 数据库操作类 | |
*/ |
git ls-files -z | xargs -0 git update-index --assume-unchanged |
<?php | |
$servername = '127.0.0.1'; | |
$username = 'dbuser'; | |
$password = 'dbpassword'; | |
$dbname = 'dbname'; | |
// Create connection | |
$conn = new mysqli($servername, $username, $password); | |
// Check connection |