Skip to content

Instantly share code, notes, and snippets.

View zielmicha's full-sized avatar

Michał Zieliński zielmicha

View GitHub Profile
openssl req -new -newkey rsa:3072 -days 36500 -sha256 -nodes -x509 -keyout server.key -out server.crt
aGNU gdb (Ubuntu 7.11-0ubuntu1) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
import random, time
f = open('/dev/sda', 'rb')
L = 1000 ** 4 * 2
bs = 4096
while bs <= 1024 * 1024 * 128:
count = 0
start = time.time()

Keybase proof

I hereby claim:

  • I am zielmicha on github.
  • I am zielmicha (https://keybase.io/zielmicha) on keybase.
  • I have a public key whose fingerprint is A14E C3B0 4C56 EB0C F9BB E8E2 F210 4910 7865 BD23

To claim this, I am signing this object:

@zielmicha
zielmicha / compareconfig.py
Created September 15, 2015 16:54
Compares two config generated by Kconfig (for Linux kernel or buildbot, for example)
from __future__ import print_function
import sys
def load(s):
d = {}
for line in open(s):
line = line.strip()
if line.startswith('# ') and line.endswith(' is not set'):
key = line.split()[1]
d[key] = False
@zielmicha
zielmicha / a.c
Created July 9, 2015 22:40
Bad code generated for a.nim
/* Generated by Nim Compiler v0.11.3 */
/* (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
gcc -c -w -I/home/michal/apps/nim/lib -o /home/michal/apps/bug/nimcache/a.o /home/michal/apps/bug/nimcache/a.c */
#define NIM_INTBITS 64
#include "nimbase.h"
typedef struct DbusfoobarHEX3Aobjecttype91012 DbusfoobarHEX3Aobjecttype91012;
@zielmicha
zielmicha / dbus_dbus.c
Created July 9, 2015 22:30
NimDT_122012_kind is an array of 28 elements, but see line 2329 for example
/* Generated by Nim Compiler v0.11.3 */
/* (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
gcc -c -w -g -I/home/michal/apps/nim/lib -I./dbus -o /home/michal/networkos/nim-dbus/dbus/private/tests/nimcache/dbus_dbus.o /home/michal/networkos/nim-dbus/dbus/private/tests/nimcache/dbus_dbus.c */
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
@zielmicha
zielmicha / cleangit.sh
Created May 13, 2015 17:19
Remove files not matching regular exception from repo history. Useful for splitting repos.
#!/bin/bash
set -e
FOUND="$(find -type f | grep -v '\.git/' | grep -v dart || true)"
if [ "$FOUND" != "" ]; then
git rm -f --ignore-unmatch $FOUND
fi
# clean submodules
find -type d -exec 'git' 'rm' '{}' ';' 2>/dev/null || true
@zielmicha
zielmicha / tightlypacked.hh
Created March 16, 2015 23:44
Store array integers using smallest possible amount of memory. Uses a lot C++ template metaprogramming.
#include <array>
#include <tuple>
typedef unsigned int _uint;
template <_uint _shift, _uint _size>
struct _FieldDescription {
static const _uint shift = _shift;
static const _uint size = _size;
};
import pygame
import argparse
import time
parser = argparse.ArgumentParser(description='Display raw image (typically a framebuffer).')
parser.add_argument('file')
parser.add_argument('width', type=int)
parser.add_argument('height', type=int)
parser.add_argument('--format', default='RGBX')