Skip to content

Instantly share code, notes, and snippets.

@jbonney
jbonney / .profile
Created August 28, 2013 17:47
Synology upgrade. Files to verify and update.
# File /root/.profile
umask 022
PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
export PATH
#This fixes the backspace when telnetting in.
#if [ "$TERM" != "linux" ]; then
# stty erase
#fi
@jbonney
jbonney / rvm.sh
Created August 21, 2013 20:53
Create rvmrc in project folder
rvm --rvmrc --create ruby_version@gemset
@jbonney
jbonney / module_list.sh
Created August 19, 2013 10:42
View list of Apache modules currently enabled
apache2ctl -t -D DUMP_MODULES
@jbonney
jbonney / related_articles_help.rb
Created August 18, 2013 14:50 — forked from owengriffin/related_articles_help.rb
Identify related articles based on similar tags in article tags sets
@jbonney
jbonney / deploy.rb
Created August 17, 2013 15:15
Mina deployment file to setup new host for Rails applications. Creates the folder structure, fill up the database.yml file, create the associated DB and user and set up new Apache virtual host file.
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
# Usually mina focuses on deploying to one host and the deploy options are therefore simple.
# In our case, there is a number of possible servers to deploy to, it is therefore necessary to
# specify the host that we are targeting.
server = ENV['server']
# Since the same host can have multiple applications running in parallel, it is necessary to
@jbonney
jbonney / rotated-header.css
Created July 18, 2013 20:29
Rotate HTML header in table
.table-header-rotated th.row-header{
width: auto;
}
.table-header-rotated td{
width: 40px;
border-top: 1px solid #dddddd;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
vertical-align: middle;
@jbonney
jbonney / conf.nanorc
Created June 20, 2013 11:14
Nano syntax highlighting for configuration files. https://bbs.archlinux.org/viewtopic.php?id=133595.
# /usr/share/nano/conf.nanorc
# To enable add the following line in /etc/nanorc
## Configuration files (catch-all syntax)
# include "/usr/share/nano/conf.nanorc"
# config file highlighting
syntax "conf" "(\.(conf|config|cfg|cnf|rc|lst|list|defs|ini|desktop|mime|types|preset|cache|seat|service|htaccess)$|(^|/)(\w*crontab|mirrorlist|group|hosts|passwd|rpc|netconfig|shadow|fstab|inittab|inputrc|protocols|sudoers)$|conf.d/|.config/)"
# default text
@jbonney
jbonney / books
Created June 19, 2013 21:09
Compare book prices from different UK libraries: http://www.gettextbooks.com/isbn/[ID]
http://www.gettextbooks.com/isbn/9780273764496
@jbonney
jbonney / jar_through_proxy
Created June 18, 2013 19:56
Execute Java jar program through a socks proxy.
java -jar -DsocksProxyHost=localhost -DsocksProxyPort=8080 program.jar
@jbonney
jbonney / dash
Created June 12, 2013 13:35
Rebuild Ubuntu Dash application DB. Restore the possibility to search applications using the Ubuntu dash. http://askubuntu.com/questions/125843/dash-search-gives-no-result
rm ~/.cache/software-center -R
unity --reset &