A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
#!/usr/bin/env ruby | |
# iOS App Store Crawler by Nowa <nowazhu@gmail.com> | |
# 2010-08-04 | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
USERAGENT = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4' | |
LETTERS = %w{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z *} |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>App Redirection</title> | |
</head> | |
<body> | |
<!-- | |
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom | |
protocol handlers. |
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
#!/bin/bash | |
last_ip="" | |
tail -f /var/log/vsftpd.log | while read LINE; do | |
{ | |
if [[ "${LINE}" =~ "FAIL LOGIN" ]]; then | |
ip="$(echo ${LINE} | awk '{ip=$NF;gsub(/\"/,"",ip);print ip}')" | |
if [[ "$last_ip" == "$ip" ]]; then | |
echo "block $ip" | |
iptables -A INPUT -s "$ip" -j DROP | |
fi |
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
import struct | |
import math | |
import os | |
import sys | |
from PIL import Image | |
from subprocess import call | |
if sys.version > '3': | |
buffer = memoryview |
render | |
for each particle | |
x, y = particle.position | |
color = sample( colorMap, x, y ) | |
noise = sample( noiseMap, x, y ) | |
angle = noise * PI * 2 | |
particle.velocity.add( cos(angle), sin(angle) ) |
#!/bin/sh | |
#create a new chain named SHADOWSOCKS | |
iptables -t nat -N SHADOWSOCKS | |
# Ignore your shadowsocks server's addresses | |
# It's very IMPORTANT, just be careful. | |
iptables -t nat -A SHADOWSOCKS -d YOUR-SERVERS-IP-ADDRESS -j RETURN | |
# Ignore LANs IP address |