Skip to content

Instantly share code, notes, and snippets.

@bandicoot86
bandicoot86 / gist:5635337
Last active December 17, 2015 15:59
Spring property loader from the datasource.
import java.io.ByteArrayInputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
import javax.naming.NamingException;
import javax.sql.DataSource;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.slf4j.Logger;
@bandicoot86
bandicoot86 / clean-up
Created July 20, 2013 11:43
Remove the file mentioned and clean up the history of it.
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch src/main/resources/links.txt' --prune-empty --tag-name-filter cat -- --all
@bandicoot86
bandicoot86 / gist:6790938
Created October 2, 2013 08:57
Fetch updated from origin/master into a current branch.
git branch -u origin/master
@bandicoot86
bandicoot86 / gist:6841999
Created October 5, 2013 15:03
Copy this to ~./bashrc for rvm to work properly.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@bandicoot86
bandicoot86 / gist:6889667
Created October 8, 2013 18:54
Restore nginx in init.d folder
# Download nginx startup script
wget -O init-deb.sh http://library.linode.com/assets/660-init-deb.sh
# Move the script to the init.d directory & make executable
sudo mv init-deb.sh /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
# Add nginx to the system startup
sudo /usr/sbin/update-rc.d -f nginx defaults
@bandicoot86
bandicoot86 / gist:6966828
Created October 13, 2013 20:04
Wget to copy sites
wget --mirror -p --adjust-extension --no-parent --convert-links -P . http://www.rasc.ru/gear/skis/2013/
@bandicoot86
bandicoot86 / gist:6991805
Created October 15, 2013 13:46
Generate maven jar
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.0 -DgroupId=ru.socimate.spring.bus -DartifactId=socibus-core
@bandicoot86
bandicoot86 / gist:6991808
Created October 15, 2013 13:46
Generate maven jar
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0 -DgroupId=ru.socimate -DartifactId=rest-api
@bandicoot86
bandicoot86 / gist:7080175
Created October 21, 2013 08:00
Ojdc artifact
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dpackaging=jar -Dversion=11.2.0.2.0 -Dfile=path -DgeneratePom=true