Skip to content

Instantly share code, notes, and snippets.

View EmmanuelKasper's full-sized avatar

Emmanuel Kasper EmmanuelKasper

  • Vienna, Austria
View GitHub Profile
#!/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 August 29, 2015 14:13
Vmdeboostrap for Freedombox
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
@EmmanuelKasper
EmmanuelKasper / cinephilia.sql
Created January 28, 2015 13:43
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 August 29, 2015 14:19
VirtualBox DKMS with Promox kernel
# 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 / gist:f24cc7088b206ea0ec87
Last active January 4, 2024 10:40
Proxmox Text Terminal Howto

Map a virtual serial port on the guest(ttyS0) to a pseudo terminal(pty) on the host This has to be added to /etc/pve/qemu-server/VMID.conf:

args: -device isa-serial,chardev=myChardevice,id=s -chardev pty,id=myChardevice

After starting the VM check you will see a message:

char device redirected to /dev/pts/7 (label myChardevice)

Inside the guest, you should see now the serial port:

@EmmanuelKasper
EmmanuelKasper / ste_convert.sh
Last active August 29, 2015 14:22
Convert files for atari STE background playing: see http://atari.8bitchip.info/STEbap.html
#/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}
@EmmanuelKasper
EmmanuelKasper / ExtJSTips
Last active November 11, 2015 09:14
ExtJS tips
# 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
@EmmanuelKasper
EmmanuelKasper / convert.sh
Last active January 13, 2019 21:11
Convert images for Atari ST resolution
# with dithering
convert input.jpg -resize 640x400\! -colorspace gray -colors 2 -normalize output.gif
# without dithering, strong separation
convert input.jpg -resize 640x400\! -colorspace gray +dither -colors 2 -normalize output.gif
# see http://www.multipole.org/discourse-server/viewtopic.php?t=34042 for background
# convert to low resultion for atari ST 16 colors / 4096 palette
convert rio_hill.jpg -colors 16 -depth 4 -resize 320x200\! rio.gif
@EmmanuelKasper
EmmanuelKasper / create_gif.sh
Created July 10, 2015 08:56
Create gif file with avconf
#export frames
avconv -i hatari.avi -vf fps=10 frames/ffout%03d.png
#assemble frames a gif
convert -loop 0 frames/ffout0*.png new.gif

commands

#client 
iperf -c pf -i 1 -t 60
#server
iperf -s

server side result vr2: VIA VT6105M Rhine III 10/100BaseTX