Skip to content

Instantly share code, notes, and snippets.

Peter Senna Tschudin petersenna

View GitHub Profile
petersenna / IDENTICAL_BRANCHES.patch
Last active Nov 22, 2017
IDENTICAL_BRANCHES linux-next 20170802
diff -u -p a/drivers/media/platform/arv.c b/drivers/media/platform/arv.c
--- a/drivers/media/platform/arv.c
+++ b/drivers/media/platform/arv.c
@@ -218,10 +218,7 @@ static void init_iic(void)
/* 50MH-100k */
if (freq == 75)
ar_outl(369, PLDI2CFREQ); /* BCLK = 75MHz */
- else if (freq == 50)
- ar_outl(244, PLDI2CFREQ); /* BCLK = 50MHz */
- else

Keybase proof

I hereby claim:

  • I am petersenna on github.
  • I am petersenna ( on keybase.
  • I have a public key whose fingerprint is CE5A 4743 24BF 87DC 5798 A5F4 52A6 6F38 4827 4C36

To claim this, I am signing this object:

petersenna / config
Last active Aug 29, 2015
git config file for Linux kernel
View config
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url =
fetch = +refs/heads/*:refs/remotes/origin/*
petersenna / backup_history.bash
Last active Oct 3, 2019
Add this to your .bashrc to create a backup of your bash history every time you open a new terminal, but not more than one time per hour(find -mmin +60). This will backup your bash history if it has more lines than the backup file.
View backup_history.bash
export HISTSIZE=""
if [ ! -f $BACK_FILE ];then touch -d "2 hours ago" $BACK_FILE;fi
if test $(find $BACK_FILE -mmin +60); then
HIST_SIZE=$(cat $HIST_FILE|wc -l)
BACK_SIZE=$(cat $BACK_FILE|wc -l)
# git diff
$ git diff --stat|awk '{ print $3 " "$4 " " $1}'| sort -n -r|less
# diffstat
$ diffstat /tmp/my.patch|awk '{ print $3 " "$4 " " $1}'|sort -n -r|less
petersenna / LinesAgeBeforeCommit
Last active Aug 29, 2015
Getting the age of the (last) lines your commits are touching
View LinesAgeBeforeCommit
What is the age of the lines my patches are touching?
Apply all your patches in a local branch of linux-next, but be aware that some commands
are executed on remotes/linux-next/master while other on the branch with the changes.
1 - Get git diff. -U0 is very important here
#### On the branch with the changes ####
$ git diff -U0 remotes/linux-next/master > /tmp/1.patch
2 - Get rid of useless lines
petersenna / gist:8044089
Last active Dec 31, 2015
Reading Group 2014 Agenda
View gist:8044089
16/01 P.S. Tschudin
Asynchronous Intrusion Recovery for Interconnected Web Services
petersenna /
Last active Dec 21, 2015 Return source code files associated to a Kconfig symbol. The file linux3.10-Kconfig-ethernet-drivers contains Kconfig symbols for drivers found at drivers/net/ethernet. Each line contains symbols related to one driver.
# Receives a Kconfig value and returns files associated to that value
# Peter Senna Tschudin <>
use File::Basename;
use File::Find::Rule;
use File::Slurp;
use Cwd;
use Cwd qw(realpath);
use strict;
View test.cocci
statement S;
View m.c
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/proc_fs.h>
#include "m.h"
#define OPTIMAL_COPY_SIZE (32 * 1024)
int init_module(void);
You can’t perform that action at this time.