Skip to content

Instantly share code, notes, and snippets.

View kaspter's full-sized avatar
:octocat:
宜早退,忌加班

Kaspter Ju kaspter

:octocat:
宜早退,忌加班
View GitHub Profile
@kaspter
kaspter / strace-4.6-v4l2-ioctls.patch
Created October 12, 2012 14:19 — forked from whitequark/strace-4.6-v4l2-ioctls.patch
V4L2 ioctl support for strace
diff -urN strace-4.6.old/defs.h strace-4.6.new/defs.h
--- strace-4.6.old/defs.h 2011-03-15 20:19:09.000000000 +0300
+++ strace-4.6.new/defs.h 2011-10-05 01:06:42.000000000 +0400
@@ -594,6 +594,7 @@
extern int rtc_ioctl(struct tcb *, long, long);
extern int scsi_ioctl(struct tcb *, long, long);
extern int block_ioctl(struct tcb *, long, long);
+extern int v4l2_ioctl(struct tcb *, long, long);
#endif
@kaspter
kaspter / gist:2595598
Created May 4, 2012 15:40 — forked from mjdominus/gist:1560515
git name-rev --name-only doesn't get the name of the current branch
$ git branch
master
* snonk
$ git rev-parse master snonk
1333053e19b35008e74476b1549ecfed709c3d44
1333053e19b35008e74476b1549ecfed709c3d44
$ git name-rev --name-only HEAD
master
$ git rev-parse --symbolic-full-name --abbrev-ref HEAD
snonk
@kaspter
kaspter / .git_ps1
Created May 4, 2012 15:18 — forked from lotsofcode/.git_ps1
Git ps1
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@kaspter
kaspter / trivial_rebase.py
Created March 20, 2012 01:15 — forked from jtolio/trivial_rebase.py
trivial_rebase.py script for gerrit 2.2.2.1
#!/usr/bin/env python2.6
# Copyright (c) 2010, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# # Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# # Redistributions in binary form must reproduce the above
@kaspter
kaspter / android-pm.patch
Created March 12, 2012 13:19 — forked from syndtr/android-pm.patch
Android PM driver. It is utilize linux wakeup_source and also provide early suspend like implementation.
diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 05f1105..b18990a 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -81,6 +81,13 @@ config ANDROID_INTF_ALARM_DEV
elapsed realtime, and a non-wakeup alarm on the monotonic clock.
Also exports the alarm interface to user-space.
+config ANDROID_PM
+ bool "Android PM support"
@kaspter
kaspter / add_empty_dirs.sh
Created March 11, 2012 15:37 — forked from cdwilson/add_empty_dirs.sh
Add .gitignore to empty directories
#!/bin/sh
# Recursively add a .gitignore file to all directories
# in the working directory which are empty and don't
# start with a dot. Helpful for tracking empty dirs
# in a git repository.
for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done;