Skip to content

Instantly share code, notes, and snippets.

View msva's full-sized avatar
🤷

Vadim Misbakh-Soloviov msva

🤷
View GitHub Profile
@msva
msva / spawn.lua
Created March 9, 2024 14:20 — forked from iMega/spawn.lua
Using LuaJIT FFI, spawn a Linux command in the background.
-- Spawn a command in the background, optionally redirecting stderr and stdout
--
-- requiring this file returns a function(cmd_line, stdout_redirect, stderr_redirect)
--
-- `cmd_line` is the command with possible arguments
-- optional `stdout_redirect` is io.stdout, io.stderr, or a filename. default/nil is io.stdout
-- optional `stderr_redirect` is io.stdout, io.stderr, or a filename. default/nil is io.stderr
--
-- Example:
-- luajit -e 'require("spawn")("cat /etc/network/interfaces", "foo1", io.stdout)'
@perky
perky / ProFi.lua
Created May 30, 2012 20:32
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
@hellekin
hellekin / elgg.example.org-nginx.conf
Created December 26, 2010 20:46
A sample Nginx configuration for Elgg-1.8
## NginX VirtualHost Configuration for elgg.example.org
#
# Copyright 2010 Lorea.org
# This file is part of Lorea Node.
# License: GNU Affero General Public License
#
server {
listen 80;
server_name elgg.example.org;