Skip to content

Instantly share code, notes, and snippets.

View P1kachu's full-sized avatar
Working on ECUs and speed limiters

Stanislas Lejay P1kachu

Working on ECUs and speed limiters
View GitHub Profile
@wbenny
wbenny / vmcs_field_encoding.md
Last active December 11, 2020 10:04
VMCS field encoding

VMCS field encoding

Values of VMCS fields are encoded as per section VMREAD, VMWRITE, and Encodings of VMCS Field (24.11.2, Intel Manual Volume 3C - May 2018).

This encoding can be transcribed into C:

union vmcs_component_encoding
{
 struct
@P1kachu
P1kachu / calling_printf_osx.c
Created November 24, 2016 20:30
Calling printf in OSX - The overkill way
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <mach-o/dyld.h>
#include <mach-o/nlist.h>
#include <mach-o/dyld_images.h>
#include <mach/mach_vm.h>
/* Dyld is the OSX Dynamic Linker
* /usr/include//mach-o/loader.h
@ryantanjunming
ryantanjunming / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@mustafa01ali
mustafa01ali / internet-monitor.sh
Last active August 29, 2015 14:28
Simple bash script to detect network outage and troll network admins
#!/bin/bash
while true
do
ping -c 1 www.example.com &> /dev/null
if [ $? -ne 0 ]; then
echo `date`: ping failed!
say "Hey network admin - internet is down" -v bruce
fi
sleep 10
@onesneakymofo
onesneakymofo / gist:c131d97b502a6a6f9390
Last active April 27, 2016 20:47
Sublime Text Preferences
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_extra_width": 1,
"caret_style": "phase",
"close_windows_when_empty": false,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"copy_with_empty_selection": false,
"drag_text": false,
"draw_minimap_border": true,
@klappradla
klappradla / lame.sh
Last active December 10, 2022 20:02
Using lame command line tool (e.g. convert flac to mp3
# Convert .flac to .mp3 (lossless)
for f in *.flac; do ffmpeg -i "$f" -aq 1 "${f%flac}mp3"; done
# Convert .flac to .mp3, compress to ~ 120k
for f in *.flac; do ffmpeg -i "$f" -aq 5 "${f%flac}mp3"; done
# Convert .flac to mp3, compress to ~ 128k
for f in *.flac; do ffmpeg -i "$f" -b:a 128k "${f%flac}mp3"; done
# Convert .flac to mp3, compress to variable 190k