Skip to content

Instantly share code, notes, and snippets.

View include's full-sized avatar
👽
Free Jaffa

Francisco Cabrita include

👽
Free Jaffa
View GitHub Profile
@include
include / funnydom.rb
Created March 3, 2011 02:24
build funny OR stupid domain names
require 'open-uri'
letters = { 'v' => 'aeiou',
'c' => 'bcdfghjklmnpqrstvwxz' }
10.times do
@word = Array.new
"cvvcvc".each_char do |byte|
source = letters[byte]
@include
include / .bash_prompt
Created March 12, 2012 23:50 — forked from melo/.bash_prompt
uber git PS1
#!/bin/bash
#
# PS1 magic
#
# Mostly copied from YUVAL KOGMAN version, added my own __git_ps1 stuff
# Original: http://gist.github.com/621452
#
# See video demo of this at http://vimeo.com/15789794
#
# To enable save as .bash_prompt in $HOME and add to .bashrc:
#!/bin/bash
# A Shell Script To Convert All .flac Files To .MP3 Format
# Note: I found this script somewhere on usenet and I've modified it for my needs
METAFLAC=/usr/local/bin/metaflac
FLAC=/usr/local/bin/flac
#ID3=/usr/bin/id3
LAME=/usr/local/bin/lame
FIND=/usr/bin/find
t=$(${FIND} . -type f -iname "*.flac")
#! /usr/bin/env python
# -*- conding: UTF-8 -*-
import sys
import os
import time
def main():
'''yep this is an awesome but tiny test'''
#!/bin/bash
URL_LIST=$*
YOUTUBE_DL="/usr/local/bin/youtube-dl"
YOUTUBE_DL_OPTS="--title --restrict-filenames --write-thumbnail --extract-audio --audio-format mp3 --audio-quality 0 --continue --no-overwrites"
${YOUTUBE_DL} ${YOUTUBE_DL_OPTS} ${URL_LIST}
# NAGIOS LAZY ./CONFIGURE NOTES
export VERSION="3.5.1"
./configure
--prefix=/servers/MONIT/nagios-${VERSION}
--cache-file=/servers/MONIT/nagios-${VERSION}/var/nagios.cache
--with-lockfile=/servers/MONIT/nagios-${VERSION}/var/nagios.lock
--with-checkresults-dir=/servers/MONIT/nagios-${VERSION}/var/checkresults
#!/bin/sh
setup_brew () {
if ![-f "/usr/local/bin/brew"]; then
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
fi
}
setup_ipython () {
brew install gcc
@include
include / python27unicode.py
Created January 22, 2014 15:45
Playing with unicode on Python 2.7
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from pprint import pprint
import json
st = u"lol"
lt = [["foo", 1],["bar", 2]]
foo = {"keys": "hosts",
@include
include / bongo.sh
Created January 22, 2014 17:20
MongoDB export all collections from database
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
-h Show this help.
-l Load instead of export
@include
include / pyDatetime.py
Created February 4, 2014 16:36
Datetime nightmare
# -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals)
import time, datetime
import pprint as pprint
# 2014-02-04 13:40:42.394000
dt = datetime.datetime
now = dt.today()