Skip to content

Instantly share code, notes, and snippets.

@felipec
felipec / fb_test.c
Created September 8, 2008 20:25
framebuffer test
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdint.h>
static struct fb_var_screeninfo sinfo;
static struct fb_fix_screeninfo fix_info;
@felipec
felipec / make_rootfs
Created September 17, 2008 23:26
rootfs helper
#!/bin/bash
## contents of ubinize.cfg
# [ubifs]
# mode=ubi
# image=/tmp/ubifs.img
# vol_id=0
# vol_size=128MiB
# vol_type=dynamic
# vol_name=rootfs
@felipec
felipec / task.c
Created September 28, 2008 20:01
continuation task test
#ifndef TRANS_H
#define TRANS_H
#include <ucontext.h>
#include <stdbool.h>
#include <stdio.h>
struct task
{
#!/bin/sh
download_dir=/tmp/sb
sb_base_url=http://scratchbox.org/download/files/sbox-releases/apophis/tarball
sb=/opt/scratchbox
target=armv7
sb_base_dir=$(dirname $sb)
mkdir -p $download_dir
sb="/opt/scratchbox"
user="$USER"
sb_home="$sb/users/$user/home/$user"
sb_url="http://www.scratchbox.org/download/files/sbox-releases/apophis/tarball"
sb_base_dir=$(dirname $sb)
function setup_target()
{
#!/bin/sh
RS=20
get_capacity()
{
c=`i2cget -y 2 0x55 0x0c w`
return $(($c * 3570 / $RS / 1000))
}
#!/usr/bin/env ruby
$TEST_PERIOD = 60 * 61
$SAMPLE_PERIOD = 60 * 10
$CAPACITY = 1320
$RS = 20
class Array
def mean
self.inject(0) { |sum, x| sum + x } / size.to_f
@felipec
felipec / gnome-survey.txt
Created August 5, 2011 18:23
GNOME user survey
GNOME user survey 2012
Welcome to the second GNOME user survey. This survey is not blessed by the GNOME team, it's built by users (and some developers as well).
This survey is anonymous, but all information that the users provide (raw data) will be publicly available to allow for independent analysis.
Note that you may skip questions as you like, but it should only take a few minutes to fill it completely.
In order to increase the validity of this survey, please ask people that normally wouldn't answer this survey to do so, also, if you know of somebody that doesn't have access, print it or make them available for them, and fill it online on their behalf. Also, if you know of somebody that couldn't possibly have access to this survey, please let us know, it's extremely important to know what kind of people can't be reached.
@felipec
felipec / build.rb
Created November 11, 2011 03:10
git rebase challenge build helper
#!/usr/bin/env ruby
@authors = {
"david" => "David S. Miller",
"ingo" => "Ingo Molnar",
"takashi" => "Takashi Iwai",
"alexander" => "Al Viro",
"russel" => "Russell King",
"paul" => "Paul Mundt",
"tejun" => "Tejun Heo",
@felipec
felipec / branch-point
Created May 30, 2012 16:54
Code to find the first point a git branch started to diverge
#!/bin/bash
# actual code
find_merge ()
{
local selection extra
test "$2" && extra=" into $2"
git rev-list --min-parents=2 --grep="Merge branch '$1'$extra" --topo-order ${3:---all} | tail -1
}