Skip to content

Instantly share code, notes, and snippets.

View alab1001101's full-sized avatar

Christian Albrecht alab1001101

View GitHub Profile
@alab1001101
alab1001101 / backup.sh
Created June 29, 2012 13:55
Backup on encrypted lvm partitions with external HD
#!/bin/bash
#
# Credits go to
# http://earlruby.org/2010/02/adding-an-external-encrypted-drive-with-lvm-to-ubuntu-linux/
if [[ root != $(whoami) ]] ; then
sudo $0 $@
exit 0
fi
@alab1001101
alab1001101 / mozup.sh
Created June 25, 2012 06:49
Mozilla Updater Shell Script
#!/bin/bash
LIBDIR=/usr/lib64
BINDIR=/usr/bin
TMPDIR=/tmp/mozup
FTP_BASE=ftp://releases.mozilla.org/mirror/mozilla
FTP_PATH=releases/latest/linux-x86_64/de
rm -rf $TMPDIR
mkdir $TMPDIR
cd $TMPDIR
@alab1001101
alab1001101 / globalPropsDiff
Created June 15, 2012 19:30
global props diff
(function(global) {
var getGlobalProps = function() {
var prop, globalProps = {};
for (prop in global) {
globalProps[prop] = true;
}
return globalProps;
},
getGlobalPropsDiff = function(globalProps) {
@alab1001101
alab1001101 / monitoring.sh
Created May 29, 2012 06:13
Process Monitoring Bash Script
#!/bin/bash
CMDS="php-fpm nginx memcached php java beam.smp|epmd"
OUTFILE=$(tty)
cmd_values=()
cmd_prev_value=""
function get_stats()
{
@alab1001101
alab1001101 / rsa_vagrant.pub
Created May 18, 2012 11:27
Public key for vagrant boxes
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmz9PTY5CCnZV2DT3AzZf/csON1STGPma4ZRARrHft22BTlRiyXvQjopDsRsPfrTdGPo2XgLe+2LWkD6cmWzS6qMu63FbFnJt5mD61iwZX16nFKSWO1qb7yTq+G8iIjU4CkGoQh4XV15BjbD1+CR/V5MhjwmKzIdpjnKArX1cljRCGDft+Ld6lXVvLp9mTuGEBSVwvP8NpNJ3RzI7Ck/675viQ2eLJM0d2g9d2RBuTKlYSpZfY+CXc4Hh6BepVpUv73f3n0MVqHquFijtD8i3n3CP7jGOuBRC5FR8QBGCTnBxFI4Ue9DZqfpA6/gttRxlN8qsQWDBKYVK/Kx1+Xyov alab@cat510.dev
@alab1001101
alab1001101 / maydp.js
Created April 17, 2012 20:34
Month and Year only Jquery.datepicker
$(function(){
$('.monthyearpicker').datepicker({
dateFormat: 'mm.yy',
changeMonth: true,
changeYear: true,
durration: 0,
beforeShow: function(input, instance) {
var dates = instance.input.val().split('.'),
nows = $.datepicker.formatDate('mm.yy.dd', new Date()).split('.');
$.extend(dates, {
@alab1001101
alab1001101 / phpcomplete.vim
Created June 1, 2010 16:59
Vim php completion script
" Vim completion script
" Language: PHP
" Original Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Maintainer: Christian Albrecht ( alab1001101 at gmail )
" Last Change: 2010 June 1
"
" TODO:
" - Class aware completion:
" a) caching?
" - Switching to HTML (XML?) completion (SQL) inside of phpStrings
@alab1001101
alab1001101 / zfsvn.sh
Created April 18, 2010 15:18
script for import zend framework svn trunk to local git and vice versa and easy commiting of patches to releases
#!/bin/bash
# This script takes four different actions
#
# import
# imports updatet svn_dir trunk into git_dir master
# and pushs git master after that rebases git_branch
#
# export
# calls import and then exports git_branch