Skip to content

Instantly share code, notes, and snippets.

View TheLinx's full-sized avatar

Linus TheLinx

  • Stockholm, Sweden
View GitHub Profile
@TheLinx
TheLinx / README
Created February 12, 2012 04:24
irssi notifications
== SERVER:
- hilightcmd.pl goes in ~/.irssi/scripts/ (and autorun, symlink it)
- notify goes somewhere (make sure you put the path to it in the hilightcmd.pl file)
- irc goes somewhere (easiest: directly in ~)
== CLIENT:
- irssinotify-daemon.py somewhere (probably your bin folder)
- add an item to your .ssh/config, something like this:
Host uapps-irssi
Hostname uapps.org
@TheLinx
TheLinx / genconfig.lua
Created July 7, 2011 12:02
Good Luck bot
assert(pcall(require, "twitter"), "You need ltwitter (https://github.com/TheLinx/ltwitter)")
print("Let's generate a configuration file for GoodLuckBot.")
base = [[username = "%s"
password = "%s"
consumerkey = "%s"
consumersecret = "%s"
tokenkey = "%s"
tokensecret = "%s"]]
@TheLinx
TheLinx / rmevoth.lua
Created April 8, 2011 09:19
Remove every other file
#!/usr/bin/env lua
-- does what it says on the tin
-- note that this removes files and directories indiscriminately, unlike the python script
-- also, no special options or anything like that
-- this is as small as it gets
require"lfs"
t = {}
for n in lfs.dir"." do
if n:sub(1,1) ~= "." then
#!/usr/bin/env lua
-- prints the collected duration of all files listed on the command line or stdin
-- get filenames
if select("#", ...) == 0 then -- nothing on commandline, assume stdin
files = {}
while true do
local s = io.stdin:read("*l")
if not s or #s < 0 then break end -- read until ctrl+d or empty line
table.insert(files, s)
@TheLinx
TheLinx / rogg.lua
Created March 10, 2011 13:07
Recursively encode any ffmpeg-supported audio tracks to Ogg Vorbis
#!/usr/bin/env lua
-- Recursively encode any ffmpeg-supported audio tracks to Ogg Vorbis
local lfs = require("lfs") -- LuaFileSystem
local exec = os.execute
local function is_directory(fullname)
return lfs.attributes(fullname, "mode") == "directory"
end
local function recurse(path, target)
#!/usr/bin/env lua
require("cue") -- https://github.com/TheLinx/LuaCue/
if not (arg[1] and arg[2]) then
print("usage: cuetoflacs.lua in.cue out-dir")
os.exit()
end
dir = arg[1]:match("(.+/).+") or "./"
# Contributor: Eric Forgeot < http://anamnese.online.fr >, dreeze and Linus Sjögren <thelinx@unreliablepollution.net>
pkgname=love
pkgver=0.7.0
pkgrel=3
pkgdesc="An open-source 2D game engine which uses the versatile Lua scripting language to create dynamic gaming experiences."
arch=(i686 x86_64)
url="http://love2d.org/"
license=('zlib')
depends=('lua' 'physfs' 'freetype2' 'devil' 'mpg123' 'openal' 'libvorbis' 'libmodplug')
makedepends=('wget')
@TheLinx
TheLinx / fp-ticker.lua
Created November 13, 2010 16:20
a (very ugly) lua script that utilizes notify-send and other stuff to get the fp-ticker to GNU/Linux
#!/usr/bin/env lua
require "socket"
http = require "socket.http"
require "ltn12"
require "json"
require "state"
conf = state.load "fp-notify"
if not conf or arg[1] == "--reconfigure" then
-- CLI version of unifrog
-- public domain
-- ascii frog generated by the GIMP
frames = {
[==[
_,
__s)2ooo2r+l,
/*1Ivvnvv}; <=
:++|||IlIl>++ii
#!/bin/bash
function _findres_it {
local it=2
while [ 1 ]; do
if [ $it -gt $itval ]; then
itval=$it
break
fi
it=$(($it*2))
done