Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
EmmanuelKasper / convert.sh
Last active Jan 13, 2019
Convert images for Atari ST resolution
View convert.sh
# 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
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
@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}
@EmmanuelKasper
EmmanuelKasper / gist:f24cc7088b206ea0ec87
Last active Apr 28, 2021
Proxmox Text Terminal Howto
View gist:f24cc7088b206ea0ec87

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 / 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
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: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 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
#
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
@EmmanuelKasper
EmmanuelKasper / EFI boot on Lenovo Thinkcenter M92Z
Last active Jan 16, 2021
EFI boot on Lenovo Thinkcenter M92Z
View EFI boot on Lenovo Thinkcenter M92Z
# disable secure boot in the bios, in menu security
# downlad and unzip refind-bin-0.7.8.zip
# install refind, assuming your ESP partition is /dev/sda1 and mounted in /boot/efi
cd refind-bin-0.7.8
./install.sh
# type y and go ahead
# at that time your boot entry should look like that