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 | |
# tested on Max OS X 10.13.2 "High Sierra" | |
# install qemu using: `brew install qemu` | |
# get kernel from: https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.4.34-jessie?raw=true | |
# get raspbian image from: http://downloads.raspberrypi.org/raspbian_latest | |
qemu-system-arm \ | |
-kernel kernel-qemu-4.4.34-jessie \ | |
-cpu arm1176 \ |
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
mkfs.vfat -n BOOT /dev/sda1 | |
mkfs.btrfs -L root /dev/sda2 | |
mount -t btrfs /dev/sda2 /mnt/ | |
btrfs subvolume create /mnt/nixos | |
umount /mnt/ | |
mount -t btrfs -o subvol=nixos /dev/sda2 /mnt/ | |
btrfs subvolume create /mnt/var | |
btrfs subvolume create /mnt/home | |
btrfs subvolume create /mnt/tmp |
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 python | |
# -*- coding: UTF-8 -*- | |
# Author : [email protected] <github.com/tintinweb> | |
''' | |
A simple TCP three-way handshake example | |
#> python scapy_tcp_handshake.py | |
DEBUG:__main__:init: ('oststrom.com', 80) | |
DEBUG:__main__:start | |
DEBUG:__main__:SND: SYN |
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 | |
# | |
# Find all processes that are executing a futex(2) call with op=FUTEX_WAIT | |
# In some cases this can be helpful in finding deadlock-ed processes. | |
# | |
test ! $UID -eq 0 && echo -e "WARNING: Not running as root, only processes for this user are being scanned\n" >&2; | |
pids=$(ps -u $UID -opid --no-headers) | |
sub_pid=$(($$+1)) |
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
//A0 = green, A1 = yellow, A2 = orange, A3 = red | |
#define downPin 14 | |
#define upPin 15 | |
#define rightPin 16 | |
#define leftPin 17 | |
void setup() { | |
Serial.begin(9600); | |
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
//! Chain macro in Rust | |
//! | |
//! A typical usage is to avoid nested match expressions. | |
//! | |
//! Supports: | |
//! - Pattern matching | |
//! - Or expressions (A | B => ...) | |
//! - Guarded statements (x if <cond> => ...) | |
//! - Implicit else (requires all arms to return same type) |
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
# udev | |
wget https://gist.githubusercontent.com/dex4er/1354710/raw/0f9738c7439cdfb9e4446663d137f91ee153b4d8/etc_udev_rules.d_90-hid-eToken.rules | |
sudo cp etc_udev_rules.d_90-hid-eToken.rules /etc/udev/rules.d | |
sudo service udev reload | |
# required packages | |
sudo apt-get -yy install pcscd opensc | |
# legacy library | |
wget http://mirrors.kernel.org/ubuntu/pool/universe/h/hal/libhal1_0.5.14-8_amd64.deb |
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 | |
# | |
# Find all processes that are executing a futex(2) call with op=FUTEX_WAIT | |
# In some cases this can be helpful in finding deadlock-ed processes. | |
# | |
test ! $UID -eq 0 && echo -e "WARNING: Not running as root, only processes for this user are being scanned\n" >&2; | |
pids=$(ps -u $UID -opid --no-headers) | |
for pid in $pids; do |