This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CentOS release 6.4 | |
# https://www.digitalocean.com/community/articles/how-to-setup-your-own-vpn-with-pptp | |
# rpm --import http://poptop.sourceforge.net/yum/RPM-GPG-KEY-PPTP | |
# rpm -i http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm | |
# centos 6.5 use epel instead | |
# http://mirrors.hustunique.com/epel/6/i386/repoview/epel-release.html | |
rpm -Uvh http://mirrors.hustunique.com/epel/6/i386/epel-release-6-8.noarch.rpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MySQL Server Info | |
MyUSER="root" | |
MyPASS="passwd" | |
MyHOST="localhost" | |
# Linux bin paths, change this if it can not be autodetected via which command | |
MYSQL="$(which mysql)" | |
MYSQLDUMP="$(which mysqldump)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This file must be put in the same directory of TargetDir | |
# Because using relative path to avoid tar warning: | |
# tar: Removing leading `/' from member names | |
TargetDir="html" | |
DestDir="/var/www/backup/dir" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.dragResize = function(handler, lefter, righter){ | |
handler = $(handler); | |
lefter = $(lefter); | |
righter = $(righter); | |
var dragging = false, oldX = 0; | |
handler.mousedown(function(e){ | |
dragging = true; | |
oldX = e.pageX; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 屏幕键盘 | |
$(".keyhd").mousedown(function(){ | |
$(this).addClass("active"); | |
}).mouseup(function(){ | |
var keyvalue = $(this).text(); | |
var target = current_input_target.get(0); | |
if(target){ | |
if(/^[0-9a-zA-Z]$/.test(keyvalue)){ | |
insertAtCursor(target,keyvalue); | |
}else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test Example, include three files: main.html, worker1.js, worker2.js | |
// We are going to post a message to worker2 through worker1 | |
// main.html | |
var w1 = new Worker('worker1.js'); | |
var w2 = new Worker('worker2.js'); | |
// creat a channel, give the ports to the workers | |
var mc = new MessageChannel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function paginate($baseurl,$total,$perpage,$curpage,$numlinks=10){ | |
$return = '<div class="pagination"><ul>'; | |
$pages = ceil($total/$perpage); | |
// 如果当前页大于总页数或小于1,则设置当前页为第一页 | |
$curpage = ($curpage > $pages || $curpage < 1) ? 1 : $curpage; | |
if($pages > 0){ | |
// 首页 上一页 | |
if($curpage != 1){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.dblkeydown = function(keyCode, callback){ | |
return $(this).keydown(function(e){ | |
if (e.which == keyCode) { | |
var lastTime = $(this).data('dblkeydown_' + keyCode); | |
var curTime = new Date().getTime(); | |
if (lastTime && (curTime - lastTime < $.fn.dblkeydown.maxInterval)) { | |
$(this).data('dblkeydown_' + keyCode, null); | |
callback.call(this); | |
}else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
添加开机启动任务计划 | |
@echo off | |
schtasks /create /tn "chaxunji" /tr "C:/ChaXunJi/清空打印任务启动查询机.exe" /sc onlogon | |
@echo "设置成功,按任意键退出。" | |
pause |
OlderNewer