Skip to content

Instantly share code, notes, and snippets.

Frieder Steinmetz willnix

View GitHub Profile
@willnix
willnix / usb-android-emulator-ubuntu.md
Last active May 14, 2020 — forked from Alabate/usb-android-emulator-ubuntu.md
Use custom USB device with Android emulator by using custom built kernel on Ubuntu 18.04
View usb-android-emulator-ubuntu.md

Use custom USB device with Android emulator by using custom built kernel on Ubuntu 18.04

The android emulator doesn't support all usb devices because they are disabled in the kernel. So we need to build it with another configuration. My goal was to build the same version as it was before, but with just configuration modifications.

Find current android version

Start the emulator without modifications, go into

Configuration > System > About emulated device > Android version

@willnix
willnix / hashUnencodedChars.py
Created Jul 4, 2019
Python version of hashUnencodedChars
View hashUnencodedChars.py
#!/usr/bin/env python3
import hashlib
def hash_unencoded_chars(s: str) -> hashlib.sha256:
""" hash_unencoded_chars - emulates com.google.common.hash.Hashing.sha256().hashUnencodedChars(s)
Google's java library guava comes with the hashUnencodedChars function
which yields different results than most other language's hashing functions.
This function should be compatible.
"""
@willnix
willnix / custom_ftp.py
Created May 17, 2019
Simple FTP server that accepts any credentials and logs the to stdout
View custom_ftp.py
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
from pyftpdlib.log import logger
HOMEDIR = "/var/ftp"
# Authorizer granting access to everyone and logging the credentials
class LoggingAuthorizer(DummyAuthorizer):
def validate_authentication(self, username, password, handler):
@willnix
willnix / custom_http.py
Last active May 17, 2019
Slightly customized Python 3 HTTP Server
View custom_http.py
#!/usr/bin/env python3
from http.server import SimpleHTTPRequestHandler, HTTPServer
class CustomHTTPRequestHandler(SimpleHTTPRequestHandler):
def do_GET(self):
'''
Print request and call SimpleHTTPRequestHandler.do_GET()
to serve static files
'''
print(">"+"-"*40+"<")
View blurma.js
// ==UserScript==
// @name BlurMa
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Blur latest Threema message preview
// @author Frieder Steinmetz
// @match https://web.threema.ch/*
// @grant none
// ==/UserScript==
@willnix
willnix / zombies2gpx.go
Last active Apr 22, 2016
Converts the JSON format used by "Zombies Run!" to GPX which can be imported in Runtastic.
View zombies2gpx.go
package main
import (
"fmt"
"os"
"time"
"encoding/json"
"encoding/xml"
)
View keybase.md

Keybase proof

I hereby claim:

  • I am willnix on github.
  • I am willnix (https://keybase.io/willnix) on keybase.
  • I have a public key whose fingerprint is 5684 C0D8 2CBA 23F8 6586 46EA 9A53 2500 B675 2867

To claim this, I am signing this object:

View vortex0.go
package main
import (
"bufio"
"encoding/binary"
"fmt"
"log"
)
type num [4]uint32
@willnix
willnix / Semtex5.go
Last active Aug 29, 2019
Semtex5 - Using TOR and its control signal NEWNYM to establish 10 connections from different IP addresses
View Semtex5.go
package main
import (
"fmt"
"github.com/hailiang/gosocks"
"io"
"net"
"os"
"strings"
"time"
View gist:5225036
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"strings"
"sort"
You can’t perform that action at this time.