Skip to content

Instantly share code, notes, and snippets.

@bivald
bivald / utf16.js
Created May 24, 2012 08:33
UTF-16 to UTF-8 and vice versa
/* utf.js - UTF-8 <=> UTF-16 convertion
*
* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
* Version: 1.0
* LastModified: Dec 25 1999
* This library is free. You can redistribute it and/or modify it.
*/
/*
* Interfaces:
@bivald
bivald / echoserver.py
Created May 30, 2012 09:10
Eventlet echo server
#! /usr/bin/env python
"""
Copied from http://eventlet.net/doc/examples.html#echo-server
Simple server that listens on port 8014 and echos back every input to
the client. To try out the server, start it up by running this file.
"""
import eventlet
@bivald
bivald / xrf-brute-force.py
Created November 25, 2012 16:53
XRF Getting out of sleep mode - brute force
#!/usr/bin/python
# This is a crude brute-force tool to remove the cycling on a XRF module (http://shop.ciseco.co.uk/xrf-wireless-rf-radio-uart-rs232-serial-data-module-xbee-shape-arduino-pic-etc/)
# What it does is that every 20 ms it sends out a : WAKE + REMOVE INTLV + Reboot command
# This should be running when you power up your XRF (or when the XRF sends the battery reading, but on startup is easier)
#
# Start the script, start the XRF and it should reset straight away. Afterwards it will boot with the regular STARTED commands, without cycle.
# Everything else is the same (i.e device name etc.)
#
# 1. You need a XRF connected to your computer,
# Either a USB XRF receiver/sender(http://shop.ciseco.co.uk/urf-radio-module-and-serial-inteface-via-usb/)
@bivald
bivald / clean-raspberry.sh
Created December 1, 2012 15:19
Clean Raspberry Pi Debian
#!/bin/bash
sudo apt-get --yes purge xserver* x11-common x11-utils x11-xkb-utils x11-xserver-utils xarchiver xauth xkb-data console-setup xinit lightdm libx{composite,cb,cursor,damage,dmcp,ext,font,ft,i,inerama,kbfile,klavier,mu,pm,randr,render,res,t,xf86}* lxde* lx{input,menu-data,panel,polkit,randr,session,session-edit,shortcut,task,terminal} obconf openbox gtk* libgtk* alsa* nano python-pygame python-tk python3-tk scratch tsconf
sudo apt-get -y purge aspell hunspell-en-us iptraf libaspell15 libhunspell-1.2-0 lxde lxsession lxtask lxterminal squeak-vm whiptail zenity gdm gnome-themes-standard python-pygame
apt-get --yes purge xdg-tools desktop-file-utils omxplayer python3-numpy python3
sudo apt-get remove xserver-xorg
sudo apt-get purge ^lx
sudo apt-get --yes autoremove
sudo apt-get --yes autoclean
sudo apt-get --yes clean
@bivald
bivald / webfont-rendering-fix.css
Created December 19, 2012 11:00
Cross-browser fix for bad web font rendering. http://www.dropmocks.com/mBnnKJ (left is before, right is after)
/*
Safari and Chrome (os x) both handles webfonts badly when compared
with the Photoshop version of the same font. They are generally harder and rough.
Example:
http://www.dropmocks.com/mBnnKJ
Left: Web font in Safari, Right: Fixed web font
/*// =======================================================
The Retro Affect Animation Exporter
Created: January 6th, 2010
______________________________________________________________________________
Authors:
Peter Jones
David Carrigg
The function getFrame(IO) is by:
jugenjury from ps-scripts.com
@bivald
bivald / debian-networking-dom0-xen-wheezy.md
Last active September 17, 2021 13:12
Debian wheezy networking bridge, xen
@bivald
bivald / convertmovtomp4.sh
Created June 14, 2013 13:23
Convert mov to 720p mp4, chrome/iphone compatible
find ./ -iname "*Demo-Master.mov" -exec ./ffmpeg -i {} -c:v libx264 -preset slower -b:v 2500k -b:a 196k -vf scale=-1:720 -pix_fmt yuv420p {}.ffmpeg.mp4 ";" -ls
curl https://dl.dropboxusercontent.com/u/78509419/munin-html > /usr/share/munin/munin-html
*, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}