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
@inmatarian
inmatarian / lzw.lua
Created December 27, 2014 02:14
LZW Compression in Lua, rosetta-code style, also includes a 8-bit only mode for 7bit plain text strings.
local lzw = {}
local function enc_reset(dict, size)
for k, _ in pairs(dict) do dict[k] = nil end
for i = 0, size-1 do dict[string.char(i)] = i end
return dict
end
local function dec_reset(dict, size)
for k, _ in pairs(dict) do dict[k] = nil end
@aaronhurt
aaronhurt / curltest.c
Last active February 13, 2025 15:51
example code using libcurl and json-c to post and parse a return from http://jsonplaceholder.typicode.com
/**
* example C code using libcurl and json-c
* to post and return a payload using
* http://jsonplaceholder.typicode.com
*
* License:
*
* This code is licensed under MIT license
* https://opensource.org/licenses/MIT
*
@fur-q
fur-q / Makefile
Last active August 29, 2015 14:06
im da bes
CC = gcc
LUA = luajit
loader: loader.o myscript.l.o
$(CC) $(LDFLAGS) -o $@ $^
%.l.o: %.lua
$(LUA) -bg $^ $@
local currentval = redis.call('get', ARGV[1])
local currentcount = redis.call('get', ARGV[1] .. '.count')
redis.call('incr', ARGV[1] .. '.count')
currentval = (currentval * (currentcount/(currentcount + 1))) + (ARGV[2]/(currentcount+1))
redis.call('set', ARGV[1], currentval)
return currentval
@upa
upa / LICENSE
Last active August 23, 2022 16:42
Ansible Module for Linux Bridge and VLAN
MIT License
Copyright (c) 2021 Ryo Nakamura
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@akesterson
akesterson / gist:11391984
Created April 29, 2014 06:22
Why I switched from bamboo to jenkins
TL;DR - It was proving to be more buildsystem than I needed,
and I had found that there were other buildsystems that met my needs
that I felt were lighter and more nimble. It's still a fine product
that I continue to recommend to this day, I just no longer see it as
"The One True Way".
=========================
1: Bamboo was consuming a significant amount of system resources,
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
anonymous
anonymous / PKGBUILD
Created March 4, 2014 15:36
wxlua 2.8.12.3 PKGBUILD (lua 5.2)
# Maintainer : speps <speps at aur dot archlinux dot org>
# Contributor: Eric Forgeot < http://ifiction.free.fr >
pkgname=wxlua
pkgver=2.8.12.3
pkgrel=1
pkgdesc="A set of bindings to the wxWidgets library for the Lua programming language."
arch=('i686' 'x86_64')
url="http://wxlua.sourceforge.net"
license=('custom:wxWindows')
@denji
denji / http-benchmark.md
Last active May 15, 2025 12:21
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)

Exploiting Lua 5.1 on 32-bit Windows

The following Lua program generates a Lua bytecode program called ignore-unsigned-sga.fnt, which in turn loads a DLL from within an extremely locked down Lua 5.1 sandbox in a program called RelicCOH2.exe. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.

if string.dump(function()end):sub(1, 12) ~= "\27Lua\81\0\1\4\4\4\8\0" then
  error("This generator requires a 32-bit version of Lua 5.1")
end

local function outer()
  local magic -- In bytecode, the stack slot corresponding to this local is changed