Skip to content

Instantly share code, notes, and snippets.

View pmoranga's full-sized avatar

Pmoranga pmoranga

View GitHub Profile
@res0nat0r
res0nat0r / make-mvid-nfo.rb
Created October 18, 2011 04:46
Generate music video .nfo files for XBMC
#!/usr/bin/env ruby
Dir.glob('**/*.*').each do |file|
nfo = File.dirname(file) + "/" + File.basename(file).split('.').first + ".nfo"
genre, artist, album = File.dirname(file).split('/')
title = File.basename(file).split('.').first.gsub(/_/, ' ').gsub(/.*?-/, '')
next if File.exists?(nfo)
file = File.open(nfo, 'w')
file << <<EOF
@maximebf
maximebf / webtail.py
Created October 21, 2011 13:25
Web tail / tail -f as a webpage using websocket
#!/usr/bin/python
# Equivalent of "tail -f" as a webpage using websocket
# Usage: webtail.py PORT FILENAME
# Tested with tornado 2.1
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket
# http://thomas.pelletier.im/2010/08/websocket-tornado-redis/
import tornado.httpserver
@poobury
poobury / recipe.rb
Created November 9, 2011 10:20 — forked from casualjim/recipe.rb
S3 File Resource for Chef
# Source accepts http/https or the protocol region:// with the host as the bucket
# access_key_id and secret_access_key are just that
# Note resource name has changed from s3_file to s3_aware_remote_file
# for the eu-west-1 region:
s3_aware_remote_file "/var/bulk/the_file.tar.gz" do
source "s3-eu-west-1://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
@kirbysayshi
kirbysayshi / mass-aggregation-change.sh
Created November 23, 2011 17:14
quick examples of how to change many many wsp (graphite/whisper) files settings
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max;
fi;
done
@mmrwoods
mmrwoods / new_linode_centos6.markdown
Created February 7, 2012 11:39
Make me a new CentOS linode

Make me a new CentOS linode

Notes:

  • Instructions written for CentOS 6.3
  • Change, me, myhost, myip etc. to your username, hostname, ip address and so on.
  • Run all commands as root unless otherwise directed.
  • You might want to look at mounting /var and /home on separate partitions.
  • I've just allowed all members of the wheel group to operate as root. This is the height of laziness and highlights the fact that I'm just a developer that's stolen a sysadmin's
@jeffmccune
jeffmccune / puppet_multiple_ca.md
Created July 5, 2012 19:03
Puppet Multiple CA's

Standard CA Bundle

This CA bundle is located at puppet master --confdir=$PUPPET_CONFDIR --configprint localcacert and contains CA certs in the following order:

  1. Root CA
  2. Signing CA
  3. Puppet Master CA 1
  4. Puppet Master CA 2

The following error may be resolved by changing the CA certificate order in the bundle to be:

@Thermionix
Thermionix / auth-basic.conf
Last active November 4, 2021 00:56
nginx reverse proxy for sickbeard, couchpotato etc.
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@abhishekkr
abhishekkr / common.csv
Created September 9, 2012 12:07
Puppet Module : No Code In Data ~ Externalize Data into separately managed CSV files
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2 in line 1.
# $MANIFESTPATH/extdatadir/common.csv
httpd_conf_dir,/etc/httpd/conf.d
httpd_is_cgi,true
httpd_git_path,/var/www/git
httpd_git_url,/mygit
@jedi4ever
jedi4ever / gist:3698451
Created September 11, 2012 13:26
Puppet loop over hash and pass array of args to sysctl
Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin' }
$sysctl_settings = {
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
"net.ipv4.ip_forward" => 1 ,
"net.ipv6.conf.default.forwarding" => 1 ,
"net.ipv6.conf.all.forwarding" => 1 ,
"net.ipv4.conf.default.proxy_arp" => 0 ,
# Enables source route verification
@dataolle
dataolle / sendxbmc.sh
Created December 4, 2012 18:50
send url to xbmc's json-rpc service for playback on the big screen
#!/bin/bash
#set url and port to the xbmc box webservice
XBMC_HOST="http://127.0.0.1:8080"
if [ "$1" = "" ]; then
echo -n "Insert URL: "
read url
else
url="$1"
fi