Skip to content

Instantly share code, notes, and snippets.

View tkoz0's full-sized avatar

TKoz[0] tkoz0

View GitHub Profile
@tkoz0
tkoz0 / oeis-bfiles-dl.sh
Created March 29, 2021 09:06
Download OEIS B files
#!/bin/bash
# pass number of threads as $1
# runs prefix3-dl.sh with several prefixes simultaneously
seq -f '%03g' 0 999 | xargs -I {} -n 1 -P $1 ./prefix3-dl.sh {}
# as of writing this, the 999 can be changed to 342
# that will increase over time as more sequences are added
@tkoz0
tkoz0 / .vimrc
Created March 29, 2021 09:11
The .vimrc file I have been using with VIM for a while
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set cc=81
set number
set cursorline
@tkoz0
tkoz0 / top95
Created March 29, 2021 09:16
A list of sudoku puzzles I found somewhere
4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......
52...6.........7.13...........4..8..6......5...........418.........3..2...87.....
6.....8.3.4.7.................5.4.7.3..2.....1.6.......2.....5.....8.6......1....
48.3............71.2.......7.5....6....2..8.............1.76...3.....4......5....
....14....3....2...7..........9...3.6.1.............8.2.....1.4....5.6.....7.8...
......52..8.4......3...9...5.1...6..2..7........3.....6...1..........7.4.......3.
6.2.5.........3.4..........43...8....1....2........7..5..27...........81...6.....
.524.........7.1..............8.2...3.....6...9.5.....1.6.3...........897........
6.2.5.........4.3..........43...8....1....2........7..5..27...........81...6.....
.923.........8.1...........1.7.4...........658.........6.5.2...4.....7.....9.....
@tkoz0
tkoz0 / uva-online-judge-pdfs.py
Created March 29, 2021 11:05
Something I wrote a long time ago for downloading problem PDFs from uva.onlinejudge.org
import os
url_base = 'https://uva.onlinejudge.org/external/'
volumes = list(range(1,1+17)) + list(range(100,1+133))
for volume in volumes:
os.system('mkdir %d'%volume)
os.chdir('%d'%volume)
for problem in range(100):
@tkoz0
tkoz0 / secure-erase-ssd.sh
Created March 29, 2021 11:17
Commands to securely erase a SSD. Based on some article, may have issues with SSD being locked/frozen
#!/bin/bash
# $1 = ssd block device (such as /dev/sda)
sudo hdparm -I $1
sudo hdparm --user-master u --security-set-pass p $1
sudo hdparm --user-master u --security-erase p $1
@tkoz0
tkoz0 / bigtext.py
Created March 29, 2021 11:21
Some dumb thing I wrote a long time ago to copy and paste discord messages written in emoji
import sys
map_ = dict()
for c in 'abcdefghijklmnopqrstuvwxyz':
map_[c] = ':regional_indicator_'+c+':'
map_['0'] = ':zero:'
map_['1'] = ':one:'
map_['2'] = ':two:'
map_['3'] = ':three:'
map_['4'] = ':four:'
@tkoz0
tkoz0 / assclass-s2-12.py
Created March 29, 2021 11:31
Program to get empirical evidence for the solution to the problem in assclass s2 episode 12
# the problem is in Ansatsu Kyoushitsu (Assassination Classroom) season 2 episode 12
# the answer is 1/2 * a^3
from math import sqrt
from random import random
# corner points for a square and cube (+/- 1 in each dimension)
SQP = [(1,1),(1,-1),(-1,1),(-1,-1)]
CBP = [(1,1,1),(1,1,-1),(1,-1,1),(1,-1,-1),(-1,1,1),(-1,1,-1),(-1,-1,1),(-1,-1,-1)]
@tkoz0
tkoz0 / notes.txt
Last active April 15, 2021 22:11
Small dumb things for AMQ related data
-- Getting the song list JSON from expand library --
1. Go to AMQ page
2. Open developer menu (F12 in firefox) network tab
3. Log in
4. Set anime list(s)
5. Open expand library and wait for it to load
6. Filter network tab to WS (websocket)
7. Click on the websocket connection
8. Open the response tab on the right
@tkoz0
tkoz0 / passwords.txt
Created April 15, 2021 02:13
FRC game manual passwords I had sitting around in some text file
2005: 3XTr1pl3play2oo5
2006: S1x240JrTBmsqf95DL06FdsTM33H
2007: 7sBg8H4x2f3R9C3tm5
2008: Drive!Straight?Turn!Left
2009: 1GiantLeap4FRC
2010: Breakaway4FRC!
2011: 5Time4For3Robots2To1Dance!
2012: HotShots!KnowBalance!
2013: sAucersFlyRobotsClimb!
2014: 3Zones2Goals1Alliance!
@tkoz0
tkoz0 / args.c
Created April 17, 2021 20:29
C program for printing command line args / arguments
#include <stdio.h>
int main(int argc, char **argv)
{
for (int i = 0; i < argc; ++i)
printf("argv[%d] = %s\n",i,argv[i]);
}