Skip to content

Instantly share code, notes, and snippets.

@rubo77
rubo77 / firmware.html
Last active September 9, 2015 07:39 — forked from neocturne/firmware.html
---
layout: base
---
<div class="heading">
<div class="row">
<div class="twelve columns">
<h1>Firmware</h1>
</div>
</div>
@rubo77
rubo77 / gist:6815165
Last active December 24, 2015 14:49 — forked from joshbmarshall/gist:6517321
The original Ghist didn't sent the correct result if an empty string is sent to the function. My edit sends an empty array as the original parse_str
<?php
/**
* do the same than parse_str without max_input_vars limitation
* @param $string array string to parse
* @return array query parsed
**/
function my_parse_str($string) {
if($string==='') return array();
$result = array();
@rubo77
rubo77 / SimpleAuthServer.py
Created January 29, 2016 00:50 — forked from fxsjy/SimpleAuthServer.py
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@rubo77
rubo77 / ipv6-httpd.py
Created November 24, 2015 12:56 — forked from akorobov/ipv6-httpd.py
quick ipv6 http server using python's SimpleHttpServer
import socket
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class MyHandler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/ip':
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
@rubo77
rubo77 / Packet types
Last active July 3, 2018 07:25 — forked from tcatm/Packet types
Konzept für ein verteiltes DHCP im Mesh
required types
--------------
- [X] Block allocation/freeing/delegation
- [ ] request for block owner
- [ ] lease renewal (proxy)
- [ ] lease renewal response (proxy)
Allocate Block
@rubo77
rubo77 / solve.md
Created August 11, 2018 16:39 — forked from leolin310148/solve.md
solve "error initializing graphdriver: loopback attach failed" for docker-in-docker

Create loopback.sh in tmp

#!/bin/bash
ensure_loop(){
  num="$1"
  dev="/dev/loop$num"
  if test -b "$dev"; then
    echo "$dev is a usable loop device."
 return 0
@rubo77
rubo77 / Compile to .deb
Last active November 13, 2018 16:34 — forked from Avyd/Compile to .deb
Compile kernel to installable .deb package
# Install necessary things
apt-get update
apt-get install --no-install-recommends kernel-package libncurses5-dev fakeroot wget bzip2 build-essential bison
# Get the kernel
cd /usr/src
# search latest kernel on https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/
VERSION=4.18.6
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-$VERSION.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-$VERSION.tar.sign
@rubo77
rubo77 / MainActivity.java
Last active May 7, 2019 13:16 — forked from sandeepyohans/MainActivity.java
Adding alert() support to a WebView - Android
/*
Retrieved from https://web.archive.org/web/20160516165158/http://lexandera.com/2009/01/adding-alert-support-to-a-webview/
*/
// ...
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
public class MainActivity extends AppCompatActivity {
@rubo77
rubo77 / create-gist.sh
Last active August 30, 2020 09:41 — forked from s-leroux/pgist.sh
A utility to create a gists from command line - for support, please check the repo https://github.com/ceremcem/create-gist
#!/bin/bash
GITHUB_USERNAME=rubo77
if [ "$1" == "" ]; then
echo 'usage: gistfile-post.sh filename [gistname]'
exit 0
fi
# 0. file name for the Gist
@rubo77
rubo77 / my_parse_str.php
Last active May 7, 2021 11:14 — forked from Shagshag/gist:5849065
This is a replacement for the original idea how to cirumvent the max_input_vars limitation, that uses the original parse_str() on each element of the query to parse
<?php
/**
* do the same than parse_str without max_input_vars limitation:
* Parses $string as if it were the query string passed via a URL and sets variables in the current scope.
* @param $string array string to parse (not altered like in the original parse_str(), use the second parameter!)
* @param $result array If the second parameter is present, variables are stored in this variable as array elements
* @return bool true or false if $string is an empty string
*