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 / 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 / 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 / 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 / gist:8014984
Created December 17, 2013 23:50
Heroku
git remote add heroku git@heroku.com:project.git
git push heroku <branch>:master
@albertohm
albertohm / knockout.haml
Created December 16, 2013 11:20
knockout debugging
%pre{"data-bind" => "text: ko.toJSON($data, null, 2)"}
@albertohm
albertohm / asound.conf
Created December 2, 2013 12:07
Max sound on pulseaudio. Copy on /etc/asound.conf
pcm.!default {
type plug
slave.pcm "softvol"
}
pcm.softvol {
type softvol
slave {
pcm "dmix"
}
<!DOCTYPE html>
<html>
<head>
<link type='text/css' rel='stylesheet' href='style.css'/>
<title>Hello, World!</title>
</head>
<body>
<?php
@albertohm
albertohm / README.md
Created November 4, 2013 22:41 — forked from ayosec/README.md

Xvnc

The scripts in this gist will start an Xvnc server with a basic window manager (IceWM). This is intended to use in a virtual machine, where we can need to start a browser to run a test suite.

Installation on Debian

All commands have to be run as root

apt-get install icewm vnc4server
@albertohm
albertohm / gist:7290725
Created November 3, 2013 14:18
knockout.js debugging
%pre{"data-bind" => "text: JSON.stringify(ko.toJS($data), null, 2)"}
@albertohm
albertohm / startup
Created September 19, 2013 23:35
Fluxbox startup
#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.
# Change your keymap:
xmodmap "/home/alberto/.Xmodmap"
# Applications you want to run with fluxbox.