Skip to content

Instantly share code, notes, and snippets.

@zserghei
zserghei / flyway.sh
Created November 15, 2017 08:13
Flyway wrapper
#!/bin/sh
if [ $# -eq 0 ]
then
echo "Please specify argument."
echo "create, clean, info, migrate"
else
case `uname` in
MSYS*)
cmd="\"${FLYWAY_HOME}\flyway.cmd\""
;;
@zserghei
zserghei / multiple-pull.sh
Created November 15, 2017 08:10
Pull multiple git projects
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status.
for d in *; do
if [[ -d $d && -f $d/pom.xml ]]; then
echo " Processing $d"
git -C $d -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
git -C $d -c diff.mnemonicprefix=false -c core.quotepath=false pull origin
git -C $d -c diff.mnemonicprefix=false -c core.quotepath=false submodule update --init --recursive
fi
done
@zserghei
zserghei / multiple-clone.sh
Created November 15, 2017 08:09
Git clone multiple projects
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status.
for rep in \
http://xxx@stash.example.com/project1.git \
http://xxx@stash.example.com/project2.git \
http://xxx@stash.example.com/project3.git \
; do
folder=`echo $rep | awk -F'/' '{print $NF}' | cut -d'.' -f1`
if [ ! -d $folder ]; then
echo " $folder"
@zserghei
zserghei / git-config.sh
Created November 15, 2017 08:06
Configuration of git
git config --global user.name "Xxx Xxx"
git config --global user.email "xxx@example.com"
git config --global credential.helper "cache --timeout=86400"
git config --global credential.helper wincred
cat VTS_01_1.VOB VTS_01_2.VOB VTS_01_3.VOB VTS_01_4.VOB VTS_01_5.VOB VTS_01_6.VOB > mymovie.vob
# subtitles as separate stream (not supported by tv)
ffmpeg -probesize 600M -analyzeduration 600M -i mymovie.vob -map 0:0 -map 0:1 -map 0:3 -f matroska -c:v mpeg4 -q:v 3 -c:a libmp3lame -c:s copy -sub_charenc UTF8 -metadata:s:s:0 language=eng mymovie.mkv
# hardcoded subtitles
ffmpeg -probesize 600M -analyzeduration 600M -i mymovie.vob -f matroska -c:v mpeg4 -q:v 3 -c:a libmp3lame -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:1 mymovie.mkv
# combine video+audio and several subtitles files into one output
ffmpeg -i input.avi -i subtitles1.srt -i subtitles2.srt -map 0 -map 1 -map 2 -f matroska -c:v mpeg4 -q:v 3 -c:a libmp3lame -c:s copy output.mkv
@zserghei
zserghei / gist:8634874
Created January 26, 2014 16:04
svn last changes
svn log --username USERNAME --password PASSWORD URL --limit 5
svn diff --summarize --username USERNAME --password PASSWORD URL -r FROM:HEAD
@zserghei
zserghei / gist:5267412
Last active December 15, 2015 13:29
Useful Perl commands

Predefined variables

$$ # process id
$_ # default variable, some functions use it, when nothing else is defined
$! # last error of OS (usefull with 'die')
@_ # list of arguments of function $_[0] - 1st argument, $_[1] -2nd argument
$~ # format for current descriptor
$% # number of pages (counter) for current descriptor
$- # number of lines (up-down counter) till the end of page for current descriptor
@zserghei
zserghei / gist:5228629
Last active December 15, 2015 08:09
Eclipse performance tips
  • Add the next lines to eclipse.ini:
    -Xverify:none
    -Xms512m
    -Xmx1024m
    -XX:MaxPermSize 368m
  • Open Window/Preferences/Java/Compiler/Building. Change "Maximum number of problems reported per compilation unit" from 100 to 10.
  • Open Window/Preferences/General/Appearance/Label Decorations and disable decorations that are not used.
  • Open Window/Preferences/General/Appearance. Uncheck "Enable animations".
@zserghei
zserghei / gist:5224922
Last active February 17, 2021 17:35
Ubuntu 14.04 post-install commands
# logout and login using Gnome Classic (no effects)
sudo apt-get install gnome-session-fallback
# show scrollbar in windows
gsettings set com.canonical.desktop.interface scrollbar-mode normal
# change font of windows titlebar
gsettings set org.gnome.desktop.wm.preferences titlebar-font 'Ubuntu 10'
# show all applications in gnome-session-properties
cd /etc/xdg/autostart/