Skip to content

Instantly share code, notes, and snippets.

View hnsl's full-sized avatar
🤠

Hannes Landeholm hnsl

🤠
View GitHub Profile
@hnsl
hnsl / gist:7658652
Created November 26, 2013 13:57
oops in rbd
[31229341.550990] ------------[ cut here ]------------
[31229341.551005] Kernel BUG at ffffffffa01367bb [verbose debug info unavailable]
[31229341.551013] invalid opcode: 0000 [#1] SMP
[31229341.551021] Modules linked in: xt_state iptable_filter iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack xt_tcpudp iptable_mangle ip_tables x_tables coretemp microcode rbd libceph btrfs zlib_deflate libcrc32c ghash_clmulni_intel aesni_intel xts aes_x86_64 lrw gf128mul ablk_helper cryptd
[31229341.551067] CPU 0
[31229341.551073] Pid: 1301, comm: mount Not tainted 3.8.13.8+ #5
[31229341.551080] RIP: e030:[<ffffffffa01367bb>] [<ffffffffa01367bb>] ceph_osdc_build_request+0x4ab/0x4b0 [libceph]
[31229341.551100] RSP: e02b:ffff8800086938e8 EFLAGS: 00010212
[31229341.551105] RAX: ffff88005fa79700 RBX: 0000000000000001 RCX: ffff88005fa79821
[31229341.551111] RDX: ffff88005fa797ef RSI: ffff880066901ae0 RDI: 000000000000000e
@hnsl
hnsl / gist:7923594
Created December 12, 2013 05:28
llvm/clang 3.3 -O1 crash when compiling librcd
clang-3.3: /home/thorwald/llvm/include/llvm/ADT/APInt.h:1196: uint64_t llvm::APInt::getZExtValue() const: Assertion `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
0 clang-3.3 0x0000000001b2e97d llvm::sys::PrintStackTrace(_IO_FILE*) + 38
1 clang-3.3 0x0000000001b2ebfa
2 clang-3.3 0x0000000001b2e673
3 libpthread.so.0 0x00007f9f12a6b870
4 libc.so.6 0x00007f9f11cb33d9 gsignal + 57
5 libc.so.6 0x00007f9f11cb47d8 abort + 328
6 libc.so.6 0x00007f9f11cac506
7 libc.so.6 0x00007f9f11cac5b2
8 clang-3.3 0x0000000000c67b60
@hnsl
hnsl / gist:afd2caa13f5051c26eb0
Last active August 29, 2015 14:07
validate_number with librcd re2c
static _Bool validate_number(fstr_t str) {
do {
uint8_t cur_rune;
re2c_state_000001:
goto re2c_state_000002;
re2c_state_000002:
if (str.len == 0) {
break;
}
cur_rune = *str.str;
*** Terminal A: ***
$> ./build/debug
*** Terminal B: ***
$> nc 127.0.0.1 2134
enter numbers to sum, separate with new line, end with empty line:
1
@hnsl
hnsl / README.md
Last active August 29, 2015 14:11 — forked from nickbudi/README.md

Budi's CS:GO Config

This is my constantly updated CS:GO autoexec config.

Put the files autoexec.cfg and video.txt in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

Launch Options

-novid -noborder -high -threads 4 -freq 144 -refresh 144 -tickrate 128 -nojoy -nod3d9ex -noaafonts +exec autoexec.cfg +mat_vignette_enable 0 -processheap
@hnsl
hnsl / org-netbeans-modules-editor-settings-CustomKeybindings.xml
Created January 21, 2015 10:38
Editors/Keybindings/NetBeans/org-netbeans-modules-editor-settings-CustomKeybindings.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bindings PUBLIC "-//NetBeans//DTD Editor KeyBindings settings 1.1//EN" "http://www.netbeans.org/dtds/EditorKeyBindings-1_1.dtd">
<bindings>
<bind actionName="caret-next-word" key="D-RIGHT"/>
<bind actionName="caret-previous-word" key="D-LEFT"/>
<bind actionName="completion-show" key="D-L"/>
<bind actionName="find-next" key="F3"/>
<bind actionName="goto" key="D-G"/>
<bind actionName="goto-declaration" key="SO-G"/>
<bind actionName="jump-list-next" key="A-RIGHT"/>
@hnsl
hnsl / gist:f30774c0089132f76752
Created February 12, 2015 14:12
rdb crash 120215
[772336.044392] BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
[772336.046559] IP: [<ffffffffa0243d2b>] rbd_dev_refresh+0xcb/0x140 [rbd]
[772336.047611] PGD bb985067 PUD bb986067 PMD 0
[772336.047611] Oops: 0002 [#1] PREEMPT SMP
[772336.047611] Modules linked in: veth ipt_MASQUERADE nf_nat_masquerade_ipv4 cbc ipt_REJECT nf_reject_ipv4 xt_conntrack iptable_filter iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack xt_tcpudp iptable_mangle ip_tables x_tables cfg80211 rfkill joydev mousedev crct10dif_pclmul ppdev crc32_pclmul ghash_clmulni_intel parport_pc aesni_intel cirrus aes_x86_64 ttm lrw gf128mul evdev drm_kms_helper glue_helper mac_hid ablk_helper drm cryptd parport serio_raw pvpanic syscopyarea sysfillrect pcspkr processor psmouse intel_agp intel_gtt i2c_piix4 sysimgblt button i2c_core rbd libceph crc32c_generic crc32c_intel libcrc32c ext4 crc16 mbcache jbd2 hid_generic usbhid hid sd_mod ata_generic pata_acpi virtio_balloon virtio_scsi virtio_net atkb
@hnsl
hnsl / gist:b4664e2e7e37ad13177c
Last active August 29, 2015 14:15
rbd_dev_refresh dump
0000000000003c90 <rbd_dev_refresh>:
3c90: e8 00 00 00 00 callq 3c95 <rbd_dev_refresh+0x5>
3c91: R_X86_64_PC32 __fentry__-0x4
3c95: 55 push %rbp
3c96: 48 89 e5 mov %rsp,%rbp
3c99: 41 55 push %r13
3c9b: 41 54 push %r12
3c9d: 4c 8d a7 30 01 00 00 lea 0x130(%rdi),%r12
3ca4: 53 push %rbx
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
@hnsl
hnsl / gist:b078f0b7e4d99872ec90
Created April 8, 2015 15:34
librcd normal distribution
static double gaussian_noise(double mu, double sigma) {
double u1;
do {
u1 = ((double) lwt_rdrand64()) * (1.0 / (double) UINT64_MAX);
} while (u1 <= (DBL_EPSILON));
double u2 = ((double) lwt_rdrand64()) * (1.0 / (double) UINT64_MAX);
double z0 = sqrt(-2.0 * log(u1)) * cos((2.0 * M_PI) * u2);
return z0 * sigma + mu;
}