Skip to content

Instantly share code, notes, and snippets.

View srpouyet's full-sized avatar

Sebastiaan Pouyet srpouyet

View GitHub Profile
@srpouyet
srpouyet / search_isbn.rb
Created August 3, 2010 13:01
Zoeken op ISBN op bol.com en Selexyz.nl
# Dit script leest de ISBN nummers uit isbn.csv uit en zoekt het ISBN-nummer vervolgens op op bol.com en selexyz.nl.
# In theorie is er maximaal één resultaat. De productpaginalinks worden weggeschreven in aangevuld_isbn.csv
require 'mechanize'
require 'csv'
# Browser agent maken. Agent alias is optioneel
agent = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Mozilla'
}
@srpouyet
srpouyet / Rails CMS alternatives
Created May 26, 2011 20:35
Great List of Ruby CMS's
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
@srpouyet
srpouyet / gist:1000076
Created May 31, 2011 06:48
Show octal file permissions
$ ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}'
@srpouyet
srpouyet / gist:1000099
Created May 31, 2011 07:23
Tar a dir and send over remote
# tar a dir and send to remote over ssh
tar czf - dirname | ssh user@host '(cd /home && tar xzvf -)
@srpouyet
srpouyet / handyGITcommands.md
Created December 20, 2011 16:34
Handy Commands

#Handy GIT Commands

Configure diffmerge as git's default merge and diff tool:

 git config --global diff.tool diffmerge
 git config --global difftool.diffmerge.cmd "diffmerge \"\$LOCAL\" \"\$REMOTE\""
 git config --global merge.tool diffmerge
 git config --global mergetool.diffmerge.cmd "diffmerge --merge --result=\"\$MERGED\" \"\$LOCAL\" \"\$BASE\" \"\$REMOTE\""
 git config --global mergetool.diffmerge.trustexitcode false
@srpouyet
srpouyet / mongodb
Created February 29, 2012 17:14
Mongodb logrotate on Ubuntu
# Put this in /etc/logrotate.d/mongodb
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth
/var/log/mongo/*.log {
daily
rotate 30
compress
dateext
missingok
notifempty
@srpouyet
srpouyet / gist:2693659
Created May 14, 2012 12:19 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@srpouyet
srpouyet / gist:2693661
Created May 14, 2012 12:19
Sublime Text 2 - Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@srpouyet
srpouyet / ubuntu.markdown
Created June 27, 2012 19:21
Handy Ubuntu Commands

sudo adduser --system --no-create-home --group --disabled-login systemusername

@srpouyet
srpouyet / nginx.conf
Last active August 5, 2018 22:37
Nginx Upstart script (Ubuntu 12.04)
### Nginx upstart script
### source: http://serverfault.com/a/391737/70451
### /etc/init/nginx.conf
description "nginx http daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/sbin/nginx