Skip to content

Instantly share code, notes, and snippets.

curl http://swimsuit.si.com/swimsuit/assets/json/data.min.json | perl -wnE 'say for /assets\\\/media\\\/gallery\\\/(?:\w+\\\/|)[\w\-]+\\\/op\d+-\d+-raw1200\.jpg/g' | sed 's/\\\//\//g' | sort | uniq | xargs -I {} wget "http://swimsuit.si.com/swimsuit/{}"
curl -u <username>:<password> http://api.fanfou.com/statuses/friends_timeline.xml | grep '<text>' | sed 's/<text><\!\[CDATA\[//' | sed 's/\]\]><\/text>//' | sed 's/ //g'
@zliuva
zliuva / fanfou.js
Created December 24, 2010 06:17
A node.js command line client for Fanfou.com
#!/usr/bin/env node
/**
* fanfou.js
* A node.js Fanfou client
* © 2010 softboysxp.com
*/
/**
* Copyright 2010 softboysxp.com. All rights reserved.
for i in {1..48}; do wget `curl http://sportsillustrated.cnn.com/2011_swimsuit/models/brooklyn-decker/11_brooklyn-decker_$i.html | grep '<div id="cnnImage">' | sed 's/.*"\(.*\.jpg\)".*/\1/'`; done;
@zliuva
zliuva / cpuid.s
Created July 8, 2011 14:56
An x86_64 OS X port of the cpuid example found in Ch. 4 of Professional Assembly
# cpuid.s
# An x86_64 OS X port of the cpuid example found in Ch. 4 of Professional Assembly Language
#
# $ as -o cpuid.o cpuid.s
# $ ld -o cpuid cpuid.o
# $ ./cpuid
# GenuineIntel
# $
.data
@zliuva
zliuva / cpuid2.s
Created July 9, 2011 07:40
calling libc functions on OS X x64
# cpuid2.s
# calling libc functions on OS X x64
#
# $ as -g -o cpuid2.o cpuid2.s
# $ ld -o cpuid2 -lc cpuid2.o
# $ ./cpuid2
# Vendor ID: GenuineIntel
# $
.data
@zliuva
zliuva / hello.s
Created July 21, 2011 15:48
A simple Hello World for ARM on iOS
.text
.globl start
start:
mov r2, #14
adr r1, hello_str
mov r0, #1
mov r12, #4
swi 0x80
curl -Ss http://www.si.com/swimsuit/collection/2016 | egrep -o '/swimsuit/model/.+?/2016/photos' | parallel curl -Ss http://www.si.com{} | egrep '<img src=("[^"]+").+?class="image (?:Landscape|Portrait)"\s+/>' | egrep -o 'http://.+?\.jpg' | parallel wget {}
@zliuva
zliuva / gist:1084476
Last active July 31, 2023 21:32
A minimal Mach-o x64 executable for OS X
; A minimal Mach-o x64 executable for OS X (also see below Mountain Lion version)
;
; $ nasm -f bin -o tiny_hello tiny_hello.s
; $ chmod +x tiny_hello
; $ ./tiny_hello
; Hello World!
; $
; c.f.
; http://osxbook.com/blog/2009/03/15/crafting-a-tiny-mach-o-executable/ ( the original tiny mach-o executable )
$ diff ddclient-ubnt.bak ddclient-ubnt
4252,4253c4252
< my $headers = "X-Auth-Email: $config{$key}{'login'}\n";
< $headers .= "X-Auth-Key: $config{$key}{'password'}\n";
---
> my $headers = "Authorization: Bearer $config{$key}{'password'}\n";