Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀
Programming something in Rust, probably

Matthew J. Berger matthewjberger

🦀
Programming something in Rust, probably
View GitHub Profile
View rr-with-rust.md

using rust with rr

rr is a great debugging tool. it records a trace of a program's execution, as well as the results of any syscalls it executes, so that you can "rewind" while you debug, and get deterministic forward and reverse instrumented playback. it works with rust, but by default if you try it out, it could be pretty ugly when you inspect variables. if this bothers you, configure gdb to use a rust pretty-printer

rr is probably in your system's package manager.

usage

@matthewjberger
matthewjberger / stm32_gpio_reg.md
Created Apr 25, 2019 — forked from iwalpola/stm32_gpio_reg.md
STM32 GPIO registers cheatsheet
View stm32_gpio_reg.md
@matthewjberger
matthewjberger / lib.rs
Created Feb 14, 2019
lib.rs containing debug utils integration
View lib.rs
#[macro_use]
extern crate log;
#[macro_use]
extern crate ash;
extern crate byteorder;
extern crate gfx_hal as hal;
#[macro_use]
extern crate lazy_static;
extern crate smallvec;
#[cfg(feature = "use-rtld-next")]
@matthewjberger
matthewjberger / latency.txt
Created Jun 6, 2018 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
View Virtual Box Host Only Static IP.md

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

View gist:df2b6d2c8c781b8ebbb1067711386d64
From: http://redteams.net/bookshelf/
Techie
Unauthorised Access: Physical Penetration Testing For IT Security Teams by Wil Allsopp.
Social Engineering: The Art of Human Hacking by Christopher Hadnagy
Practical Lock Picking: A Physical Penetration Tester's Training Guide by Deviant Ollam
The Art of Deception: Controlling the Human Element of Security by Kevin Mitnick
Hacking: The Art of Exploitation by Jon Erickson and Hacking Exposed by Stuart McClure and others.
Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning by Fyodor
The Shellcoder's Handbook: Discovering and Exploiting Security Holes by several authors
@matthewjberger
matthewjberger / .travis.yml
Created Sep 25, 2017 — forked from huytd/.travis.yml
Travis CI config for Rust/Diesel project
View .travis.yml
language: rust
rust:
- nightly
cache: cargo
services:
- postgresql
before_script:
- psql -c 'create database build_db;' -U postgres
- echo "DATABASE_URL=postgres://postgres@localhost/build_db" > .env
- cargo install diesel_cli --no-default-features --features=postgres
@matthewjberger
matthewjberger / TrueColour.md
Created Jul 10, 2017 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@matthewjberger
matthewjberger / Pool.h
Created May 20, 2017 — forked from jrandom/Pool.h
C++11/14 Thread Pool
View Pool.h
//
// Pool.h
//
#ifndef Tools_Thread_Pool_h
#define Tools_Thread_Pool_h
// ================================================================================ Standard Includes
// Standard Includes