Skip to content

Instantly share code, notes, and snippets.

View nelsonjchen's full-sized avatar

Nelson Chen nelsonjchen

View GitHub Profile
#!/bin/sh
node ~/code/sr/esc-pos-jison/run.js $1
package main
import "net"
func echoServer(c net.Conn) {
for {
buf := make([]byte, 512)
nr, err := c.Read(buf)
if err != nil {
return
@nelsonjchen
nelsonjchen / gist:cc179fffd73b57417a58
Last active September 20, 2015 00:36
$120 bucks a year! Thanks BoA!
TsvHttpData-1.0
http://releases.ubuntu.com/vivid/ubuntu-15.04-desktop-amd64.iso 1150844928 53c869eba8686007239a650d903847fd
http://releases.ubuntu.com/vivid/ubuntu-15.04-desktop-i386.iso 1188855808 6ea04093b767ad6778aa245d53625612
[root]
name = "staticfile"
version = "0.3.0"
dependencies = [
"filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
"iron 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"iron-test 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mount 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@nelsonjchen
nelsonjchen / exclamation.txt
Created January 4, 2017 21:21
HEY, WATCH OUT!
.-^-.
/ .-. \
/ / . \ \
/ / | | \ \
/ / | | \ \
/ / V \ \
/ / O \ \
/ (_____________) \
\_________________/
import os
import yaml
import csv
with open('2.csv', 'r') as csv_file:
reader = csv.reader(csv_file)
for row in reader:
title = row[0]
description = row[1]
@nelsonjchen
nelsonjchen / driversign.c
Created August 11, 2017 23:21
Windows XP Driver signing on and off
#include <windows.h>
#include <wincrypt.h>
#include <stdio.h>
#define HP_HASHVALUE HP_HASHVAL
/* This program turns the Driver signing Policy On/Off for Windows XP
* Written by Stefan `Sec` Zehl <sec@xxxxxx>, 15.11.2004
*
* Thanks to sysinternals.com for regmon and apispy
DEBUG:cargo::build: executing; cmd=cargo-build; args=["/Users/nelson/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo", "build"]
DEBUG:cargo::core::workspace: find_root - trying /Users/nelson/code/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /Users/nelson/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /Users/Cargo.toml
DEBUG:cargo::core::workspace: find_root - trying /Cargo.toml
DEBUG:cargo::core::workspace: find_members - only me as a member
DEBUG:cargo::core::registry: load/missing file:///Users/nelson/code/dsym_demo
DEBUG:cargo::sources::config: loading: file:///Users/nelson/code/dsym_demo
DEBUG:cargo::core::resolver: initial activation: dsym_demo v0.1.0 (file:///Users/nelson/code/dsym_demo)
DEBUG:cargo::core::registry: load/locked file:///Users/nelson/code/dsym_demo
#!/bin/sh
OPTS=""
OPTS="$OPTS -enable-kvm"
OPTS="$OPTS -cpu host,kvm=off,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time"
OPTS="$OPTS -machine type=pc-i440fx-2.1,accel=kvm"
OPTS="$OPTS -m 8G"
OPTS="$OPTS -cdrom win10.iso"
OPTS="$OPTS -vnc :1"
OPTS="$OPTS -device usb-ehci,id=ehci"
x509Certificate2 is a subclass of x509Certificate:
https://github.com/dotnet/corefx/blob/b384b309061c050a31dcf2b8f377f5da244fcf7b/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate2.cs#L15
x509Certificate2 Filename Constructor:
https://github.com/dotnet/corefx/blob/b384b309061c050a31dcf2b8f377f5da244fcf7b/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate2.cs#L82
x509Certificate2 loads file with null password and default key storage:
https://github.com/dotnet/corefx/blob/b384b309061c050a31dcf2b8f377f5da244fcf7b/src/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate.cs#L111
Default Key Storage Flags: