This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua implementation of PHP scandir function | |
function scandir(directory) | |
freeswitch.consoleLog( "debug", "scanning " .. directory ); | |
local i, t, popen = 0, {}, io.popen | |
local pfile = popen("ls -a "..directory) | |
for filename in pfile:lines() do | |
i = i + 1 | |
t[i] = filename | |
end | |
pfile:close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Cannot run anything useful without grep | |
if ( ! command -v grep &> /dev/null ); then | |
echo "Cannot continue without grep" >&2 | |
exit 10 | |
fi | |
ACKSPACE_NL_4="185.145.156.70" | |
ACKSPACE_NL_6="2a07:4840:0:1::54" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
addPanelItem() { | |
PANEL_PATH=~/.config/mate/panel2.d/default/launchers/ | |
echo -ne $1 | |
filename=$(basename -- "$1") | |
extension="${filename##*.}" | |
filename="${filename%.*}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Mostly stolen from https://www.youtube.com/watch?v=ZA_PxLuofV4 / https://learndataanalysis.org/control-lcd-number-widget-with-a-slider-pyqt5-tutorial/ | |
import sys | |
from PyQt5.QtWidgets import (QApplication, QWidget, QSlider, QHBoxLayout, QDesktopWidget) | |
from PyQt5.QtCore import Qt | |
from gi.repository import Gio | |
from gi.repository import GLib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getEpisodes() | |
local soundDir = '/mnt/nasi/Media/Muziek/Radio Bergeijk/'; | |
local f = assert(io.popen('find "' .. soundDir .. '" -type f | sort')); | |
local output = f:read('*all'); | |
f:close(); | |
local episodes = {} | |
for line in output:gmatch("([^\n]*)\n?") do | |
if (line ~= '') then | |
freeswitch.consoleLog('info', line); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local socket = require 'socket' | |
local maxbuffer = 100 | |
local pixels = 200 | |
local espixelflutIp = '192.168.1.234' | |
local espixelflutPort = '1234' | |
local musicFile = '/mnt/nasi/Media/Muziek/L.E.D. There Be Light (Extended Mix).mp3' | |
udp = socket.udp() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Use xargs to remove trailing space | |
FQDN=`hostname -A|xargs` | |
if ! [ $(id -u) = 0 ]; then | |
echo "Check if you can sudo here (or run this script as root)" | |
fi | |
echo "Check client's internet connection and" | |
echo "create keypair on the client machine by using ONE of the following commands:" | |
echo "\$ ssh-keygen -t ed25519 -C \"\$USER@\$HOSTNAME\" -f \"\$HOME/.ssh/$FQDN\" -P \"\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Irssi; | |
use Irssi::Irc; | |
use vars qw($VERSION %IRSSI); | |
$VERSION = "0.9"; | |
%IRSSI = ( | |
authors => "xopr", | |
contact => "xopr\@ackspace.nl", | |
name => "autorespond", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # compile this with | |
// ./openwrt-sdk-19.07.7-ramips-mt76x8_gcc-7.5.0_musl.Linux-x86_64/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/bin/mipsel-openwrt-linux-gcc fartnet.c -o fartnet | |
// # copy over the file: | |
// # at the pc, run: | |
// nc -l 9999 -w0 < fartnet | |
// # at the router, run: | |
// nc 192.168.2.116 9999 > fartnet | |
// chmod +x fartnet | |
// # next, kill everything that accesses the device node: | |
// kill -9 `ps w|grep watchdog_loop|grep -v grep|awk '{ print $1 }'` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#pip-3 install dnspython | |
import dns.resolver | |
import dns.e164 | |
import re | |
import sys | |
import optparse |
NewerOlder