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
# change foo to your library name | |
# change Foo::Database to your Sequel database | |
namespace :bundler do | |
task :setup do | |
require 'rubygems' | |
require 'bundler/setup' | |
end | |
end |
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
# This prevents capistrano from hanging when executing long tasks | |
# /etc/ssh/sshd_config | |
TCPKeepAlive yes | |
ClientAliveInterval 15 | |
ClientAliveCountMax 5 | |
# Restart sshd |
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
# From http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users | |
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done |
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
" Replace "url('../images/*.*)" by "url(<%= asset_path '*.* %>)" | |
" | |
" Useful when you need to change a css file to be converted in a css.erb file | |
" | |
%s/url(\(\.\.\/images\/\)\(.\+\))/url\(<%= asset_path '\2' %>\)/gc | |
%s/url('\(\.\.\/images\/\)\(.\+\)')/url\(<%= asset_path '\2' %>\)/gc |
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
# By default the behavior is: | |
# Primary monitor work as always and second monitor only have one and fixed workspace | |
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor remain as is. | |
# The desired behaviour is: | |
# Primary monitor and secondary monitor are linked workspace. | |
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor too. | |
$ gconf-editor | |
# Look for /desktop/gnome/shell/windows/workspaces_only_on_primary and set to false |
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
## From http://johannes.jarolim.com/blog/2011/11/21/extreme-slow-imagemagick-on-vps-with-ubuntu/ | |
# | |
# Execute as root | |
apt-get update | |
apt-get install build-essential | |
apt-get build-dep imagemagick | |
cd /usr/local/src |
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
# I'm using --create-options to get all the info about table creation (i.e. engine=InnoDB) | |
$ mysqldump -u foobar -p --single-transaction --create-options <database> > file.sql | |
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
## Copied from: http://technotes.twosmallcoins.com/?p=356 | |
# Get table listing and generate ALTER sql file | |
$ mysql -u foobar -p -e "show tables in <database> ;" | tail --lines=+2 | xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql | |
# Execute ALTER sql queries generated to convert from MyISAM to InnoDB: | |
$ mysql -u foobar -p <database> < alter_table.sql |
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
# | |
# COPIED FROM http://www.1stbyte.com/2011/06/28/unixodbc-example-setup-on-ubuntu-lucid-with-mysql-and-postgresql/ | |
# | |
# Do the obvious, install mysql an postgresql first. :) | |
# install unixodbc | |
apt-get install unixodbc unixodbc-dev libmyodbc odbc-postgresql | |
cd to /etc/ODBCDataSources |
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 | |
# | |
## Calomel.org calomel_interface_stats.sh | |
# | |
IF=eth0 | |
SECS=`uptime | awk '{ if ($3 ~ /:/) { split($3,a,":"); print (a[1]*60+a[2])*60} else { split($3,b,":"); split($5,a,":"); print b[1]*86400+(a[1]*60+a[2])*60} }'` | |
EXT_IN=`netstat -n -i $IF | grep $IF | tail -1 | awk '{print $4}'` | |
EXT_OUT=`netstat -n -i $IF | grep $IF | tail -1 | awk '{print $8}'` | |
echo " " |