Skip to content

Instantly share code, notes, and snippets.

@goncha
goncha / build.gradle
Last active August 29, 2015 14:01
build.gradle including dependency management (provided, exclude, files), svn info, sources jar
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 August 29, 2015 14:03
Embed cuesheet in flac file
#!/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 July 19, 2014 05:20
ffmpeg video conversion
@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 August 29, 2015 14:04
build.gradle for SpringMVC
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 October 11, 2014 02:08
Encrypt password in source control
.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 March 8, 2012 09:27
LispWorks bootstrap
(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 July 4, 2012 16:21
mencoder 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 August 30, 2012 16:15
Sum numbers in a file
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 September 27, 2012 09:12
cfengine to sync files from phub
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 October 11, 2015 19:38
forward gzipped error mail to remote address
############
# ~/.forward
############
"|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #${USER}"
###############
# ~/.procmailrc
###############