Skip to content

Instantly share code, notes, and snippets.

View neraliu's full-sized avatar

neraliu neraliu

View GitHub Profile
@neraliu
neraliu / ssh-agent-snippets.sh
Created September 30, 2015 03:26 — forked from alexras/ssh-agent-snippets.sh
Bash snippets to automatically start and stop an ssh-agent process on login and logout
#!/bin/bash
## in .bash_profile
SSHAGENT=`which ssh-agent`
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
fi
@neraliu
neraliu / running-tasks-in.go
Last active September 21, 2016 04:25
running customized tasks with one interface run() in GO
package main
import (
"fmt"
)
// this is the signature of myTask
type myTask interface {
run() bool
}
@neraliu
neraliu / running-tasks-in.js
Last active September 21, 2016 05:05
running customized tasks with one interface run() in Javascript
(function() {
// object taskA
function taskA(name) {
this.name = name;
}
taskA.prototype.name = null;
taskA.prototype.run = function() {
console.log("taskA is running");
return true;
@neraliu
neraliu / memory_layout.md
Created January 13, 2018 07:57 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore