Skip to content

Instantly share code, notes, and snippets.

View alfredormz's full-sized avatar
:octocat:

Alfredo Ramírez alfredormz

:octocat:
View GitHub Profile
export PS1='\[\033[01;32m\]\W \[\033[00;37m\]$(echo $(branch) \$\[\033[00m\]'
HISTCONTROL=ignoredups:ignorespace
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s histappend
alias ls='ls -lF'
alias la='ls -A'
alias l='ls -CF'
@alfredormz
alfredormz / bulk_mov2mp4.sh
Created June 17, 2012 05:40
Script to convert .mov files to mp4
file_path=$1
count=0
for file in $file_path/*mov ; do
ffmpeg -i "$file" -vcodec copy -acodec copy "${file%.*}".mp4
rm "$file"
let count=count+1
done
notify-send ".mov 2 .mp4 convertion" "$count files converted" --icon=totem
@alfredormz
alfredormz / gist:2956384
Created June 19, 2012 20:35
Script para determinar el mime de un archivo sin extension
file -i file_name \
| cut -d ':' -f2 \
| cut -d ';' -f1 \
| cut -d '/' -f2
@alfredormz
alfredormz / gist:2956533
Created June 19, 2012 21:05
Determina el mime type de un archivo sin extension
file -b --mime-type filename
#application/x-rar
@alfredormz
alfredormz / gist:2991863
Created June 25, 2012 22:34
Bash git merge helpers
merge_to() {
target=$1
branch_to_merge=$(branch)
git checkout ${target}
git merge --no-ff ${branch_to_merge}
}
merge_tod() {
target=$1
branch_to_merge=$(branch)
@alfredormz
alfredormz / package.json
Created July 7, 2012 17:44
nodejs package.json file example
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "2.5.10",
"jade": ">= 0.0.1",
"node-foursquare": "~0.1.3"
},
"devDepedencies": {
@alfredormz
alfredormz / remove-old-kernels.sh
Last active December 17, 2015 06:18
Elimina los kernels viejos y actualiza grub.
#TODO: cambiar el 11 para que elimine la cantidad total de kernels viejos excepto el usado actualmente.
dpkg --list | grep linux-image-3 | cut -d ' ' -f 3 | head -n11 | xargs sudo apt-get purge -y | sudo update-grub2
@alfredormz
alfredormz / ask_for_sudo.vim
Last active December 17, 2015 07:59
vim :w!! When you need to make changes to a system file, you can override the read-only permissions by typing :w!!, vim will ask for your sudo password and save your changes.
cmap w!! %!sudo tee > /dev/null %
@alfredormz
alfredormz / hidemenubar.sh
Last active December 17, 2015 10:59
Hides the gnome-terminal menu bar
gconftool --type boolean --set /apps/gnome-terminal/profiles/Default/default_show_menubar false
@alfredormz
alfredormz / das_downloader.rb
Created June 2, 2013 16:15
Script to download my Destroy All Software screencast collection
#! /usr/bin/env ruby
require 'mechanize'
#usage das_dowloader.rb [destination_path]
URL = "https://www.dropbox.com/sh/cy20e9npok91qc4/FxNKaTDdqE/das?lst"
path = ARGV[0] || "."
agent = Mechanize.new
agent.pluggable_parser.default = Mechanize::Download