This file contains 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
/* | |
* gcc -c -fzero-initialized-in-bss -o test_memory.o test_memory.c | |
*/ | |
int common_test[8]; | |
int bss_test[8] = {0}; | |
int data_test[8] = {-1, -2, -3, -4, -5, -6, -7, -8}; | |
const char rodata_test[8] = "Sample!"; | |
int main(void) { |
This file contains 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 | |
if [ -n "$SSH_CONNECTION" ] && [ "$2" = "down" ]; then | |
IFS=' ' read -ra conn_info <<< "$SSH_CONNECTION" | |
if ip address show "$1" | grep -q "${conn_info[2]}"; then | |
echo "Warning: Current SSH connection is bound on ${conn_info[2]} ($1)" >&2 | |
exit 1 | |
fi | |
fi | |
exec /sbin/ifconfig "$@" |
This file contains 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 python | |
from pwn import * | |
context(log_level='debug') | |
def has_common_prefix(a, b): | |
return a[:len(b)] == b[:len(a)] | |
def solve(prefix, postfix, words): | |
pre_flat = ''.join(prefix) | |
post_flat = ''.join(postfix) |
This file contains 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
import itertools | |
import claripy | |
import operator | |
top = 'T' # lambda a: True | |
ident = '=' # lambda a: a | |
inv = '!' # lambda a: not a | |
bot = '_' # lambda a: False |
This file contains 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
\CDP0: Get available devices as mask | |
bit0@retval: phy (\WLE0 || \WLE1) | |
bit1@retval: hci (\BTPR) | |
<WMAB 0x3c> | |
\CDP1: | |
<WMAB 0x3d> | |
\OWNE: Devices to do Airplane mode toggle, if AIRP == 0 or OSYS <= 0x7d0c and INTK == 1 (otherwise do the rfkill manually in the OS, via \WPC0 or whatever) | |
bit0@retval: phy |
This file contains 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
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | |
#include <linux/kernel.h> | |
#include <linux/module.h> | |
#include <linux/init.h> | |
#include <linux/types.h> | |
#include <linux/err.h> | |
#include <linux/platform_device.h> | |
#include <linux/slab.h> | |
#include <linux/input.h> |
This file contains 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
from django.db.models import Field | |
from django.conf import settings | |
from django.utils.decorators import cached_property | |
class VirtualField(object): | |
""" | |
A virtual field, mainly used for caching and seamless computed field retrieval. | |
This acts both like a (cached) property and a virtual field if supported. | |
""" |
This file contains 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 | |
set -e | |
path=/sys/kernel/debug/acpi/acpidbg | |
history -r ~/.acpidbg_history 2> /dev/null || true | |
if ! [ -r "$path" -a -w "$path" ] | |
then | |
echo >&2 "acpidbg: not enough privileges" | |
exit 1 | |
fi | |
cat "$path" & out_pid=$! |
This file contains 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 | |
PIDFILE=/tmp/.sp.pid | |
on_exit() { | |
code="$?" | |
echo "Killing $pid" | |
kill -TERM "$pid" | |
exit "$code" | |
} | |
[ -r "$PIDFILE" ] && pkill -TERM -F "$PIDFILE" 2> /dev/null || true | |
while pgrep -F "$PIDFILE" 2> /dev/null |
OlderNewer