Skip to content

Instantly share code, notes, and snippets.

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet id="1" author="sinossi">
<comment>Spring Security Authentication - Users Table</comment>
<createTable tableName="users">
<column name="username" type="varchar(50)">
<constraints primaryKey="true" nullable="false" />
# java.lang.OutOfMemoryError: Java heap space
-Xmx1024m
# java.lang.OutOfMemoryError: PermGenSpace
-XX:MaxPermSize=256M
# Remote debugging, see also http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/conninv.html
-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
@marcocaboni
marcocaboni / gist:2645091
Last active February 8, 2016 09:27
Bash tips
# File name from fullpath
find . -name *.sql | sed 's/^.*\///'
# or also
find . -name *.sql -exec basename {} \;
# delete folders containing big old files
find . -size +50M -mtime +150 -exec dirname {} \; | grep -v cache | xargs rm -rf
# execute a command in each sub-directory
for D in `find . -mindepth 1 -maxdepth 1 -type d`; do (cd $D && svn ci -m "commit post release" && cd -); done
# Remove files and dirs unknown to subversion
svn status | sed 's/?\s*//' | xargs rm -rf
# Find branch creation commit
svn log --stop-on-copy | tail
# Reverting to previous version
svn merge -r HEAD:<previous_version> .
# Reverting commits 123, 456, 789
@marcocaboni
marcocaboni / gist:3046060
Last active April 25, 2018 07:45
Maven tips
# Set new project version
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=1.41.1-SNAPSHOT
# Set new project version
mvn release:update-versions -DdevelopmentVersion=1.41.1-SNAPSHOT -B
# Show dependency tree detail (groupId and artifactId can be *)
mvn dependency:tree -Dverbose -Dincludes=groupId:artifactId
# Remove an artifact from the local maven repo
@marcocaboni
marcocaboni / gist:3230403
Last active October 7, 2015 21:49
Oracle tips
-- Tablespaces size and free space
select b.tablespace_name, tbs_size Size_Mb, a.free_space Free_Mb
from (select tablespace_name, round(sum(bytes)/1024/1024 ,0) as free_space
from dba_free_space group by tablespace_name) a,
(select tablespace_name, sum(bytes)/1024/1024 as tbs_size
from dba_data_files group by tablespace_name) b
where a.tablespace_name=b.tablespace_name;
-- List datafiles
SELECT * FROM dba_data_files;