Skip to content

Instantly share code, notes, and snippets.

View rkevin-arch's full-sized avatar

Kevin R rkevin-arch

View GitHub Profile
@rkevin-arch
rkevin-arch / README.md
Last active March 12, 2022 11:26
OneShot Refuge Factory Puzzle Writeup

OneShot Refuge Factory Puzzle Writeup

The problem

If you have not played OneShot yet, go do that RIGHT NOW. It's available on Steam and itch.io, and it's one of my favorite games of all time.

This puzzle appears in the Factory in the Refuge, and is a variant of the game Mastermind. You have 5 lights that you can toggle to either orange, blue, green or red. There's a correct pattern of 5 colors that you're supposed to guess. After you set each light, you can pull a lever, and it will tell you how many lights you got correct. You get 10 attempts before the puzzle resets itself. Depending on the pattern, it can be quite easy or fairly tricky to guess the right pattern.

image ![image](https://user-images.githubusercontent.c

@rkevin-arch
rkevin-arch / docker-retag.sh
Last active November 6, 2020 22:12
Retagging docker images without pulling them. Kinda ugly hack, but it works. Requires curl and jq.
#!/bin/bash -e
OLDREPO=youruser/oldrepo
OLDTAG=oldtag
NEWREPO=youruser/newrepo
NEWTAG=newtag
USERPASS='youruser:yourpassword'
TOKEN=`curl -f "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$NEWREPO:push,pull&scope=repository:$OLDREPO:pull" -u "$USERPASS" | jq -r .token`
OLDMANIFEST=`curl -f https://index.docker.io/v2/$OLDREPO/manifests/$OLDTAG -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -H "Authorization: Bearer $TOKEN"`
NEWMANIFEST=`echo "$OLDMANIFEST" | jq "setpath([\"name\"];\"$NEWREPO\")" | jq --indent 3 "setpath([\"tag\"];\"$NEWTAG\")"`
@rkevin-arch
rkevin-arch / simple_cache_side_channel.c
Last active June 8, 2020 07:13
Simple cache side channel attack, using a mixture of EVICT+TIME and the CLFLUSH instruction (FLUSH+TIME?)
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#define SECRET 34
#define MAXSECRET 64
char table[MAXSECRET*64];
void secretfunction(void){
char value=table[SECRET*64];

Keybase proof

I hereby claim:

  • I am rkevin-arch on github.
  • I am rkevin (https://keybase.io/rkevin) on keybase.
  • I have a public key ASDKtuaVaooUkQby3XmRhZq4XtQdOWXO1wvaXiiQYbYP8Qo

To claim this, I am signing this object:

@rkevin-arch
rkevin-arch / AffineEncryptionTest.py
Created May 3, 2018 10:36
Quick demo of the Affine encryption process using the manim engine
#!/usr/bin/env python
from big_ol_pile_of_manim_imports import *
import math
import fractions
# Quick demo of the Affine encryption process, using c=3*p+7
# Of course, this entire animation relies on 3Blue1Brown's manim engine
# https://github.com/3b1b/manim
# A lot of code is copied from Solara570's projects