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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <time.h> | |
#include <fcntl.h> | |
#include <sys/ioctl.h> | |
#include <linux/kd.h> | |
#include "parapin.h" |
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 | |
database=$1 | |
if [ "$database" == "" ] ; then | |
echo "Usage: $0 <database>" > /dev/stderr | |
exit 1 | |
fi | |
if [ ! -r /home/darwin/check_postgres/check_postgres.pl ] ; then | |
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
class ApplicationController < ActionController::Base | |
before_filter :restore_time_zone | |
after_filter :remember_time_zone | |
protected | |
def restore_time_zone | |
Time.zone = cookies[:time_zone] if cookies[:time_zone] | |
Time.zone = current_user.time_zone if current_user && current_user.time_zone |
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 | |
# Put this in your crontab to be notified when your repo is dirty or commits needs to be pushed to a remote. | |
# Example crontab: | |
# MAILTO=user@yourdomain | |
# 0 * * * Mon-Fri /path/to/check-repo-status /path/to/repo | |
cd $1 | |
git status | grep 'working directory clean' 2>/dev/null 1>/dev/null || { | |
git status | |
git diff | |
exit |
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/perl -w | |
# For Gnome users, name this file "Upload to OpenStreetMap", make it executable, and place it | |
# into your ~/.gnome2/nautilus-scripts/ folder. Then, when you right-click a file, you can go | |
# to "Scripts", and "Upload to OpenStreetMap". You will be prompted to enter a description for | |
# the GPX trace, and a visibility. | |
# | |
# Based on: http://wiki.openstreetmap.org/wiki/Batch_Upload#Perl | |
# Converted to Zenity by Nicolas Marchildon (elecnix), June 2010 |
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
SELECT | |
pg_relation_size(c.oid), | |
pg_size_pretty(pg_relation_size(c.oid)), | |
relkind, | |
relname, | |
nspname | |
FROM | |
pg_class c, | |
pg_namespace n | |
WHERE |
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 | |
# To install: | |
# mkdir ~bin | |
# Paste this in ~bin/open_mailto.sh | |
# chmod a+x ~bin/open_mailto.sh | |
# Go to System \ Preferences \ Preferred Applications | |
# Under Mail Reader, select Custom, and then put /home/username/bin/open_mailto.sh into the Command window, changing "username" to your username. | |
# Voilà! Credits to: http://www.howtogeek.com/howto/ubuntu/set-gmail-as-default-mail-client-in-ubuntu/ | |
google-chrome "https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`" |
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 | |
# | |
# Send by e-mail new entries in the Bash history of all users. | |
# | |
# usage: mail-history <email> <subject> | |
# | |
TMPFILE=`tempfile 2>/dev/null` || TMPFILE=`mktemp` || exit 1 | |
declare -i CHANGES | |
CHANGES=0 |
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 | |
# | |
# Make this script executable, then go to a folder with a .torrent file, | |
# right-click on it, go to Properties, Open With, Add, Select a customized | |
# application, then browse to the script. Make that the default. | |
# | |
# Now, when you right-click on the .torrent, utorrent should be the first choice, | |
# and double-clicking the file should open it in utorrent. | |
# | |
# Note: you should adjust the path to utorrent.exe and the drive letter. |
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
__license__ = 'GPL v3' | |
__author__ = 'Lorenzo Vigentini' | |
__copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>' | |
__version__ = 'v1.01' | |
__date__ = '14, January 2010' | |
__description__ = 'Canadian Paper ' | |
''' | |
http://www.ledevoir.com/ | |
''' |