Skip to content

Instantly share code, notes, and snippets.

@gasman
gasman / pnginator.rb
Created April 30, 2012 18:08
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@Whitexp
Whitexp / facebok ip list
Last active May 19, 2024 06:47
facebook ip list
31.13.24.0/21
31.13.64.0/19
31.13.64.0/24
31.13.69.0/24
31.13.70.0/24
31.13.71.0/24
31.13.72.0/24
31.13.73.0/24
31.13.75.0/24
31.13.76.0/24
@spinxz
spinxz / vncserver@:1.service
Last active June 6, 2024 03:11
systemd service file for running a vncserver (e.g. tightvncserver)
# Vncserver service file for Debian or Ubuntu with systemd
#
# Install vncserver and tools
# e.g. apt-get install tightvncserver autocutsel gksu
#
# 1. Copy this file to /etc/systemd/system/vncserver@:1.service
# 2. Edit User=
# e.g "User=paul"
# 3. Edit the vncserver parameters appropriately in the ExecStart= line!
# e.g. the -localhost option only allows connections from localhost (or via ssh tunnels)
@glittershark
glittershark / shrug.sh
Created August 27, 2015 15:52
Xdotool script to type the shrug emoji
#!/bin/bash
echo -en "¯\\_(\xe3\x83\x84)_/¯" | xsel
xdotool key Shift+Insert
@bossen
bossen / skiptofade.lua
Last active May 8, 2022 01:29
mpv lua script. Seeks forward until a black screen appears. Built to skip openings. Uses the lavfi blackdetect filter.
-- betterchapters.lua
-- seeks forward until a black screen appears.
-- default keybinding: b
-- Keybind names: skip_scene
script_name = mp.get_script_name()
detect_label = string.format("%s-detect", script_name)
detecting = false
threshold = 0.9
detection_span = 0.05
negation = false
@myfreeer
myfreeer / cycle-denoise.lua
Last active July 12, 2024 10:36
mpv user-script to cycle between lavfi's denoise filters, tested over mpv 0.25.0-58-g99cef59fc
-- settings
-- key_binding: press the key specified below
-- to cycle between denoise filters below,
-- set it to nil to disable the binding
local key_binding = "n"
-- key_binding_reverse cycle between denoise filters below
-- in reverse order, set it to nil to disable the binding,
-- set it to a single-char string to enable
local key_binding_reverse = nil
@garoto
garoto / mpvhistory.lua
Last active April 6, 2024 11:53
Simple media logger Lua script for mpv
-- Not my code: originally from https://redd.it/3t6s7k (author deleted; failed to ask for permission).
-- Only tested on Windows. Date is set to dd/mmm/yy and time to machine-wide format.
-- Save as "mpvhistory.lua" in your mpv scripts dir. Log will be saved to mpv default config directory.
-- Make sure to leave a comment if you make any improvements/changes to the script!
local HISTFILE = (os.getenv('APPDATA') or os.getenv('HOME')..'/.config')..'/mpv/mpvhistory.log';
mp.register_event('file-loaded', function()
local title, logfile;
@bitingsock
bitingsock / ytdl prefetch resolver.lua
Last active August 19, 2023 18:35
resolves ytdl for urls in playlist when the demuxer reaches near the end of the file
local utils = require 'mp.utils'
local ytdlPath = mp.find_config_file("youtube-dl.exe")
local fileDuration = 0
local function check_position()
if fileDuration==0 then
mp.unobserve_property(check_position)
return
end
local demuxEndPosition = mp.get_property("demuxer-cache-time")
if demuxEndPosition and
@emoon
emoon / extract_ixa_music.c
Created June 8, 2019 20:19
Extract music from iXalance files (only seems to work for Astral blur right now)
// Code mostly extracted from https://www.libsdl.org/projects/ixalance/ but fixed a bunch of 64-bit issues with the code
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define INDEX_BIT_COUNT 10 // This is a total window of 4Kb
#define LENGTH_BIT_COUNT 4
#define WINDOW_SIZE ( 1 << INDEX_BIT_COUNT )
@bitingsock
bitingsock / channel mixer.lua
Created June 12, 2019 09:12
remix surround channel levels
cmCenter = 1
local defCenter = 1
cmFront = 0.707
local defFront = 0.707
cmSide = 0.707
local defSide = 0.707
cmBack = 0.707
local defBack = 0.707
cmLFE = 0
local defLFE = 0