Skip to content

Instantly share code, notes, and snippets.

@jamiecurran
jamiecurran / gist:3360975
Created August 15, 2012 15:19
Gentoo - associate files with application (mime-type)
Query first:
xdg-mine query default application/pdf
Then set:
xdg-mime default mupdf.desktop application/pdf
@jamiecurran
jamiecurran / gist:4622736
Created January 24, 2013 15:06
postgresql - copy date from table to csv using ',' as a delimiter.
\copy calls to 'data.csv' with delimiter ',';
@jamiecurran
jamiecurran / gist:4745340
Created February 9, 2013 14:07
(OS X) Vagrant & CentOS 6
(host) vagrant box add CentOS_6.3_x86_64_minimal https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box
(host) vagrant init
(host) vim Vagrantfile
(host) config.vm.box = "CentOS_6.3_x86_64_minimal"
# Update vm virtualbox guest additions
(host) cp /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso .
(host) vagrant up
(host) vagrant ssh
(vm) wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
(vm) sudo rpm -i rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
@jamiecurran
jamiecurran / gist:4963144
Created February 15, 2013 20:11
Gentoo - remove specific lib version.
emerge -av --depclean =postgresql-server-9.1.6
@jamiecurran
jamiecurran / gist:5029579
Created February 25, 2013 12:43
Ruby - Factorials
(1..n).reduce(1, :*)
@jamiecurran
jamiecurran / gist:5327132
Created April 6, 2013 18:42
Bash for loop - changing delimiter
IFS=$'\n'
@jamiecurran
jamiecurran / gist:5327370
Last active December 15, 2015 21:39
Rename MTS files using created timestamp
IFS=$'\n'
for f in `find *`; do mv $f $(exiftool -q -p '$DateTimeOriginal' $f | tr ' ' '_' | tr ':' '_').MTS; done
@jamiecurran
jamiecurran / gist:5477008
Created April 28, 2013 14:18
Gemfile versioning syntax
~> 2.2 - >= 2.2, < 3.0
@jamiecurran
jamiecurran / gist:5481864
Created April 29, 2013 14:21
Basic .gitignore
*.jar
*.iml
.idea/
/target
@jamiecurran
jamiecurran / gist:5502667
Created May 2, 2013 14:41
BoneCP Spring confg
<bean class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy" id="dataSource">
<constructor-arg name="targetDataSource" ref="boneCPDataSource"/>
</bean>
<bean class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close" id="boneCPDataSource">
<property name="driverClass" value="${database.driverClassName}"/>
<property name="jdbcUrl" value="${database.url}"/>
<property name="username" value="${database.username}"/>
<property name="password" value="${database.password}"/>
<property name="maxConnectionsPerPartition" value="30"/>