Skip to content

Instantly share code, notes, and snippets.

View sharjeelaziz's full-sized avatar

Sharjeel Aziz sharjeelaziz

View GitHub Profile
@sharjeelaziz
sharjeelaziz / aitopng
Created April 20, 2011 14:44
Convert Adobe Illustrator files to pngs, crop them, and create thumbnails
#!/bin/bash
if [ ! -d ./png ]; then mkdir ./png; fi;
# convert Adobe Illustrator to pngs
# uses ImageMagick
for f in *.ai;
do
echo "Processing $f"
convert -density 300 $f ./png/${f/.ai}_raw.png
@sharjeelaziz
sharjeelaziz / createPlist.sh
Created April 22, 2011 17:34
Generate ImageInfo.plist for all the images in the current directory
#!/bin/sh
# Requires ImageMagick
# Updates ImageInfo.plist -- plist file should already exist
# and initialized as /usr/libexec/PlistBuddy -c "Clear array" ImageInfo.plist
IMAGEINFOFILE="ImageInfo.plist"
/usr/libexec/PlistBuddy -c "Clear array" $IMAGEINFOFILE
INDEX=0
@sharjeelaziz
sharjeelaziz / addunversioned.sh
Created May 7, 2011 04:10
Add all unversioned files to svn
svn add `svn status .|grep "^?"|awk '{print $2}'`
@sharjeelaziz
sharjeelaziz / gist:960195
Created May 7, 2011 04:12
Add all unversioned files to svn
svn status | grep '?' | sed 's/^.* /svn add /' | bash
@sharjeelaziz
sharjeelaziz / kill_attrs.py
Created June 7, 2011 20:48 — forked from bradmontgomery/kill_attrs.py
A way to remove all HTML attributes with BeautifulSoup
from BeautifulSoup import BeautifulSoup
def _remove_attrs(soup):
for tag in soup.findAll(True):
tag.attrs = None
return soup
def example():
doc = '<html><head><title>test</title></head><body id="foo" onload="whatever"><p class="whatever">junk</p><div style="background: yellow;" id="foo" class="blah">blah</div></body></html>'
@sharjeelaziz
sharjeelaziz / tunnelbroker-net.sh
Created June 6, 2012 19:00 — forked from pklaus/tunnelbroker-net.sh
tunnelbroker.net automatic tunnel IP update and tunnel setup (on Mac OS X)
#!/bin/bash
#### This script is published by Philipp Klaus <philipp.l.klaus@web.de>
#### on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-automatic-ip-update-on-mac-os-x/>
#### It is originally by freese60 and modified by limemonkey.
#### Found on <http://www.tunnelbroker.net/forums/index.php?topic=287.0>
### Uncomment this line to debug the script:
#set -x
#!/usr/bin/env ruby
require 'net/http'
require 'net/https'
BASEDIR = '/etc'
LAST_IP_FILE = "#{BASEDIR}/tunnelbroker.lastip"
# for debugging.
BE_VERBOSE = false
echo 'events {
worker_connections 1024;
}
error_log /usr/local/Cellar/nginx/1.5.8/error.log;
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
# make the tmpfs
mkdir /mnt/tmpfs
chmod 0700 /mnt/tmpfs
mount -t tmpfs -o size=1M tmpfs /mnt/tmpfs
cd /mnt/tmpfs
# decrypt the data
gpg -o - <crypted_input_file> | \
tar -xjpf -

Keybase proof

I hereby claim:

  • I am sharjeelaziz on github.
  • I am sharjeelaziz (https://keybase.io/sharjeelaziz) on keybase.
  • I have a public key ASAnIyX4JmbRkUHocKHPVHSPPjTj5NDDmY1PU7JSk1tT4wo

To claim this, I am signing this object: