Skip to content

Instantly share code, notes, and snippets.

@goncha
goncha / build.gradle
Last active Aug 29, 2015
build.gradle including dependency management (provided, exclude, files), svn info, sources jar
View build.gradle
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
project.version = "1.0"
try {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'svn'
@goncha
goncha / embed_cue.sh
Last active Aug 29, 2015
Embed cuesheet in flac file
View embed_cue.sh
#!/bin/sh
FLAC="${1:-Disc.flac}"
CUE="${FLAC%%.flac}.cue"
if [ ! -r "$CUE" ]
then
echo "Cannot read '$CUE'"
exit 1
@goncha
goncha / ffmpeg2mp4.cmd
Created Jul 19, 2014
ffmpeg video conversion
View ffmpeg2mp4.cmd
@echo off
D:\ffmpeg\bin\ffmpeg.exe -i %1 -f mp4 -c:v mpeg4 -b:v 2000k -g 300 -bf 2 -pass 1 -an -f rawvideo -y NUL
D:\ffmpeg\bin\ffmpeg.exe -i %1 -f mp4 -c:v mpeg4 -b:v 2000k -g 300 -bf 2 -pass 2 -c:a copy %2
@goncha
goncha / build-1.gradle
Last active Aug 29, 2015
build.gradle for SpringMVC
View build-1.gradle
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
project.version = "1.0"
try {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'svn'
@goncha
goncha / Makefile
Created Oct 11, 2014
Encrypt password in source control
View Makefile
.PHONY: _pwd_prompt decrypt_conf encrypt_conf
CONF_FILE=conf/settings.json
# 'private' task for echoing instructions
_pwd_prompt:
@echo "Contact jeresig@gmail.com for the password."
# to create conf/settings.json
decrypt_conf: _pwd_prompt
@goncha
goncha / lw-bootstrap.lisp
Created Mar 8, 2012
LispWorks bootstrap
View lw-bootstrap.lisp
(in-package "CL-USER")
(change-directory "D:\\code\\lisp\\")
(dolist (file (list "asdf.lisp"))
(compile-file file :load t))
(setf asdf:*central-registry*
(remove-if #'null
(mapcar #'(lambda (file) (if (eq :unspecific (pathname-name file)) file))
(directory #P"D:/code/lisp/"))))
@goncha
goncha / extract_audio_from_dvd
Created Jul 4, 2012
mencoder extract audio from DVD
View extract_audio_from_dvd
mencoder dvd://8 -dvd-device G: -of rawaudio -oac mp3lame -lameopts cbr:br=192 -af resample=44100 -ovc copy -o test.mp3
@goncha
goncha / gist:3532090
Created Aug 30, 2012
Sum numbers in a file
View gist:3532090
grep -o "[0-9]\+M$" dl.txt | grep -o "[0-9]\+" | awk '{s+=$1} END {print s}'
grep -o "[0-9]\+M$" dl.txt | grep -o "[0-9]\+" | paste -sd+ | bc
@goncha
goncha / gist:3793040
Created Sep 27, 2012
cfengine to sync files from phub
View gist:3793040
bundle agent sync_app
{
vars:
"opt_dir" string => "/home/app/opt",
comment => "Program directory";
"etc_dir" string => "/home/app/etc",
comment => "Configuration directory";
files:
@goncha
goncha / gist:3909494
Last active Oct 11, 2015
forward gzipped error mail to remote address
View gist:3909494
############
# ~/.forward
############
"|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #${USER}"
###############
# ~/.procmailrc
###############