Skip to content

Instantly share code, notes, and snippets.

View jdorfman's full-sized avatar

Justin Dorfman jdorfman

View GitHub Profile
for i in `cat list`; do echo "select * from db.table where value = ${i}" |mysql -umysqluser -ps3cur3p@$$w0rd; done
# nginx vhost conf
# redirect images with DMCA complaints
location ~ ^/attach/201204.*\.jpg$ {
alias /usr/local/nginx/html/suspend.html;
}
@jdorfman
jdorfman / es.sh
Created April 10, 2012 22:39 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 10.10-11.04
cd /tmp/
sudo apt-get update
sudo apt-get install unzip curl python-software-properties -y
#sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
@jdorfman
jdorfman / gist:2403041
Created April 17, 2012 02:39
bash function to run sshuttle asap
# get it here: https://github.com/apenwarr/sshuttle
# put this in your .bash_profile and smoke it && source ~/.bash_profile
function p () { /path/to/sshuttle/sshuttle -r you@server 0.0.0.0/0 -vv; }
# p for proxy (change it to whatever you want I guess)
@jdorfman
jdorfman / gist:2474890
Created April 24, 2012 00:26
my new favorite utility
mutt -s "Birthday celebration" -a citymap.jpg all@friends.org \
< invitation.txt
$ mkdir -p {1..3}/{1..3}
# Result:
$ tree
.
|-- 1
| |-- 1
| |-- 2
| `-- 3
|-- 2
@jdorfman
jdorfman / gist:2501118
Created April 26, 2012 17:26 — forked from netdna/gist:2501099
nginx - return a 403 response for certain referers
#place this in nginx.conf or a vhosts
if ($http_referer ~* (keyword|domain.com|www.domain.com))
{ return 403; }
@jdorfman
jdorfman / gist:2505372
Created April 27, 2012 03:14
Nginx vhosts RegEx
# place this in a nginx vhosts && service nginx reload
location ~ ^/path/to/files/img.*\.jpg$ {
alias /usr/local/nginx/html/suspend.html;
}
# transfer large files in half the time with lftp. SCP and Rsync can't touch this.
lftp -e 'pget -n4 sftp://user:passwd@ftp.server.com/tmp/bigfile.tgz'
Microsoft is a failed company? They have had products that failed (so has every other successful company). But with a $269 Billion market cap, I don't think they are failed company as of today... Maybe they are becoming irrelevant, it really depends on your perspective. Like it or not hey still have the seventh most visited site in the world (live.com), the largest browser market share @ 27.95% (as of March 2012), and 85% of the OS market.
Don't get me wrong, the only thing I use from Microsoft is their optical mouses (I think they are the best IMO). But they are far from a failed company. Barnes and Noble on the other hand...
Sources:
https://www.google.com/finance?client=ob&q=NASDAQ:MSFT
http://www.netmarketshare.com/operating-system-market-share.aspx?qprid=10
http://www.alexa.com/topsites
http://en.wikipedia.org/wiki/Usage_share_of_web_browsers