Skip to content

Instantly share code, notes, and snippets.

@kfatehi
kfatehi / install_motioneye_on_pi.sh
Last active August 29, 2015 14:03
install_motioneye_on_pi.sh
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y python-tornado python-jinja2 python-imaging motion ffmpeg v4l-utils
cd /home/pi
git clone https://bitbucket.org/ccrisan/motioneye.git
cd motioneye && git fetch && git checkout 0.13
cp settings_default.py settings.py
@kfatehi
kfatehi / announce_pi.conf
Last active August 29, 2015 14:03
announce pi via prowl
[program:announce_pi]
command=/home/pi/announce_pi
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=false
user=pi
@kfatehi
kfatehi / salt-master-setup.sh
Created July 16, 2014 20:51
saltstack quick setup ubuntu 14.04
echo deb http://ppa.launchpad.net/saltstack/salt/ubuntu `lsb_release -sc` main | sudo tee /etc/apt/sources.list.d/saltstack.list
wget -q -O- "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x4759FA960E27C0A6" | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y salt-master

Having trouble installing the latest stable version of tmux?

Save yourself some time and run this little fellow!

Prerequisities

  • gcc
  • wget
@kfatehi
kfatehi / _readme.md
Last active August 29, 2015 14:04
docker tricks

where i sticks my docker tricks!

@kfatehi
kfatehi / jsonrunner.js
Created August 8, 2014 23:15
json runner
#!/usr/bin/env node
/* Pipe JSON like the following into me to spawn it
* {"command":"sh","args":["-x","-c","echo 'hello'"]}
*/
var spawn = require('child_process').spawn
, json = ""
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
http://robots.thoughtbot.com/weechat-for-slacks-irc-gateway
https://my.slack.com/account/gateways
If you're Team Owner has set up IRC, you'll see something like this:
Host: my.irc.slack.com
User: keyvan
Pass: my.secret
@kfatehi
kfatehi / _SITE_TEST.md
Last active August 29, 2015 14:06
Test if a site is returning 200 OK
> verify-site http://google.com ; echo $?
> 0
> verify-site http://localhost:1234 ; echo $?
> 1
> verify-site http://google.com 500 ; echo $?
> 1
> verify-site http://github.com/definitely/a/fourofor 404 ; echo $?
> 0
@kfatehi
kfatehi / haproxy.cfg
Created September 20, 2014 08:07
haproxy reverse proxy by host
global
log 127.0.0.1 local0 notice
maxconn 2000
user haproxy
group haproxy
defaults
log global
mode http
option httplog