This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import datetime | |
import bisect | |
import ephem | |
DAY = 1.0/29.33 | |
MOONPHASE = [ | |
(0.0/4.0 + DAY, '🌑', 'New moon'), | |
(1.0/4.0 - DAY, '🌒', 'Waxing crescent moon'), | |
(1.0/4.0 + DAY, '🌓', 'First quarter moon'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import json | |
class notreallydict(dict): | |
def __init__(self, x): | |
dict.__init__(self, x) | |
self.x = x | |
def items(self): | |
return self.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
int main() | |
{ | |
close(STDIN_FILENO); | |
int fd = open("/dev/null", O_RDWR); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
arm-linux-gnueabihf-gcc -ggdb -g3 gcabi.c -o gcabi -I /.../galcore_headers/include_imx8_v6.2.3.129602 | |
extract_structures_json.py gcabi _gcsHAL_INTERFACE _gcoCMDBUF _gcsQUEUE > data/gcs_hal_interface_GCABI.json | |
*/ | |
#include <gc_abi.h> | |
struct _gcsHAL_INTERFACE x; | |
struct _gcoCMDBUF y; | |
struct _gcsQUEUE z; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# enable command stream dumping, clear kernel ringbuffer, | |
# write output to a file provided on the command line | |
# this can be converted to .rd using dmesg2rd.py from | |
# https://github.com/laanwj/freedreno/blob/master/mlog/dmesg2rd.py | |
set -e | |
if [ "$(whoami)" != "root" ]; then | |
echo "This script needs to be executed as root" | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Vivante tiling experiments in NEON | |
W.J. van der Laan 2017, MIT license | |
*/ | |
/* gcc neontile.c -o neontile -O2 -mfpu=neon */ | |
#define _POSIX_C_SOURCE 200112L | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 [5/1819] | |
import sys | |
sys.path.append('./bitcoin/test/functional') | |
from test_framework.authproxy import AuthServiceProxy, JSONRPCException | |
import time | |
import os | |
datadir = os.path.join(os.getenv('HOME'), '.bitcoin') | |
with open(os.path.join(datadir,'.cookie'),'r') as f: | |
cookie = f.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
Script to do backports (pull ids listed in to_backport.txt or command line) in order of merge, | |
to minimize number of conflicts. | |
''' | |
import git | |
import re | |
import shlex | |
import subprocess | |
import os, sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# W.J. van der Laan 2017, distributed under MIT license | |
import binascii | |
import base64 | |
import json | |
import os, sys | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
KEY = binascii.a2b_hex(b'fffffbffeffffbfffbbfffbfdbfff7ffffffffffffffdfffff7fffffbfffffff') |