Skip to content

Instantly share code, notes, and snippets.

View petersenna's full-sized avatar
🚀

Peter Senna Tschudin petersenna

🚀
View GitHub Profile
This file has been truncated, but you can view the full file.
# 0 "../tests/intel/gem_exec_capture.c"
# 1 "/home/peter/dev/igt-gpu-tools/builddir//"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "/usr/include/stdc-predef.h" 3 4
/* Copyright (C) 1991-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@petersenna
petersenna / IDENTICAL_BRANCHES.patch
Last active November 22, 2017 13:21
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 (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 August 29, 2015 14:24
git config file for Linux kernel
#.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 October 3, 2019 15:47
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.
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))
# 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 August 29, 2015 14:01
Getting the age of the (last) lines your commits are touching
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 December 31, 2015 20:59
Reading Group 2014 Agenda
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 December 21, 2015 15:49
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.
#!/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;
@petersenna
petersenna / test.cocci
Created October 2, 2012 16:21
Test Gist
@@
statement S;
@@
-S;
+S