Skip to content

Instantly share code, notes, and snippets.

To reproduce this bug the file must be in an OverlayFS mount

Reproduced on:

  • linux-image-4.4.0-159-generic/xenial-updates,xenial-security,now 4.4.0-159.187 amd64
  • linux-image-4.4.0-165-generic/xenial-updates,xenial-security,now 4.4.0-165.193 amd64

Install packages libacl1-dev, build-essential, and gcc.

Included is a C program that reproduces the bug and two scripts. Run them in order.

  • make-overlay.sh: creates directories in /tmp and mounts /tmp/overlay as an overlay filesystem
#include "stdafx.h"
#include <iostream>
#include <string>
#include "tree.hh"
#include "tree_util.hh"
using namespace std;
int main()
{
@thomas-holmes
thomas-holmes / moving-triangles.glsl
Created April 12, 2019 15:36
Some shader fooling. Copied a bunch of it from tuts/samples
#define PI 3.14159265359
#define TWO_PI 6.28318530718
//POLYGON FUNCTION
float polygon(vec2 uv, vec2 pos, float size, float blur, int sides){
uv = uv-pos;
//Angle and radius of polygon
float angle = atan(uv.x,uv.y)+PI;
float rad = TWO_PI/float(sides);
float dist = cos(floor(0.5+angle/rad)*rad-angle)*length(uv);
C:\Users\Thomas\Documents>gcc foo.c
foo.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
main(t,_,a)
^~~~
foo.c: In function 'main':
foo.c:2:1: warning: type of 't' defaults to 'int' [-Wimplicit-int]
foo.c:2:1: warning: type of '_' defaults to 'int' [-Wimplicit-int]
C:\Users\Thomas\Documents>./a.exe
'.' is not recognized as an internal or external command,
@thomas-holmes
thomas-holmes / cloc-aggregate.txt
Last active March 8, 2018 19:11
example cloc output
keipra@k1 ~/g/s/g/t/delivery-rl (master)> cloc . --exclude-dir=vendor,.vscode
60 text files.
60 unique files.
4 files ignored.
github.com/AlDanial/cloc v 1.74 T=0.06 s (947.4 files/s, 98349.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Go 46 977 117 4505
@thomas-holmes
thomas-holmes / broken_lock_texture.go
Last active November 26, 2017 06:10
Example of go-sdl SDL_TextureLock bug
package main
import (
"github.com/veandco/go-sdl2/sdl"
)
func main() {
if err := sdl.Init(sdl.INIT_EVERYTHING); err != nil {
panic(err)
}
@thomas-holmes
thomas-holmes / Foo.java
Last active June 29, 2016 14:57
covariance fail
// Assume Cat and Dog are descendants of Animal. Yes I know this is a garbage example of inheritance
public class Foo {
public void failAppend(List<Cat> catList) {
Cat cat = new Cat();
Dog dog = new Dog();
Aniaml animal = new Cat();
catList.append(cat); // Obviously can do this
catList.append(dog); // Obviously can't do this

Keybase proof

I hereby claim:

  • I am thomas-holmes on github.
  • I am tholmes (https://keybase.io/tholmes) on keybase.
  • I have a public key whose fingerprint is 4A0B 8FC7 6284 533D E475 DC1C 2C86 C918 7682 84CC

To claim this, I am signing this object:

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@thomas-holmes
thomas-holmes / gist:6910192
Created October 9, 2013 23:15
AND combined selectors
I like the way control-p works except for how it treats spaces. I want control-p search style but where I can separate terms with spaces.
With control-p to find all views with vast in they name you would type something like 'viewcat'
I want to be able to type 'view cat'. I would like e results of that search string to be the intersected results of a control-p style search for each string separated by spaces. It would match 'views/cat' and 'cat/view'.
Mostly this is a habit driven request but sometimes I really do want to do a combined search like that.
Sorry if I botched the grammar a bit, the gist editor is pretty bad on mobile.