Skip to content

Instantly share code, notes, and snippets.

Peter Senna Tschudin petersenna

Block or report user

Report or block petersenna

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@petersenna
petersenna / IDENTICAL_BRANCHES.patch
Last active Nov 22, 2017
IDENTICAL_BRANCHES linux-next 20170802
View IDENTICAL_BRANCHES.patch
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
View keybase.md

Keybase proof

I hereby claim:

  • I am petersenna on github.
  • I am petersenna (https://keybase.io/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
petersenna / config
Last active Aug 29, 2015
git config file for Linux kernel
View config
#.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
fetch = +refs/heads/*:refs/remotes/origin/*
@petersenna
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=""
HIST_FILE=~/.bash_history
BACK_FILE=~/.bash_history_backup
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)
GROWTH=$(($HIST_SIZE - $BACK_SIZE))
View git-diff-stat-sort.sh
# 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
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
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
http://dl.acm.org/ft_gateway.cfm?id=2522725&ftid=1403944&dwn=1
23/01
30/01
06/02
@petersenna
petersenna / Kconfig-files.pl
Last active Dec 21, 2015
Kconfig-files.pl: 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.
View Kconfig-files.pl
#!/bin/perl
# Receives a Kconfig value and returns files associated to that value
# Peter Senna Tschudin <peter.senna@lip6.fr>
#
use File::Basename;
use File::Find::Rule;
use File::Slurp;
use Cwd;
use Cwd qw(realpath);
use strict;
View test.cocci
@@
statement S;
@@
-S;
+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.