Skip to content

Instantly share code, notes, and snippets.

View json-m's full-sized avatar
🏴

Jason M. json-m

🏴
View GitHub Profile
14:57:37 [252]33 IRC Operators online
14:57:37 [253]49 unknown connection(s)
14:57:37 [254]41643 channels formed
14:57:37 [255]I have 3481 clients and 1 servers
14:57:37 [265]3481 3943 Current local users 3481, max 3943
14:57:37 [266]76941 83476 Current global users 76941, max 83476
@json-m
json-m / main.go
Last active May 13, 2021 03:08
httpserver for quickly sharing a folder on disks contents
/*
syntax:
httpserver port path cidr
arguments are optional but expected in the above order
current directory via just . works
*/
package main
@json-m
json-m / hify.pl
Created February 3, 2021 00:32
h-ify for irssi
use warnings;
use strict;
use IPC::Open3;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = '0.1';
%IRSSI = (
author => 'c|p',
name => 'h-ify',
@json-m
json-m / aaaa.txt
Created February 1, 2021 23:48
ipv6 multicast
ff02::1 all nodes
ff02::2 all routers
ff02::5 all OSPF (Open Shortest Path First) routers
ff02::6 all OSPF DRs (OSPF Designated Routers)
ff02::9 all RIP (Routing Information Protocol) routers
ff02::a all EIGRP (Enhanced Interior Gateway Routing Protocol) routers
ff02::d all PIM (Protocol Independent Multicast) routers
ff02::f UPNP (Universal Plug and Play) devices
ff02::11 all homenet nodes
ff02::12 VRRP (Virtual Router Redundancy Protocol)
root at summit in ~
# lspci -nn | ag VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics P630 [8086:3e96]
05:00.0 VGA compatible controller [0300]: ASPEED Technology, Inc. ASPEED Graphics Family [1a03:2000] (rev 41)
root at summit in ~
# vainfo
libva info: VA-API version 1.8.0
libva info: Trying to open /usr/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_8
// The events are from https://www.w3.org/TR/html5/semantics-embedded-content.html#media-elements-event-summary
import videojs from 'video.js'
const Plugin = videojs.getPlugin('plugin')
const EVENTS = [
'loadstart',
'progress',
'suspend',
'abort',
'error',
@json-m
json-m / rain.py
Last active December 13, 2018 20:41
not for evil
import requests
import time
url = "https://zj.is/"
method = "HEAD"
def rain(arg):
try:
now = time.time()
r = requests.request(method=method, url=arg)
print(now, method, arg)
time.sleep(0.016) # about 20~25rq/s
@json-m
json-m / wvw_forwarder.py
Last active May 29, 2018 13:55
forwards guild wars 2 wvw stats to graphite
import requests
from requests import exceptions
import json
import time
import graphyte
# setup:
# pip3 install requests graphyte
match_url = 'https://api.guildwars2.com/v2/wvw/matches'
matches_dict = {}
graphyte.init('localhost', prefix='gw2.wvw') # change to your server
@json-m
json-m / sqlite3test.py
Created May 26, 2018 23:05
sqlite3 example
import sqlite3
from pathlib import Path
dbpath = Path('test.db')
def insert(uid, name):
print('inserting')
print(' ↪ uid:', uid)
print(' ↪ name:', name)
c.execute('INSERT INTO test (uid, name) values (?, ?)', (uid, name))