Skip to content

Instantly share code, notes, and snippets.

View albertohm's full-sized avatar

Alberto Hernández Mateos albertohm

View GitHub Profile
@albertohm
albertohm / simple-deployer.rb
Created February 11, 2014 00:42
simple-deployer.rb
require 'rubygems'
require 'sinatra'
get '/' do
"Leave this place"
end
# Pass in the repo name and deploy that shit
get '/deploy/:name/:branch' do
@albertohm
albertohm / process_shows.rb
Created March 23, 2014 03:17
Just a simple script to move files from my download dir to my tvshows dir
require 'find'
require 'fileutils'
DOWNLOAD_PATH = '/media/raspberry/descargas'
EXCLUDED_DIRS = %w( temp torrents )
TVSHOWS_PATH = '/media/raspberry/series'
EXCLUDED_DIRS_PATH = EXCLUDED_DIRS.map{|dir| DOWNLOAD_PATH + "/#{dir}"}
TVSHOWS = Dir.entries(TVSHOWS_PATH).select do |entry|
@albertohm
albertohm / convert_dvd.sh
Created November 22, 2014 00:52
convert to dvd
mkdir newvids
for f in *.mp4; do ffmpeg -i "$f" -c:v mpeg4 -vtag xvid newvids/"${f%.mkv}.avi"; done
@albertohm
albertohm / hola_mundo.rb
Created February 16, 2012 13:41
Hola mundo
puts "Hola mundo"
@albertohm
albertohm / bad_thing
Created February 20, 2012 13:14
Git Grayskull power
git rev-parse 304439d > .git/refs/heads/master
git checkout master
git push -f origin
@albertohm
albertohm / launch_xbmc.sh
Created March 3, 2012 01:13
Launch XBMC adjusting screen
#! /bin/bash
STATUS=0
WINCLASS=xbmc.bin.xbmc.bin
DISPLAY=:0.0
SLEEPDELAY=1
/usr/bin/xbmc "$@" &
while [ $STATUS -eq 0 ]
@albertohm
albertohm / update_xbmc_library.sh
Created March 3, 2012 01:14
Update XBMC library
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.ScanForContent", "id": "mybash"}' -H 'content-type: application/json;' http://localhost:8080/jsonrpc
@albertohm
albertohm / .vimrc
Created March 14, 2012 10:05
My .vimrc
""PATHOGEN ------------------------------------
"call pathogen#runtime_append_all_bundles()
"call pathogen#helptags()
"filetype off " required!
"VUNDLE --------------------------------------
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
@albertohm
albertohm / gist:2763071
Created May 21, 2012 16:12
Tests from VNC
vncserver :1
export DISPLAY=:1
Para verlo: vnc :1
# Start the Xvnc server whatever happens
( ( nc -z -w 1 localhost 5900 || Xvnc4 -geometry 1680x1080 -SecurityTypes None) & ) &>> /tmp/xvnc4.log
export DISPLAY=:0