Skip to content

Instantly share code, notes, and snippets.

View reikoNeko's full-sized avatar

Rachel Rawlings reikoNeko

View GitHub Profile
@reikoNeko
reikoNeko / stations.py
Created January 19, 2021 20:23
Dump radio stations from Rhythmbox to a list
import xmltodict
import pprint
with open('.local/share/rhythmbox/rhythmdb.xml') as F:
rhythmdb = xmltodict.parse(F.read())
stations = sorted( [(E['title'], E['location']) for E in rhythmdb['rhythmdb']['entry'] if E['@type'] == 'iradio'] )
pp = pprint.PrettyPrinter(width=240)
pp.pprint(stations)
@reikoNeko
reikoNeko / wp_multisite_hints.txt
Created October 26, 2020 16:18
WP-CLI commands for multisite installations
#### Comment Spam prevention
# Disable comments on all blogs
site_list=`wp site list | cut -f 1 | grep -v blog`
for U in $site_list; do wp db query "update wp_${U}_options set option_value='closed' where option_name='default_comment_status';" ; done
for U in $site_list; do wp db query "update wp_${U}_options set option_value=0 where option_name='close_comments_days_old';" ; done
@reikoNeko
reikoNeko / CyberThreatHunting_links.txt
Created April 4, 2020 19:13
Links and acronym expansion from John Strand's "Cyber Threat Hunting" presentation
@reikoNeko
reikoNeko / build_capteha_images.md
Last active December 16, 2019 14:38
We need moar candy canes!?

Need more images from the Frido Sleigh CAPTEHA? Just want to test your training and categorization?

  • Open the site in a Chrome browser and open the developer tools
  • Log all the images through multiple runs of the CAPTEHA
  • Capture images into a .har archive -- It's just json, and the request strings include the full image in base64 mode.
  • Run the attached script to convert the images from the .har file to .png

Then run Chris Davis's scripts from https://github.com/chrisjd20/img_rec_tf_ml_demo to categorize your images!

import networkx as nx
universe = nx.DiGraph()
for line in progdata:
# use elements in list directly, rather than placeholders
universe.add_edge(*line.split(')') )
paths = dict(nx.all_pairs_shortest_path_length(universe))
center = list(nx.topological_sort(universe))[0]
print(center)
@reikoNeko
reikoNeko / README.md
Last active December 2, 2019 01:22
AoC2019_01
@reikoNeko
reikoNeko / hexstring.py
Created August 21, 2019 17:44
Assemble a human readable string from hexadecimal ascii
def hexstring(s):
return [ chr(int(x,16))for x in map(''.join, zip(*[iter(s)]*2)) ]
dmprg = ''.join(hexstring("7777772e796f75747562652e636f6d2f77617463683f763d5a79614b336a6f34536c34"))
@reikoNeko
reikoNeko / gist:236023a7c2d7f160ef6c0170306319d0
Last active August 21, 2019 14:45
base64 decode ALL the things
Just in case you thought that CTF skills aren't useful in the real world,
the WPRB stream changed recently, breaking my saved bookmark in Rhythmbox.
On the station's web page, there was a popup player, but not a direct URL
for desktop players anymore. What's a Linux geek to do?
view-source:http://wprb.com/popup-player/
Where we find the configuration string
P3jPLAYLISTS.inline_0 = [
sleep $((`date -d 2115 +%s` - `date +%s`)) && echo 'dowatchalike'
@reikoNeko
reikoNeko / massrenumber.sh
Created March 27, 2018 19:02
Renumber a batch of users' uids and gids, and fix file ownerships
#!/bin/bash
while IFS="," read -r name olduid oldgid newuid newgid
do
/usr/sbin/groupmod $name -g $newgid
/usr/sbin/usermod $name -u $newuid -g $newgid
/bin/chown --changes --silent --no-dereference --recursive \
--from=:$oldgid :$name /home/$name
done << END
tinker,8001,8001,701,701