Skip to content

Instantly share code, notes, and snippets.

View akiatoji's full-sized avatar
🕋
Currently traveling in time.

Aki Atoji akiatoji

🕋
Currently traveling in time.
  • TARDIS
View GitHub Profile
@akiatoji
akiatoji / gist:3013633
Created June 28, 2012 20:13
Installing w3af on Ubuntu 11.x

Pre-requisite: Download w3af and pybloomfiltermmap tarballs and expand.

sudo apt-get install python2.7-dev python-nltk python-soappy python-lxml python-svn python-scapy graphviz python-gtksourceview2
cd pybloomfiltermmap-0.2.0
sudo python setup.py install
#
# Now you can
cd w3af
./w3af_gui
@akiatoji
akiatoji / gist:3044056
Created July 3, 2012 23:06
Nginx + Passenger 3 + RVM for Rack app on OS X using homebrew only

Most examples I found tell you to run rvmsudo or passenger-install-nginx-module. I ran into problems with these because:

  1. rvmsudo leaves root owned directories and files under rvm passenger gem directory. This will give you seemingly odd errors later when you try to remove/upgrade passenger gem, or try to use homebrew to install passenger.

  2. There's no good place to put nginx using passenger-install-nginx-module. Putting it under /usr/local means you have to remember it's there amongst homebrew files. Anywhere else, you still have to remember you put it there. We'd rather manage nginx install via homebrew.

So to install everything with homebrew, this is what it took:

gem install passenger
@akiatoji
akiatoji / Run local Gem doc server.md
Last active October 6, 2015 19:57
Setting up Yard server as rack app in Nginx

Run Yard server to serve Gem docs

Based on good work found at http://goo.gl/bKjJe

If you have Nginx running, you can run Yard as a rack app to serve docs for locally installed Gem.

  1. Create a directory to host Rack app. Install yard gem
mkdir -p ~/Dropbox/yard/public
@akiatoji
akiatoji / gist:4074537
Created November 14, 2012 20:23
Simple HTML5 video hosing (via Oreilly webinar)
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML5</title>
</head>
<body id="demo" onload="">
<video id="vid1" controls width="635" height="264" preload="auto">
<source src="file:///Users/aki/Downloads/05_building-your-first-real-application.mp4" type="video/mp4" />
@akiatoji
akiatoji / gist:4241705
Last active October 13, 2015 19:07
Installing Ruby 1.9.3 on CentOS 6.3 (and Amazon Linux)
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar xzvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix=/usr/local && make
sudo make install
# Add /usr/local/lib in /etc/ld.so.conf.d/usrlocal.conf
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz
tar xzvf ruby-1.9.3-p286.tar.gz
@akiatoji
akiatoji / _sns_description
Last active January 15, 2020 02:30
AWS SNS Sample code.
Notes on how to use AWS SNS:
1. Subscribe an HTTP endpoint (i.e. http://myhost/sns_endpoint) on AWS Console
2. AWS will send subscription confirmation right away
3. SNS_controller responds to subscription confirmation by sending confirmation using Fog.
4. Once AWS is happy, you can start sending notifications to your end point via SNS.
@akiatoji
akiatoji / gist:4560227
Created January 17, 2013 22:01
rbenv + Ruby 1.9.3 + Nginx + MongoDB + Redis + Node.js using homebrew on OS X Mountain Lion
brew install mongodb redis node
brew install rbenv ruby-build rbenv-vars readline ctags
CONFIGURE_OPTS="--disable-installdoc --with-readline-dir=$(brew --prefix readline)" rbenv install 1.9.3-p327
rbenv global 1.9.3-p327
# now intsall passenger + nginx
# Note: I only install passenger+nginx on dev machine to verify config.
# For coding you are far better off with POW. http://pow.cx
gem install passenger
Getting started
===============
# Make sure you have ggplot2 installed
install.packages("ggplot2")
library(ggplot2)
Basic examples
==============
On OS X, apps started by Finder doesn't pick up PATH from shell's login script.
This creates a problem using NVidia CUDA Nsight IDE since it NSight relies finding CUDA SDK in PATH.
NVIDIA gives you a shell script for this, but this is uh, lame.
BTW, NSight is built on Eclipse and it shouldn't be a problem for NSight to pick up CUDA SDK path
without resorting to scanning PATH. We don't have this problem with JDK, for example.
Anyways, here's how you fix it:
sudo vi /Developer/NVIDIA/CUDA-5.0/libnsight/nsight.app/Contents/Info.plist
@akiatoji
akiatoji / Fix NVidia NVPACK Eclipse install on OS X
Last active December 17, 2015 16:39
Fixing bundled environment vars for Eclipse bundled with NVidia NVPACK for Tegra
Just like NSight, NVPACK install adds a bunch of environment variables in your .bash_profile and .bashrc.
This actually broke things as it overrides ANT_HOME and adds a bunch of PATH that conflicts with Android SDK
installed elsewhere.
Changes to Info.plist below will set up these variables when NVPACK Ecilpse.app is invoked from Dock or shell.
Works on 10.8.x Mountain Lion, and my Nexus 7 is now happily buzzing away.
/Developer/NVPACK/eclipse/Eclipse.app/Contents/Info.plist
Add the following inside the top level dict