Skip to content

Instantly share code, notes, and snippets.

View markuman's full-sized avatar
🐧
Linux Only - fail fast, move on

Markus Bergholz markuman

🐧
Linux Only - fail fast, move on
  • Lekker Energie GmbH
  • Berlin
View GitHub Profile
@markuman
markuman / burger.css
Created November 5, 2015 05:00 — forked from neingeist/burger.css
twitterburger (für stylish firefox extension)
@-moz-document domain(twitter.com) {
.HeartAnimationContainer {
visibility: hidden;
}
.HeartAnimationContainer:after {
content: '🍔';
visibility: visible;
display: block;
position: absolute;
@markuman
markuman / gist:7ce0f57684276a9b1d97
Last active November 19, 2015 08:56
Modular Exponentiation
# Python 3.5
>>> (80**65)%133
54
# Python 2.7
>>> (80**65)%133
54L
# Julia 0.4.1
julia> (80^65)%133
@markuman
markuman / cltools.sh
Created February 11, 2016 11:03 — forked from jellybeansoup/cltools.sh
Install Autoconf and Automake on OS X Mountain Lion
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
@markuman
markuman / gist:cf62eba8779f7abb377c
Created February 24, 2016 08:07
Zsun Wireless Wifi Card Reader
$ socat - TCP4:10.168.168.1:11880
������!����
(none) login: root
root
Password: zsun1188
Welcome to
------- | / /--/ ___ |
/ | /| \/ _____ --|--|
/_____\ |--- --|-- //--/ / / |
@markuman
markuman / gist:752854e7eb2528aba044
Created March 1, 2016 14:54
LuaJIT mipsr2 cross compiling
#!/bin/bash
# https://github.com/LuaJIT/LuaJIT/issues/34
git clone https://github.com/LuaJIT/LuaJIT
cd LuaJIT
git checkout v2.1
#toolchain
PREFIX=/home/markus/Downloads/buildroot-2015.11.1/output/host/usr
@markuman
markuman / main.lua
Created March 9, 2016 08:53
TurboLua uploading files (post) and garbage collection
#!/usr/bin/luajit
local turbo = require("turbo")
turbo.log.categories.success = true
local df = "test/"
local index = class("index", turbo.web.RequestHandler)
function index:get()
self:write("Hello World!")
-- ENVIRONMENT
local home = os.getenv ("HOME")
-- path go local geanylua conf
local _gldb = home .. "/.config/geany/plugins/geanylua/geany-lua-sql/?.lua;"
-- lua rock path
package.path = dldb .. home .. "/.luarocks/share/lua/" .. string.match (_VERSION, "%d.%d") .. "/?.lua;" .. package.path
package.cpath = home .. "/.luarocks/lib/lua/" .. string.match (_VERSION, "%d.%d") .. "/?.so;" .. package.cpath
[root@arch markus]# lsof -i|grep redis
redis-ser 9452 redis 4u IPv4 101278 0t0 TCP localhost.localdomain:redis (LISTEN)
[root@arch markus]# grep bind /etc/redis.conf
# interfaces using the "bind" configuration directive, followed by one or
# bind 192.168.1.100 10.0.0.1
bind 127.0.0.1
[root@arch markus]#
FROM ubuntu:16.04
RUN apt update \
&& apt install -y cargo wget unzip bash redis-tools
RUN wget https://github.com/NicolasLM/nucleon/archive/master.zip -O /tmp/nucleon.zip \
&& unzip /tmp/nucleon.zip \
&& cd nucleon-master \
&& cargo build --release \
&& cp -a target/release /opt \
&& rm /tmp/nucleon.zip
@markuman
markuman / resp.lua
Created May 12, 2016 21:41
recursive resp protocol
#!/usr/bin/lua
-- resp = require "resp"
-- resp ("set", "A", 1)
-- *3\r\n$3\r\nset\r\n$1\r\nA\r\n$1\r\n1\r\n
re_resp = function (...)
local arg = {...}
if (#arg == 0) then io.write ("\n") return end
io.write (string.format ("$%d\r\n%s\r\n", #tostring (arg[1]), tostring (arg[1])))