Skip to content

Instantly share code, notes, and snippets.

View rfjakob's full-sized avatar

rfjakob

  • Vienna, Austria
View GitHub Profile
@rfjakob
rfjakob / Night Owl Browsing.css
Last active August 29, 2015 14:05
Night Owl Browsing
/* Night Owl Browsing Userscript by Mishihime */
/* https://userstyles.org/styles/94925/night-owl-browsing-dark-global */
/* selection and moz-selection control highlighted text colors works in chrome firefox safari not ie */
::selection {
color:#F0F0F0 !important ;
background:#000 !important ;
}
::-moz-selection {
@rfjakob
rfjakob / fsync-mtime.c
Last active August 29, 2015 14:14
Test if the mtime changes after fsync() has been called
/* Test if the mtime changes after fsync() has been called
*
* Bug originally reported at
* http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19607
*
* Compile with:
* gcc fsync-mtime.c -o fsync-mtime
*/
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
int
main (void)
{
char const *filename = "test.txt";
int fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666);
[19291.202062] sysrq: SysRq : Manual OOM execution
[19291.208335] Purging GPU memory, 74399744 bytes freed, 8728576 bytes still pinned.
[19291.390767] sysrq: SysRq : Manual OOM execution
[19291.396792] Purging GPU memory, 74452992 bytes freed, 8728576 bytes still pinned.
[19291.560349] sysrq: SysRq : Manual OOM execution
[19291.566018] Purging GPU memory, 75489280 bytes freed, 8728576 bytes still pinned.
[19291.729944] sysrq: SysRq : Manual OOM execution
[19291.735686] Purging GPU memory, 74399744 bytes freed, 8728576 bytes still pinned.
[19291.918637] sysrq: SysRq : Manual OOM execution
[19291.924299] Purging GPU memory, 74403840 bytes freed, 8728576 bytes still pinned.
// 500 is fastest, 1000 slower, ...
#define ROT_SPEED 2000
#define PAUSE 2000
#define DIR_PIN 2
#define STEP_PIN 3
// necessary for driver standby
Mounted!
2015/09/24 21:36:32 underflow: handle 170, count 6, object -1
panic: underflow: handle 170, count 6, object -1
goroutine 1 [running]:
log.Panicf(0x5ac270, 0x29, 0xc2080c5c00, 0x3, 0x3)
/usr/lib/golang/src/log/log.go:314 +0xd0
github.com/hanwen/go-fuse/fuse/nodefs.(*portableHandleMap).Forget(0xc20806e060, 0xaa, 0x6, 0x0, 0xc208076a10)
/home/jakob/src/github.com/hanwen/go-fuse/fuse/nodefs/handle.go:118 +0x23e
github.com/hanwen/go-fuse/fuse/nodefs.(*FileSystemConnector).forgetUpdate(0xc20800a600, 0xaa, 0x6)
package main
import (
"fmt"
"syscall"
"time"
)
func main() {
t := time.Date(1960, time.January, 10, 23, 0, 0, 0, time.UTC)
kernel.org/torvalds-linux$ ls -1s
total 47560
4 arch
4 block
20 COPYING
96 CREDITS
20 crypto
12 Documentation
4 drivers
4 firmware
~/src/github.com/rfjakob/gocryptfs$ ./benchmark.bash
+ go build
+ go test -bench=.
Openssl disabled
Zerokey mode active: using all-zero dummy master key.
ZEROKEY MODE PROVIDES NO SECURITY AT ALL AND SHOULD ONLY BE USED FOR TESTING.
Filesystem ready.
PASS
BenchmarkStreamWrite 30 38580651 ns/op 27.18 MB/s