This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Will probably trigger rate limiting. | |
# It would be a lot smarter to mirror the whole history and then search offline. | |
from mastodon import Mastodon as M | |
from optparse import OptionParser | |
import sys | |
import re | |
parser = OptionParser() | |
parser.add_option("-a", "--api-token", dest="apitoken", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Takes care of Hamburg (HAM) Airport "free wifi" captive portal | |
# see also captive-be-gone folder in my repo fnordomat/misc | |
# https://github.com/fnordomat/misc | |
import subprocess | |
import re | |
import lxml | |
from lxml import html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Takes care of "hospitality.thecloud.eu" captive portal | |
# see also captive-be-gone folder in my repo fnordomat/misc | |
# https://github.com/fnordomat/misc | |
import subprocess | |
import re | |
import lxml | |
from lxml import html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Receive and "decode" some TV remote control signals using TSOP48xx | |
* | |
* Single-threaded operation, attempting decoding and matching every time a pause | |
* of 30ms between signal toggles is detected. | |
* | |
* "decoding" = binning toggles into periods of 1/38000s, registering a "1" if | |
* the signal went or remained high and a "0" if it went or remained low during | |
* the period. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for some reason this was missing from Z3py: | |
def Sequence(name, ctx=None): | |
"""Return a sequence constant named `name`. If `ctx=None`, then the global context is used. | |
>>> x = Sequence('x') | |
""" | |
ctx = z3.get_ctx(ctx) | |
int_sort = z3.IntSort(ctx) | |
return z3.SeqRef( | |
z3.Z3_mk_const(ctx.ref(), | |
z3.to_symbol(name, ctx), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import re | |
import lxml | |
from lxml import html | |
import urllib | |
import urllib.request | |
import urllib3 | |
import base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# not pretty but worked for me | |
# curl --stderr - --trace - -v -L -A '' http://foobar.com | tee step0001 | |
# # -> the href in there, including the mac address | |
# curl --stderr - --trace - -v -L -A '' -c kookie.jar "https://passman01.wifipass.org/w2p/login-url-real.php?id=BLABLA&domain=controleur.wifipass.org&mac=XX-XX-XX-XX-XX-XX&page=http%3A%2F%foobar.com%2F" | tee step0002 | |
# # -> the _token value in there | |
# curl --stderr - --trace - -v -L -A '' -c kookie.jar 'https://passman01.wifipass.org/w2p/formulaire_fin.php?id=BLABLA&domain=controleur.wifipass.org' -F "registration[id1]=1" -F "registration[id2]=243" -F "registration[newsLetterType]=FOOFOO" -F "registration[email][email protected]" -F "_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -F "accept=true" --post301 --post302 --post303 | tee step0003 | |
# # took this path again, ended in a cycle: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I believe this is the necessary and sufficient step to get internet access on board the Czech long distance trains (e.g. EuroCity which runs from Prague to Kiel) | |
curl -vLA '' 'http://cdwifi.cz/portal/api/vehicle/gateway/user/authenticate' | |
# It says "500 internal server error" but that doesn't keep it from working. | |
# check with this request, answer should contain "authenticated":1 | |
curl -vLA '' 'http://cdwifi.cz/portal/api/vehicle/gateway/user' | |
# Also nice: GPS data (but seems outdated) | |
curl -vLA '' 'http://cdwifi.cz/portal/internal/api/x6/position' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Accor group hotels offer "free wifi" (ESSID: "m3connect") service | |
# with internet access (with paid options for higher transfer rates). | |
# | |
# This takes care of the m3connect captive portal. | |
# | |
# Please drop me a note if it stops working, is insecure etc. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.Either | |
import Data.List | |
import Data.Array.IArray as A | |
import Control.Arrow (second) | |
import Control.Monad.Except | |
-- Partition a number n into exactly l parts of sizes \in \{1..f\} | |
-- 1st arg: the number to be partitioned |
NewerOlder