Skip to content

Instantly share code, notes, and snippets.

@jonschoning
jonschoning / bezmouse.py
Last active March 28, 2024 15:33
bezmouse
from time import sleep
import mouse
import sys
def main():
mouse.move_to_area(
int(sys.argv[1]), # x
int(sys.argv[2]), # y
int(sys.argv[3]), # w
int(sys.argv[4]), # h
This file has been truncated, but you can view the full file.
@jonschoning
jonschoning / hfmt.py
Last active January 15, 2023 21:33
hfmt.py
hfmt=(lambda s0,w=2,j=' ':(lambda s:j.join([s[i:i+w]for i in range(0,len(s),w)]))(s0 if len(s0)%w==0else'0'*(w-len(s0)%w)+s0))
xfmt=lambda v,w=2,j=' ':hfmt("{:x}".format(v),w,j)
bfmt=lambda v,w=4,j=' ':hfmt("{:b}".format(v),w,j)
#xfmt(0xAA)
#bfmt(0XAA)
import Control.Exception
import Control.Concurrent
import System.IO (hSetBuffering, BufferMode(NoBuffering), stdout)
main = do
hSetBuffering stdout NoBuffering
bracket (return "ending")
(\x -> putStrLn x)
(\_ -> threadDelay 10000000000)
jon at kestrel in ~/fs/git/kubernetes-client-haskell(master|…)
$ git reset --hard
HEAD is now at 94ee7cc Merge pull request #92 from jonschoning/fix-incorrectly-generated-querystrings

jon at kestrel in ~/fs/git/kubernetes-client-haskell(master|…)
$ stack build
kubernetes-client-core> build (lib)
kubernetes-client-core> Preprocessing library for kubernetes-client-core-0.4.2.0..
kubernetes-client-core> Building library for kubernetes-client-core-0.4.2.0..
@jonschoning
jonschoning / do_nothing_script.py
Created November 4, 2021 05:15 — forked from snth/do_nothing_script.py
Procedural version of do nothing script
import sys
def wait_for_enter():
input("Press Enter to continue: ")
def create_ssh_keys(context):
"""Run:
ssh-keygen -t rsa -f ~/{username}
"""
pass
/usr/bin/xscreensaver -nosplash
xwinwrap -b -fs -sp -fs -nf -ov -- nice -n 19 /usr/lib/xscreensaver/klein -root -view-mode walk -mode wireframe -speed-wx 0.01 -speed-wy 0.01 -speed-wz 0.01 -speed-xy 0.1 -speed-xz 0.01 -speed-yz 0.01 -walk-direction -14.3363 -walk-speed .03 -window-id WID
/usr/lib/xscreensaver/klein -root -view-mode walk -mode wireframe -speed-wx 0.01 -speed-wy 0.01 -speed-wz 0.01 -speed-xy 0.1 -speed-xz 0.01 -speed-yz 0.01 -walk-direction -14.3363 -walk-speed .03 -window-id 0x5c00001
pactl load-module module-null-sink sink_name="obsvirtual_sink" sink_properties=device.description="obsvirtual" # Create Sink
pactl load-module module-remap-source source_name="obsvirtual_source" master="obsvirtual_sink.monitor" # Create Source
@jonschoning
jonschoning / facebook-messages-declutter.js
Last active November 29, 2020 03:27
Facebook messages: Declutter
// ==UserScript==
// @name Facebook messages: Declutter
// @version 1
// @grant none
// ==/UserScript==
const SPECS =
[ { selectors: `._4_j5`, description: 'remove right pane', action: action_remove, enabled: true }
,
];
@jonschoning
jonschoning / build.sh
Created November 27, 2020 15:00 — forked from angerman/build.sh
Cross compiling ws-tunnel
# prefetch wstunnel's master for nix, and store the result in wstunnel.json
nix-prefetch-git https://github.com/erebe/wstunnel > wstunnel.json
# and build the wstunnel-tarball with nix, using the haskell.nix infra structure as above (see default.nix)
nix build \
-f default.nix \
rpi64-musl.wstunnel-tarball \
-o rpi64-musl-wstunnel-tarball
--arg wstunnel-json ./ws-tunnel.json