Skip to content

Instantly share code, notes, and snippets.

@mokomull
mokomull / config
Created January 17, 2016 23:20
x86_64 config for Intel Edison
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 3.10.80 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
@mokomull
mokomull / blink.c
Last active August 29, 2015 14:03 — forked from anonymous/blink.c
@mokomull
mokomull / gist:5807128
Created June 18, 2013 16:50
The kernel does it!
// fs/open.c
static int chown_common(struct path *path, uid_t user, gid_t group)
{
struct inode *inode = path->dentry->d_inode;
[...]
if (!S_ISDIR(inode->i_mode))
newattrs.ia_valid |=
ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
[...]
}
In [1]: x = array([2,3,4])
In [2]: x.__abs__
Out[2]: <method-wrapper '__abs__' of numpy.ndarray object at 0x30a9780>
#include <string>
struct Base {
enum Type {
BASE,
CHILD,
};
int i;
virtual std::string getType() = 0;
0000000000000000 <dynamic_foo(Base*)>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 48 83 ec 20 sub $0x20,%rsp
8: 48 89 7d e8 mov %rdi,-0x18(%rbp)
c: 48 8b 45 e8 mov -0x18(%rbp),%rax
10: 48 85 c0 test %rax,%rax
13: 75 07 jne 1c <dynamic_foo(Base*)+0x1c>
15: b8 00 00 00 00 mov $0x0,%eax
1a: eb 17 jmp 33 <dynamic_foo(Base*)+0x33>
@mokomull
mokomull / gist:4583817
Created January 21, 2013 05:27
dhcp checksum offload workaround
diff --git a/modules/vpssd/templates/compute_firewall.erb b/modules/vpssd/templates/compute_firewall.erb
index 5b69f24..89a7f80 100644
--- a/modules/vpssd/templates/compute_firewall.erb
+++ b/modules/vpssd/templates/compute_firewall.erb
@@ -6,20 +6,27 @@
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Sat Oct 6 19:51:27 2012
# Generated by iptables-save v1.4.12 on Sat Oct 6 19:51:27 2012
*mangle
commit 2e6a911eec989562a76a70939499cecae08d1451
Author: Matt Mullins <mmullins@mmlx.us>
Date: Sat Dec 29 21:03:45 2012 -0800
Create a new tab for game-specific chat.
commit fb85d7ed318af04a8aa64e4d2f503e276c0abe40
Author: Matt Mullins <mmullins@mmlx.us>
Date: Sat Dec 29 14:21:37 2012 -0800
@mokomull
mokomull / gist:4243564
Created December 9, 2012 06:13
Making sense of ARM ISR prologue/epilogue
00000004 <baz>:
4: 4668 mov r0, sp
6: f44f 4384 mov.w r3, #16896 ; 0x4200
a: f020 0107 bic.w r1, r0, #7
e: f2c4 0300 movt r3, #16384 ; 0x4000
12: 468d mov sp, r1
14: 2280 movs r2, #128 ; 0x80
16: b401 push {r0}
18: 601a str r2, [r3, #0]
1a: bc01 pop {r0}
matt@longview 23947 ~ % dig com. NS
; <<>> DiG 9.8.1-P1 <<>> com. NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55605
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;com. IN NS