Skip to content

Instantly share code, notes, and snippets.

View cyphunk's full-sized avatar

Nathan Fain cyphunk

  • stage theatre + reverse engineering
View GitHub Profile
@cyphunk
cyphunk / chatgpt-testmaths.py
Last active May 26, 2023 09:34
chatgpt basic math test
# Ask chatgtp following prompted questions in order
# and then compare with the results with code herein
# 1. Create a list of 50 random float point numbers
# between 50 and 100 with a maximum of 1 decimal place.
# 2. Sort the list
# 3. Calculate the gap between each number
# 4. Sort the results by gap, with largest gap first
#
# for questions email nathan at squimp.com
#
@cyphunk
cyphunk / covid2023stats.py
Last active February 28, 2023 11:54
covid stats 2023
def calculate(country,pop,c,d):
print(f"{country}: pop {pop}mil, cases {c}mil, deaths {d}")
print(f"death per popul %{((d/(pop*1000000))*100):.2f}")
print(f"death per cases %{((d/(c*1000000))*100):.2f}")
"""
Example output:
sweden: pop 10.35mil, cases 2.523404mil, deaths 19100
death per popul %0.18
death per cases %0.76
@cyphunk
cyphunk / questions.json
Last active February 19, 2023 21:58
questions.json
[
{
"question":
{
"en": "What percentage of refugees today (worldwide) are from European ex-colonies?",
"de": "Wieviel Prozent der weltweiten Geflüchteten heutzutage kommen aus europäischen Ex-Kolonien?"
},
"options":
[
{ "en": "12%", "de": "12%" },
@cyphunk
cyphunk / make-keinanzeigen-usable.js
Last active January 31, 2023 11:18
make-keinanzeigen-usable.js
// ==UserScript==
// @name make ebay keinanzeigen usable
// @namespace github.com/cyphunk
// @version 1970.1.1
// @match https://*.ebay-kleinanzeigen.de/*
// @run-at document-end
// @grant none
// @author cyphunk
// @icon https://ebay-kleinanzeigen.de//favicon.ico
// @description make ebay keinanzeigen usable. attempts to fade duplicates and items you have already seen once. has a high false possitive rate with current configuration where an item is keyed by only zipcode and price. I'd rather have higher false-positives and have adverts I miss then see an advert reposted with just a different title. This can bechanged though, see code below to change 'TAG'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cyphunk
cyphunk / rough_colonies_shapes.geojson
Last active January 21, 2023 11:05
(not mine. sourced from facq berlin)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cyphunk
cyphunk / activeportal.py
Created December 5, 2022 12:57
activeportal notes pulled from surrogatewitch performance project. use in combined with wifi_hostpost.sh from pitheatre
#!/usr/bin/env python3
# opens a HTTP and HTTPS server
port = 8083
portssl = 8443
# NGINX Setup in sites-enabled:
"""
test -e /etc/nginx/sites-available/captiveportal_http \
|| cat <<EOF > /etc/nginx/sites-available/captiveportal_http
server {
@cyphunk
cyphunk / torforced.sh
Last active April 13, 2023 15:44
torforced runs command with network access restricted to torport (or specified network port)
# provide torport and then command + args
echo $1 | grep -E -q '^[0-9]+$' || echo "args: torport command (e.g. 9050 or 9150). Note, this command does not automatically forward traffic of command through tor, it only restricts network acces of command to torport. You must configure the target application to use tor/socks/whatever independently. Test with command 'printf \"GET / HTTP/1.1\r\nHost: check.torproject.org\r\n\r\n\" | torforced 9050 torsocks nc check.torproject.org 80' or 'torforced 9050 torsocks curl http://checkip.dyndns.org'"
echo $1 | grep -E -q '^[0-9]+$' || exit 1
# This may not provide the same level of assuranced that tor browser does
# It just makes certain you do not do something stupid on your own
# or something unknown happening in the background.
port=$1
shift
# will setup a group,
# restrict with iptables the permitted ports for that group
@cyphunk
cyphunk / Glypheo to QLab with OSC Cues.applescript
Last active August 27, 2020 15:06
Import subtitle text from Glypheo into QLab and trigger Glypheo from QLab
-- for the Theater show "The History of Korean Western Theater"
-- Assumes Glypheo has two text field tracks.
-- In our case the Left most is Korean subtitles, right most English
-- These will be imported into QLab and be used to name a Group Cue
-- inside the Group Cue a OSC message is created to then trigger Glypheo from QLab
-- another OSC message is added to be sent to Ableton
-- This way Qlab is used to control both the subtitles and Ableton (ableton controls rice cookers and robotics on stage)
--set TitleType to "Titles" -- Qlab v3
set TitleType to "Text" -- Qlab v4
if (MM) (MetaMother) (= person)
or
if (RT) ReproTribe (= institution, group of people)
source energy (= negentropy (N’) (bigger than) entropy) (N)
sufficient for TFRL to be run (recombine)
if recombine artificial identity / constructed life form
= „biobody“, „JPR“
and „main skin“, „Databody“, „CryoKommunisat“ )