Skip to content

Instantly share code, notes, and snippets.

/* Copyright (C) 2011 Intel Corporation
Author: Andi Kleen
Set 2.6.x personality
uname26 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; version
2.
uname26 is distributed in the hope that it will be useful,
# I didn't write this, I just adapted it from the lenny version: https://gist.github.com/href/54859127c183f67f947f
# inspired by http://askubuntu.com/a/528171
# prerequisites
sudo apt-get install bison
# get bash 3.1 source
mkdir src && cd src
wget http://ftp.gnu.org/gnu/bash/bash-3.1.tar.gz
tar zxvf bash-3.1.tar.gz
@0xef53
0xef53 / proxy.go
Last active August 29, 2015 14:12 — forked from vmihailenco/proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@0xef53
0xef53 / ping.go
Created November 9, 2016 07:32 — forked from artyom/ping.go
package main
import (
"fmt"
"net"
"os"
"time"
"golang.org/x/net/icmp"
"golang.org/x/net/ipv4"
@0xef53
0xef53 / kernel-loopback-network.patch
Last active June 7, 2017 11:48
kernel-4.9-loopback-network.patch
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -467,11 +467,28 @@ int inet_bind(struct socket *sock, struc
chk_addr_ret != RTN_BROADCAST)
goto out;
+ /* HACK */
snum = ntohs(addr->sin_port);
- err = -EACCES;
- if (snum && snum < PROT_SOCK &&
@0xef53
0xef53 / salted_md5.go
Created February 25, 2019 04:28
MD5 hashing function (like mkpasswd --hash=md5)
func md5Crypt(password string, salt string, prefix string) string {
// start with a hash of password and salt
initBin := md5.Sum([]byte(password + salt + password))
// begin an initial string with hash and salt
initText := bytes.NewBufferString(password + prefix + salt)
// add crap to the string willy-nilly
for i := len(password); i > 0; i -= 16 {
@0xef53
0xef53 / vsock-proxy.go
Created January 27, 2021 13:37
vsock-proxy
package main
import (
"errors"
"flag"
"fmt"
"io"
"log"
"net"
"os"
@0xef53
0xef53 / mac2ip.go
Created March 31, 2021 19:53
MAC address to IPv6 link-local address
package main
import (
"fmt"
"log"
"net"
)
func mac2ip(s string) (net.IP, error) {
mac, err := net.ParseMAC(s)