Skip to content

Instantly share code, notes, and snippets.

Avatar

tokune tokune

View GitHub Profile
View autoupdate.sh
#!/bin/sh
cd /mnt/mmcblk0p2
rm -rf artifact R2S*.zip FriendlyWrt*img*
wget https://github.com/klever1988/nanopi-openwrt/releases/download/R2S-Lean-$(date +%Y-%m-%d)/R2S-Lean-$(date +%Y-%m-%d)-ROM.zip
if [ -f /mnt/mmcblk0p2/R2S*.zip ]; then
echo -e '\e[92m今天固件已下载,准备解压\e[0m'
else
echo -e '\e[91m今天的固件还没更新,尝试下载昨天的固件\e[0m'
wget https://github.com/klever1988/nanopi-openwrt/releases/download/R2S-Lean-$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)/R2S-Lean-$(date -d "@$(( $(busybox date +%s) - 86400))" +%Y-%m-%d)-ROM.zip
View config.yaml
---
name: flac
version: 2
handle:
- rewrite: if(!is_file()) goto "index.php"
- compress: if(out_header["Content-Length"] >= 10240) compress
- compress: if(out_header["Content-Type"] ~ "text") compress
- compress: if(out_header["Content-Type"] ~ "application/javascript") compress
...
View up.sh
#!/bin/sh
file_name=$1
curl -F i=@$file_name http://flac.sinaapp.com
View gist:3713532
#!/usr/bin/env python
#-*-coding:utf-8-*-
import os
import codecs
import itertools
import time
def main(template = 'template.html'):
i = 0
for root, dirs, files in os.walk('college-/'):
@tokune
tokune / gist:3683337
Created Sep 9, 2012
vmware linux static url
View gist:3683337
["http://downloads.sourceforge.net/thoughtpolicevm/centos-4.6-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-4.7-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-4.8-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-4.8-x86_64-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.0-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.1-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.2-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.3-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.3-x86_64-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.4-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.4-x86_64-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.5-i386-server.zip", "http://downloads.sourceforge.net/thoughtpolicevm/centos-5.5-x86_64-s
@tokune
tokune / gist:2817974
Created May 28, 2012
跨域关闭检测
View gist:2817974
<SCRIPT LANGUAGE="JavaScript">
window.onload=function(){
document.getElementById("open").onclick=function(){
var url="http://pinban.com/oauth/weibo/binding/";
var win=window.open(url);
var timer = setInterval((function(win){
return function(){
if (win.closed) {
alert("fuck off!!");
clearInterval(timer);
You can’t perform that action at this time.