Skip to content

Instantly share code, notes, and snippets.

View dist-play-app-initd
#!/bin/bash
#
# =========================================================================
# Copyright 2014 Rado Buransky, Dominion Marine Media
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
View play2_init_script
#!/bin/sh
### BEGIN INIT INFO
# Provides: playframework
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop playframework
### END INIT INFO
#
@EmmanuelKasper
EmmanuelKasper / gist:a39e14023be325a70810
Last active Aug 29, 2015
Vmdeboostrap for Freedombox
View gist:a39e14023be325a70810
SUITE=sid MIRROR=http://http.debian.net/debian DESTINATION=hdd MACHINE=virtualbox ARCHITECTURE=i386
vmdebootstrap --log build/freedombox.log --log-level debug --size 4G \
--image build/freedombox-unstable_2015-01-14_virtualbox-i386-hdd.img \
--hostname freedombox --verbose --mirror http://http.debian.net/debian \
--customize /usr/local/src/freedom-maker/bin/freedombox-customize \
--lock-root-password --arch i386 --roottype btrfs --distribution sid \
--grub --enable-dhcp \
--package apt --package base-files --package ifupdown --package initramfs-tools \
--package logrotate --package module-init-tools --package netbase --package rsyslog \
--package udev --package debian-archive-keyring
View cinephilia.sql
DROP TABLE IF EXISTS playing;
DROP TABLE IF EXISTS film;
DROP TABLE IF EXISTS category;
DROP TABLE IF EXISTS kino;
-- userless: drop tables seem also to drop the sequences
-- DROP SEQUENCE IF EXISTS film_film_id_seq;
-- DROP SEQUENCE IF EXISTS category_category_id_seq;
-- DROP SEQUENCE IF EXISTS kino_kino_id_seq;
@EmmanuelKasper
EmmanuelKasper / gist:c9efb72717e121985e4b
Last active Aug 29, 2015
VirtualBox DKMS with Promox kernel
View gist:c9efb72717e121985e4b
# get proxmox source code
git clone git://git.proxmox.com/git/pve-kernel-3.10.0.git
# switch to kernel ABI level
uname -srm
Linux 3.10.0-8-pve x86_64
git checkout -b 8-pve 5623bd4590a1dfbb0a0c05afd20a7568e639773e
# compile kernel
make data
# install necessary symlinks
sudo ln -s $PWD/linux-2.6-3.10.0/ /lib/modules/$(uname -r)/build
@EmmanuelKasper
EmmanuelKasper / ste_convert.sh
Last active Aug 29, 2015
Convert files for atari STE background playing: see http://atari.8bitchip.info/STEbap.html
View ste_convert.sh
#/bin/sh
# if no parameter is passed, consider we want to convert mp3 files
test -n "$1" && EXT=$1 || EXT=mp3
#remvove spaces and funky characters in file names
detox *.${EXT}
#shorten file names to follow FAT 8.3 convention
rename -v "s/(\S{8}).*/\$1.${EXT}/g" *.${EXT}
View ExtJSTips
# show or hide a component by id ( this is an HTML div id)
# <div id="north-region-container" ....
#pkmk
Ext.getCmp('north-region-container').getEl().show();
#pve
Ext.getCmp('content').getEl().show();
# Get store content of a component ( here with id 'mybuilder'
Ext.getCmp('myBuilder').store.data.items
View elasticsearch-river-mongodb.pp
class elasticsearch-river-mongodb ($version = '1.6.8') {
exec {'elasticsearch-mapper-attachment':
require => Package['elasticsearch'],
command => '/usr/share/elasticsearch/bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.7.0',
creates => '/usr/share/elasticsearch/plugins/mapper-attachments/elasticsearch-mapper-attachments-1.7.0.jar',
}
exec {'elasticsearch-river-mongodb':
require => Exec['elasticsearch-mapper-attachment'],
@EmmanuelKasper
EmmanuelKasper / qemu-autostable-serial
Created Jul 3, 2013
Automatic Debian7 installation on qemu, using libvirt, the debian installer and a preseed file, inside a terminal (ie you can start it on a remote server)
View qemu-autostable-serial
#!/bin/sh
export OS=Debian7
virt-install \
--connect qemu:///system \
--name ${OS} \
--ram 512 \
--vcpus 1 \
--file ${OS}.img \
@EmmanuelKasper
EmmanuelKasper / ansibleForVagrantboxes
Last active Dec 25, 2015
If you've just downloaded one of the vagrant base boxes from http://www.vagrantbox.es/, this gist shows you how to tame them with ansible
View ansibleForVagrantboxes
# create a temporary inventory file
echo "vagrant ansible_ssh_host=localhost ansible_ssh_user=vagrant ansible_ssh_port=2222" > hosts
# run a root shell in the vagrant env
ansible \
--inventory hosts \
--private-key=/opt/vagrant/embedded/gems/gems/vagrant-1.2.7/keys/vagrant \
--sudo \
--args "id" vagrant