Skip to content

Instantly share code, notes, and snippets.

View k0nserv's full-sized avatar

Hugo Tunius k0nserv

View GitHub Profile
@k0nserv
k0nserv / main.rs
Created July 27, 2024 16:46
sans-io with coroutines
#![feature(stmt_expr_attributes, coroutines, coroutine_trait)]
use std::ops::Coroutine;
use std::pin::pin;
use std::thread::sleep;
use std::time::{Duration, Instant};
fn main() {
let mut machine = pin!(make_machine());
let resp = machine.as_mut().resume(Input::ping(Instant::now()));
@k0nserv
k0nserv / threadz.rs
Last active March 19, 2024 11:19
trheadz.rs
use std::hint::black_box;
use std::thread;
use clap::Parser;
/// Simple program to test spawning many threads
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
/// Number of threads to spawn
@k0nserv
k0nserv / british.py
Last active June 3, 2022 04:34
It's British, innit?
class British(type):
def __call__(cls, *args):
foo = cls.__new__(cls)
foo.__innit__(*args)
return foo

Delete All your Tweets

This script it based on @chrisalbon's original script, but instead of fetching the users timeline via the Twitter API it uses the archive of the users data to workaround the 3200 tweet limitation.

Setup

  1. Create a virtualenv
  2. Run pip install -r requirements.txt
  3. Create a Twitter developer app.
@k0nserv
k0nserv / dump.h
Created January 17, 2021 13:42
Dump of symbols from Min Doktor 1.153.0
This file has been truncated, but you can view the full file.
@protocol NSObject
@property unsigned long hash
@property Class superclass
@property NSString *description
@property NSString *debugDescription
// instance methods
-[NSObject isEqual:]
-[NSObject class]
-[NSObject self]
@k0nserv
k0nserv / yikes.tsv
Last active January 5, 2021 22:28
Data collected by all Facebook's apps and linked to the user, see https://hugotunius.se/2021/01/03/an-analysis-of-privacy-on-the-app-store.html
Purpose Data Category Data Type
ANALYTICS BROWSING_HISTORY Browsing History
ANALYTICS CONTACTS Contacts
ANALYTICS CONTACT_INFO Email Address
ANALYTICS CONTACT_INFO Name
ANALYTICS CONTACT_INFO Other User Contact Info
ANALYTICS CONTACT_INFO Phone Number
ANALYTICS CONTACT_INFO Physical Address
ANALYTICS DIAGNOSTICS Crash Data
ANALYTICS DIAGNOSTICS Other Diagnostic Data
@k0nserv
k0nserv / README.md
Last active December 22, 2019 14:04
Small Python 3 script to check passwords against https://haveibeenpwned.com/'s list of previously comprised passwords

Have I Been Pwned Password Checker

A small Python 3 script to securely check passwords against https://haveibeenpwned.com/'s list of previously comprised passwords.

Usage

  1. Install the files requirements.txt in a Python 3 virtual environment with pip install requirements.txt.
  2. Start the script with python main.py.
# /Users/hugotunius/.config/tmuxinator/default.yml
name: <%= @args[0] || 'default' %>
root: <%= @settings['workspace'] || '~/' %>
# Optional tmux socket
# socket_name: foo
# Runs before everything. Use it to start daemons etc.
# pre: sudo /etc/rc.d/mysqld start
@k0nserv
k0nserv / search-password.sh
Last active August 10, 2017 23:20
Check a password from Troy Hunt's 306m leaked passwords on the command line
LC_ALL=C echo -n "password" | openssl sha1 | tr '[:lower:]' '[:upper:]' | xargs -I '{}' look {} pwned-passwords-1.0.txt
@k0nserv
k0nserv / keybase.md
Created June 30, 2016 09:37
Keybase verification

Keybase proof

I hereby claim:

  • I am k0nserv on github.
  • I am k0nserv (https://keybase.io/k0nserv) on keybase.
  • I have a public key whose fingerprint is DD89 7638 862A FD67 9074 7661 CCEC 6D4D 9313 0BDD

To claim this, I am signing this object: