Skip to content

Instantly share code, notes, and snippets.

View rofl0r's full-sized avatar

rofl0r

View GitHub Profile
@rofl0r
rofl0r / github_2fa_oathtool.md
Created October 11, 2023 21:54
Using Github 2FA with oathtool

I've been forced by github to enable 2FA with the following banner:

GitHub users are now required to enable two-factor authentication as an additional security measure. Your activity on GitHub includes you in this requirement. You will need to enable two-factor authentication on your account before October 12, 2023, or be restricted from account actions.

Fortunately, i managed to make the switch using the FLOSS oathtool, a non-bloated CLI program written in C.

Once you click the "Enable 2FA" button, github presents you a barcode and a link to uncover the embedded "setup key". All you really need is the setup key, which as it turns out is Base32-encoded. The next step is to enter a 6-digit code supplied by the TOTP app. Here it is extremely important that your system clock is correct, best to sync with NTP directly before use.

@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
urban witch story walkthrough
.. because i imagine not everyone wants to download a 4 hrs youtube video for a single hint ...
leroy's house
talk with leroy (door)
talk with guy to learn he deals drugs and angela is a whore.
go to left (exit)
basketball court
@rofl0r
rofl0r / gist:1073739
Created July 9, 2011 16:53 — forked from angavrilov/gist:926972
mmap injection on linux (emulation of VirtualAllocEx)
/* Support for executing system calls in the context of the game process. */
static const int injection_size = 4;
static const char nop_code_bytes[injection_size] = {
/* This is the byte pattern used to pad function
addresses to multiples of 16 bytes. It consists
of RET and a sequence of NOPs. The NOPs are not
supposed to be used, so they can be overwritten. */
0xC3, 0x90, 0x90, 0x90
@rofl0r
rofl0r / android_file_urls.txt
Created February 1, 2021 01:59
filenames of all files on google android dl server
prefix with https://dl.google.com/android/repository/
from https://mirrors.cloud.tencent.com/AndroidSDK/ (might disappear)
Index of /AndroidSDK/
../
extras/ 10-May-2016 22:13 -
glass/ 10-Apr-2020 23:54 -
sys-img/ 27-Jul-2017 18:38 -
03e20ef07acac3ecac0790dfa946abd98e31bf7e.platfo..> 07-May-2020 00:02 9315273
@rofl0r
rofl0r / bcb6.md
Last active February 3, 2023 07:38
working download location of html help workshop 1.3
http://web.archive.org/web/20160301111642/https://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe
$ sha256sum htmlhelp.exe
b2b3140d42a818870c1ab13c1c7b8d4536f22bd994fa90aade89729a6009a3ae htmlhelp.exe
m$ seems to be in the business of removing downloads not targeting their latest operating systems...
@rofl0r
rofl0r / sleep.c
Created March 13, 2012 03:04
gnu compatible sleep tool.
#define _POSIX_C_SOURCE 200809L
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
int main(int argc, char** argv) {
int i;
char* end;
int times;
for(i = 1; i < argc; i++) {
@rofl0r
rofl0r / mkcabundle.pl
Created April 10, 2012 01:15
SSL certificate download script
#!/usr/bin/perl -w
#
# Used to regenerate ca-bundle.crt from the Mozilla certdata.txt.
# Run as ./mkcabundle.pl > ca-bundle.crt
#
my $cvsroot = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot';
my $certdata = 'mozilla/security/nss/lib/ckfw/builtins/certdata.txt';
open(IN, "cvs -d $cvsroot co -p $certdata|")
@rofl0r
rofl0r / ping.c
Created January 4, 2014 20:44
the modified ping tool from http://openwall.info/wiki/people/segoon/ping / http://mirrors.kernel.org/openwall/Owl/3.0-release/sources/Owl-3_0-stable/packages/iputils/iputils-ss020927.tar.gz with the no-suid patch applied and some build errors fixed, as a standalone C file. works, but has no ipv6 support.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <linux/sockios.h>
#include <sys/file.h>
#include <sys/time.h>
#include <signal.h>