Skip to content

Instantly share code, notes, and snippets.

View windwiny's full-sized avatar

windwiny windwiny

View GitHub Profile
@windwiny
windwiny / fork.c
Created March 28, 2017 13:00 — forked from Cr4sh/fork.c
fork() for Windows
/*
* fork.c
* Experimental fork() on Windows. Requires NT 6 subsystem or
* newer.
*
* Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
@windwiny
windwiny / ex-ssh-pty.rb
Last active February 19, 2016 05:17 — forked from KINGSABRI/ex-ssh-pty.rb
ex. SSH with real PTY
require 'net/ssh'
host = "the.host"
user = "joe"
su_user = "bob"
password = "password"
su_password = "password"
commands = ['export PS1="\n[$?] [\t] $PS1----\n"', "cd /", "pwd", "ls -l", "exit"]
finished = ("%08x" * 8) % Array.new(8) { rand(0xFFFFFFFF) }