Skip to content

Instantly share code, notes, and snippets.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@wtser
wtser / mysql_backup.sh
Created April 18, 2015 01:17
mysql 备份 Shell 脚本
#!/bin/sh
function backup(){
cd /var/tmp/
for databaseName in $*
do
sqlFileName=""$databaseName".sql"
echo "exporting "$databaseName
# 导出数据库
@wtser
wtser / mysql_restore.sh
Created April 18, 2015 01:21
mysql 数据恢复 Shell 脚本
#!/bin/sh
function restore(){
cd /var/tmp/
tar zxvf sql.tar.gz
for databaseName in $*
do
sqlFileName=""$databaseName".sql"
echo "importing "$databaseName
@wtser
wtser / website_backup.sh
Created April 18, 2015 01:22
网站备份 Shell 脚本
#!/bin/sh
function backup(){
cd /var/www/
for siteName in $*
do
echo "打包 "$siteName
tar zcvf $siteName".tar.gz" $siteName"/"
# 远程拷贝
echo "正在发送到备份服务器"
@wtser
wtser / website_restore.sh
Created April 18, 2015 01:25
网站恢复 Shell 脚本
#!/bin/sh
function restore(){
cd /var/www/
for siteName in $*
do
echo "解压 "$siteName
tar zxvf $siteName".tar.gz"
@wtser
wtser / autopac.sh
Created October 20, 2015 15:12 — forked from lwr/autopac.sh
使用 https://github.com/clowwindy/gfwlist2pac 生成自定义 PAC 的辅助脚本
#!/bin/bash
GFWLIST=https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
PROXY=127.0.0.1:7070
cd `dirname "${BASH_SOURCE[0]}"`
echo "Downloading gfwlist from $GFWLIST"
curl "$GFWLIST" --socks5-hostname "$PROXY" > /tmp/gfwlist.txt
/usr/local/bin/gfwlist2pac \
--input /tmp/gfwlist.txt \
<script >
var userAgent = navigator.userAgent;
var isOpera = userAgent.indexOf("Opera") > -1;
var isMaxthon = userAgent.indexOf("Maxthon") > -1 ;
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera ;
var isFF = userAgent.indexOf("Firefox") > -1 ;
var isSafari = userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") < 1 ;
var isChrome = userAgent.indexOf("Chrome") > -1 ;
var isIE5 = isIE55 = isIE6 = isIE7 = isIE8 = false;
@wtser
wtser / css
Created March 30, 2017 13:13
[style] weibo video
.S_page {
background: none;
}
.S_page .WB_miniblog {
background: none;
}
.S_page .WB_main {
overflow: hidden;
div.header {
display: none;
}
div.footer {
display: none;
}
.cotentRight {
display: none;
@wtser
wtser / DND.applescript
Last active September 16, 2019 08:41
DND auto for Mac
# 在系统快捷键中 将打开关闭DND的快捷键设置为 cmd+shift+option+control+d
repeat while true
ignoring application responses
tell application "System Events" to keystroke "D" using {command down, shift down, option down, control down}
end ignoring
say "DND opened"
delay 1500
ignoring application responses
tell application "System Events" to keystroke "D" using {command down, shift down, option down, control down}