Skip to content

Instantly share code, notes, and snippets.

@ptantiku
ptantiku / favicon_download.sh
Created December 19, 2013 06:58
Download top 1000 website's favicon image. Websites are ranked by Alexa.com
#!/bin/bash
wget http://s3.amazonaws.com/alexa-static/top-1m.csv.zip
unzip top-1m.csv.zip
for l in `head -n 1000 top-1m.csv`
do
host=`echo -n $l|cut -d, -f2`
wget -O "$host.ico" "http://$host/favicon.ico"
done
@ptantiku
ptantiku / gist:6031663
Last active December 19, 2015 22:59
q1
#!/usr/bin/env ruby
all=[*'0000'..'9999'];open('numbers.txt').each_line{|line|all[line.to_i]=nil};open('run_result.txt','w').puts all.compact!
@ptantiku
ptantiku / config_apache2_haml_sass.sh
Created July 16, 2013 03:11
Configure Apache2 to support HAML and SASS
#!/bin/bash
# enable mod_ext_filter
a2enmod ext_filter
# create temp config file
cat <<EOF > /tmp/haml_sass
# For HAML & SASS (http://d.hatena.ne.jp/ursm/20080923/1222195693)
LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so
@ptantiku
ptantiku / install_rbenv.sh
Last active December 19, 2015 18:18
Install RBENV
# Install development tools:
sudo apt-get update
sudo apt-get -y install build-essential git-core \
make libc6-dev libssl-dev libssl-dev \
libreadline6-dev zlib1g-dev libyaml-dev
# Install rbenv:
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Add rbenv to the path (for BASH):
@ptantiku
ptantiku / rbenv_path_env
Created July 12, 2013 08:53
Script for set RBENV path (for putting in .bashrc or .zshrc)
# setup RBENV's path
export RBENV_ROOT="$HOME/.rbenv"
if [ -d "$RBENV_ROOT" ]; then
if [ -d "$RBENV_ROOT/versions/$RBENV_VERSION" ]; then
export PATH="$RBENV_ROOT/versions/$RBENV_VERSION/bin:$PATH"
export PATH="$RBENV_ROOT/shims:$PATH"
else
export PATH="$RBENV_ROOT/bin:$PATH"
export PATH="$RBENV_ROOT/shims:$PATH"
fi