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
# Setup and packages | |
```sh | |
sudo aptitude install icecast2 gstreamer0.10-pulseaudio gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly-multiverse gstreamer-tools pavucontrol | |
``` | |
Remember the password when setting up `icecast2` (when prompted by the install | |
script), because we will use it later on. | |
# Setup pulse |
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/sh | |
if [ $# -eq 0 ] | |
then | |
echo "$(basename $0) [-w|-c|-l|-L]? file.pdf+" | |
echo "\t-w : count words" | |
echo "\t-c : count characters" | |
echo "\t-l : count lines" | |
echo "\t-L : maximum line length" | |
exit 1 |
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
var http = require('http'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var AUDIOFILE = "./audio.ogg"; | |
function serveWithRanges(request, response, content) { | |
var range = request.headers.range; | |
var total = content.length; | |
var parts = range.replace(/bytes=/, "").split("-"); |
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/zsh -x | |
mkdir timelapse_frames | |
cd timelapse_frames | |
# in seconds | |
if [ -z $1 ] | |
then | |
duration=10 | |
else | |
duration=$1 | |
fi |
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/zsh -x | |
mkdir timelapse_frames | |
cd timelapse_frames | |
# in seconds | |
if [ -z $1 ] | |
then | |
duration=10 | |
else | |
duration=$1 | |
fi |
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
function mozillaSaveFile(filePath,content) | |
{ | |
if(window.Components) { | |
try { | |
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); | |
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); | |
file.initWithPath(filePath); | |
if(!file.exists()) | |
file.create(0,0664); | |
var out = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream); |
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/sh | |
time=$(zenity --text="On bloque le net combien de temps ?" --scale --value=60 --min-value=1 --max-value=600) | |
echo $time | |
network_interface=$(ifconfig | grep Link | tr -s ' ' | cut -d ' ' -f1) | |
for i in $network_interface | |
do |
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
### add_license_block.sh | |
#! /bin/sh | |
OWNER="Paul ADENOT \& Martin Richard" | |
YEAR="2011" | |
ORGANIZATION="bim" | |
FILEAUTHOR="Paul ADENOT <paul@paul.cx>" | |
fill_license_block() |
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
# A tiny wifi meter | |
# usage : shoes wifi.rb | |
Shoes.app(:title => "wifi meter", :width => 250, :height => 100) do | |
background gradient(rgb(0,0,0), rgb(40,40,40)) | |
header = { | |
:font => 'Georgia', | |
:size => '48px', | |
:stroke=>'#'+'E'*3, |
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
" | |
" _ _(_)_ __ ___ _ __ ___ | |
" / \ / / | '_ ` _ \| '__/ __| | |
" \ V /| | | | | | | | | (__ | |
" \_/ |_|_| |_| |_|_| \___| | |
" | |
" | |
" Paul ADENOT -- 2011 | |
" You need the following plugins : | |
" DoxygenToolkit indent_guidesm syntasticm |