Skip to content

Instantly share code, notes, and snippets.

@nethoncho
nethoncho / raspbian-list-open-ports.sh
Last active February 22, 2023 14:29
Raspberry Pi Raspbian list open ports
netstat -lnt | grep LISTEN | awk '{ print ( $4 ) }' | awk 'BEGIN{FS=":"} { print $(NF) }' | sort -n | uniq
@JomerDev
JomerDev / main.lua (on mobile)
Last active July 7, 2016 15:45
File downloader
-- most of this is not needed fo the download, but this code keeps the app running even when there is an error
-- when an error happens, this code offers the option to update the files through the server
-- start at line 200 if you only want the file download service
function run()
if love.math then
love.math.setRandomSeed(os.time())
end
@fnuecke
fnuecke / bios.lua
Created December 24, 2014 00:35
Primitive remote code execution via OC network
local m=component.proxy(component.list("modem")())
m.open(2412)
local function respond(...)
local args=table.pack(...)
pcall(function() m.broadcast(2412, table.unpack(args)) end)
end
local function receive()
while true do
local evt,_,_,_,_,cmd=computer.pullSignal()
if evt=="modem_message" then return load(cmd) end
@LPGhatguy
LPGhatguy / VoipEncoder.lua
Created December 16, 2014 22:18
Demonstration of encoding SoundData into a packet
local ffi = require("ffi")
-- Create a C struct representing the header for our packet
ffi.cdef([[
typedef struct {
uint32_t uuid; // user identifier
uint32_t size; // in bytes
uint32_t bitrate; // in Hz
uint16_t bitdepth; // bits per sample
uint16_t channels; // probably 1 or 2
local header = [[
typedef struct FILE FILE;
typedef struct libvlc_instance_t libvlc_instance_t;
typedef int64_t libvlc_time_t;
typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
typedef struct libvlc_log_message_t
{
int i_severity;
const char *psz_type;
const char *psz_name;