Skip to content

Instantly share code, notes, and snippets.

View ziggear's full-sized avatar

Ziggear ziggear

  • Some Company
  • Earth
View GitHub Profile
iptables -I INPUT -s 204.124.183.100 -j DROP
iptables -I INPUT -s 222.186.21.236 -j DROP
iptables -I INPUT -s 182.100.67.4 -j DROP
iptables -I INPUT -s 186.5.7.98 -j DROP
iptables -I INPUT -s 211.151.17.134 -j DROP
iptables -I INPUT -s 93.174.95.81 -j DROP
iptables -I INPUT -s 200.141.133.74 -j DROP
iptables -I INPUT -s 222.186.56.117 -j DROP
iptables -I INPUT -s 43.229.53.21 -j DROP
@ziggear
ziggear / make_simulator_folders.py
Created October 28, 2014 07:09
Find all Xcode6 Simulators
import os, re, commands
temp_file_name = "temp.txt"
command = "xcrun simctl list > %s" % temp_file_name
os.popen(command)
ios_list = {}
cur_ios = None
regex_block = re.compile(r"-- (iOS [5-8].[0-9]) --")
@ziggear
ziggear / gist:0a160643cf48da40938a
Created June 18, 2014 09:27
Google IPV4 and IPV6 addresses
#UPDATE:2013-12-07 12:16
127.0.0.1 localhost
#SmartHosts START
#Google Services START
203.208.46.200 0.docs.google.com
203.208.46.200 0.drive.google.com
203.208.46.200 1.docs.google.com
203.208.46.200 1.drive.google.com
@ziggear
ziggear / gist:9479865
Created March 11, 2014 05:13
姓名列表操作 bash
#!/bin/bash
#
# 1:列出文件夹下所有人的名字并保存成文件
# 2:根据指定URL到Google生成QRCode并下载
#
rm ./name_list.txt
rm -r ./QRCodes
mkdir ./QRCodes
@ziggear
ziggear / gist:9206330
Created February 25, 2014 10:16
using block and callback
//block declare:
typedef int (^startBlock)(int a, int b);
typedef int (^endBlock)();
- (void) runBlock:(startBlock)_startBlock end:(endBlock)_endBlock{
int a = _startBlock(1,2);
int b = _endBlock();
NSLog(@"start block result : %d", a);
NSLog(@"end block result : %d", b);
}
@ziggear
ziggear / gist:8970652
Created February 13, 2014 06:14
城市列表处理 bash
#!/bin/bash
RAW="庆:101050901七台河:101051002鸡西:101051101鹤岗:101051201齐齐哈尔:101050201大兴安岭:101050701长春:101060101延吉:101060301四平:101060401白山:101060901白城:101060601辽源:101060701松原:101060801吉林:101060201通化:101060501沈阳:101070101鞍山:101070301抚顺:101070401本溪:101070501丹东:101070601葫芦岛:101071401营口:101070801阜新:101070901辽阳:101071001铁岭:101071101朝阳:101071201盘锦:101071301大连:101070201锦州:101070701"
echo $RAW | grep -Eo '(.+?):([0-9]+)' | awk -F ':' '
BEGIN{
printf "%-12s %-12s \n","City","Number"
printf "-------------------------\n"
}
@ziggear
ziggear / gist:8952169
Created February 12, 2014 09:04
行数据分解
echo "庆:101050901七台河:101051002鸡西:101051101鹤岗:101051201齐齐哈尔:101050201大兴安岭:101050701长春:101060101延吉:101060301四平:101060401白山:101060901白城:101060601辽源:101060701松原:101060801吉林:101060201通化:101060501沈阳:101070101鞍山:101070301抚顺:101070401本溪:101070501丹东:101070601葫芦岛:101071401营口:101070801阜新:101070901辽阳:101071001铁岭:101071101朝阳:101071201盘锦:101071301大连:101070201锦州:101070701" | grep -Eo '(.+?):([0-9]+)'
@ziggear
ziggear / gist:8412680
Created January 14, 2014 03:44
weibo fixer hand-script
<!-- 让个人首页内容等宽居中 -->
<div class="W_main_c" style="left:50%; top:50%; width:auto;">
@ziggear
ziggear / gist:8251551
Created January 4, 2014 04:10
my sqlite scripts
-- select hunman readable time from a unix timestamp
select
latitude,longitude,datetime(time / 1000, 'unixepoch', 'localtime') as time
from UploadedGPSPoints order by -time;
@ziggear
ziggear / gist:8084951
Last active January 1, 2016 03:19
Adblock script for Weibo
weibo.com##DIV[class="WB_feed_type SW_fun S_line2 type_spe"]
weibo.com##DIV[class="WB_feed_type SW_fun W_no_border S_line2"]
weibo.com##DIV[class="key S_textb"]
weibo.com##DIV[class="W_tips tips_error clearfix"]
weibo.com##DIV[class="WB_feed_together S_line1 S_bg1"]
weibo.com##DIV[id="pl_rightmod_noticeboard"]
weibo.com##DIV[id="trustPagelet_recom_memberv5"]
weibo.com##DIV[id="pl_leftnav_app"]
weibo.com##DIV[id="trustPagelet_indexright_recom"]