Skip to content

Instantly share code, notes, and snippets.

View dorentus's full-sized avatar
🎲
🌎🌍🌏

ZHANG Yi dorentus

🎲
🌎🌍🌏
View GitHub Profile
# ISP Shanghai Telecom
bogus-nxdomain=180.168.41.175
# OpenDNS
bogus-nxdomain=67.215.65.132
bogus-nxdomain=67.215.77.132
bogus-nxdomain=208.69.34.132
bogus-nxdomain=208.69.32.132
# DNSPai
import Foundation
let url = NSURL(string: "https://spdy.today/spdy.json")
let request = NSURLRequest(URL: url)
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.currentQueue()) {
_, data, _ in
if data {
let str = NSString(data: data, encoding: NSUTF8StringEncoding)
println(str)
@dorentus
dorentus / .zshrc
Created July 4, 2014 06:17
$HOME/.zshrc
# history, http://wiki.gentoo.org/wiki/Zsh/HOWTO#History
export HISTSIZE=2000
export HISTFILE="$HOME/.history"
export SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups
setopt hist_ignore_space
# Banner
$HOME/bin/95-lolcat
/usr/local/bin/archey -c
#!/usr/bin/env ruby
require 'rb-inotify'
if ARGV.count < 3
puts "Usage: #{File.basename $0} <path> <signal> <cmd>"
exit 1
end
path = ARGV[0]
signal = ARGV[1].to_sym
  • Vagrantfile

  • boot2docker.fish

    • Fish-shell script
    • $__docker_vagrant_box_dir: folder for vagrant box, defaults to ~/opt/vagrant/docker, created from Vagrantfile if not exists. You might want to change it to a different location or use a different vagrant box.
    • function docker: bring up the vagrant box and run the original docker command
    • function turn_off_docker_vagrant_box : halt the vagrant box
@dorentus
dorentus / dig+trace.txt
Last active August 29, 2015 14:04
dig be.a.rubyist.today +dnssec +trace
└───🌐 dig t0.example.rubyist.today +dnssec +trace
; <<>> DiG 9.9.5-4-Debian <<>> t0.example.rubyist.today +dnssec +trace
;; global options: +cmd
. 1037 IN NS e.root-servers.net.
. 1037 IN NS b.root-servers.net.
. 1037 IN NS c.root-servers.net.
. 1037 IN NS a.root-servers.net.
. 1037 IN NS g.root-servers.net.
. 1037 IN NS h.root-servers.net.
set shell=/bin/sh " fix for fish
set nocompatible " be iMproved
filetype on " see: http://unix.stackexchange.com/questions/14497/
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
@dorentus
dorentus / AppDelegate.swift
Last active August 29, 2015 14:04
iBeacon Demo
import UIKit
import CoreLocation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate {
var window: UIWindow?
var locationManager: CLLocationManager!
#!/usr/bin/env ruby
begin
require 'unicorn'
rescue LoadError
abort "Required gem not found: unicorn"
end
if not File.exists? 'config.ru'
abort "Required file not found: ./config.ru"
convert -crop 120x120+487+49 screenshot.png [email protected]