This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rexml/document' | |
require 'rexml/streamlistener' | |
require 'fileutils' | |
include REXML | |
class Listener | |
include StreamListener | |
def tag_start(name, attributes) | |
if name == "testcase" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Scales down (or up) a video to 720p, re-encoding it as MPEG4. | |
# | |
# Useful as a Nautilus Script in Gnome. | |
# | |
# https://help.ubuntu.com/community/AndroidVideoEncoding#Expert mode: Using ffmpeg (command line) | |
ffmpeg -strict experimental -i "$1" -s 1280x720 -vcodec mpeg4 -b 3000k -acodec aac -ac 1 -ar 16000 -r 13 -ab 64000 "$1.shrinked.mp4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'optparse' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: update-schema [options]" | |
opts.on("-h", "--host HOSTNAME", "Database host to connect to") do |value| | |
options[:host] = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First cd to your git repo | |
# Execute this script. | |
# Create a feature branch by the name of case you are working on. | |
# (The branch name can include a dash followed by a keyword or two) | |
# Work hard. | |
# 'git commit' will open your editor with bugzid:1234 filled-in. | |
# Append a message, and voilà! | |
echo '#!/bin/sh | |
case "$2,$3" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Reads the EXIF date of all JPG files in the current folder, | |
# and moves the files to folders named by the date. | |
# | |
# On Ubuntu, the exif package is necessary: | |
# sudo apt-get install exif | |
for f in *.jpg *.JPG ; do | |
date=$(exif -t 0x9003 $f |grep Value|cut -d ' ' -f 4|tr ':' '-') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by: http://www.dd-wrt.com/wiki/index.php/WAN_Traffic_by_Month | |
ssh root@192.168.1.1 "nvram get traff-$(date +%m-%Y -d '-1 day')" > ~/consommation/`date +%Y-%m -d '-1 day'`.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert many jpg to a movie | |
mencoder "mf://*.jpg" -mf fps=12:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -o movie.avi | |
# Convert a movie to an animated GIF | |
mplayer movie.avi -vf scale=320:240 -vo gif89a:fps=12:output=movie.gif -nosound |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated make config: don't edit | |
# OpenWrt version: Barrier Breaker (r34882) | |
# Tue Jan 1 22:32:14 2013 | |
# | |
CONFIG_HAVE_DOT_CONFIG=y | |
# CONFIG_TARGET_ppc40x is not set | |
# CONFIG_TARGET_ppc44x is not set | |
# CONFIG_TARGET_realview is not set | |
# CONFIG_TARGET_atheros is not set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ========================= WARNING ======================== | |
# This is not intended to be run as-is, rather copy-pasted one line at a time! | |
# It contains comments with instructions to perform manually, such as opening | |
# a browser or configuring a VM in the VirtualBox GUI. | |
# ========================= WARNING ======================== | |
# | |
# Launch a "12.04 LTS JeOS Ubuntu" virtual appliance (works in Virtual Box) | |
# https://solutionexchange.vmware.com/store/products/12-04-lts-jeos-ubuntu | |
# TODO: Document VM settings changes (storage caching, network as "bridge") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CTRL-ALT-F1 | |
Login | |
# sudo su - | |
# init 3 | |
# rm /etc/X11/xorg.conf | |
# nvidia-xconfig | |
# xinit | |
# nvidia-settings | |
X Server Display Configuration | |
Rotate both monitors |