Skip to content

Instantly share code, notes, and snippets.

@craSH
craSH / bulletproof_arch.md
Last active Jul 27, 2021 — forked from altercation/bulletproof_arch.txt
Bulletproof Arch - Minimal Clean Install
View bulletproof_arch.md

Bulletproof Arch

These are working notes on the installation of Arch Linux. I've just completed this install on a notebook (@altercation: Lenovo P50. @craSH: Dell XPS 13" 9380) but the setup should work for most laptop/desktop configurations.

Some assumptions/notes:

  1. This isn't a dual boot configuration. I can see some of the appeal and still work in Adobe from time to time, but given the increasing complexity of EFI and the way Windows/MS manhandles the EFI partition during upgrades, I really would recommend steering clear of dual boot. Just my two cents here.
View opnsense-test-inet6-default-route.sh
#!/bin/sh
# Test for presennce of default IPv6 route after applying interface settings
# with OPNsense API. Meant to be used with git bisect run across commits to
# find the bug discussed here:
# https://forum.opnsense.org/index.php?topic=20260.0
#
# Author: cdine / Ian Gallagher <crash@neg9.org> 2020-11
# Dev API keys for root user on this machine. Not really secret.
export key='cY1pLqJ2yhOvRlTJCdHFlzejshbebTgJ9iqNSA8ogKOGDeTUNO+MXQEyaDPw8AH415Byj4czYUJA1c2n'
@craSH
craSH / sekey-keygen
Created Jun 27, 2020
sekey-keygen - A helper script for generating SSH keys in the Macbook Pro's secure enclave with SeKey [https://github.com/sekey/sekey]
View sekey-keygen
#!/usr/bin/env bash
# vim: ft=bash
# A helper script for generating SSH keys in the Macbook Pro's secure enclave with SeKey [https://github.com/sekey/sekey]
# This file created by craSH [https://github.com/craSH]
# This work is licensed under a Creative Commons Attribution 4.0 International License [https://creativecommons.org/licenses/by/4.0/]
# Secure umask - dirs 700, files 600
umask 077
# Exit if sekey is not installed
@craSH
craSH / tc_to_kml.py
Created Mar 14, 2017
tripcreator-manipulator
View tc_to_kml.py
#!/usr/bin/env python
"""
Parse a TripCreator JSON file and emit a KML file.
Example: https://widgets.tripcreator.com/gas-stations-prices-iceland-map/tripcreator-gas-prices-iceland.json
Taken from the widget on this page: http://luxeadventuretraveler.com/tips-for-driving-icelands-ring-road-winter/
Copyleft 2017 Ian Gallagher <crash@neg9.org>
"""
import json
import os
@craSH
craSH / init-tunnels.sh
Last active Jun 3, 2016
Script to setup multiple SSH tunnels in a reliable way for use with FoxyProxy or other SOCKS-aware clients
View init-tunnels.sh
#!/usr/bin/env bash
#
# Use to setup numerous various tunnels to SSH servers, useful with ssh config blocks like those below
# for each host, with incrementing port numbers for each - then configure FoxyProxy etc to use the unique
# port for each host you want to tunnel out of.
#
# Thanks to tecknicaltom <tecknicaltom@neg9.org> for the initial idea behind tying this all together.
#
# Host host_alpha
# IdentityFile ~/.ssh/id_ecdsa-$USER-host_alpha-<remote_hostname>-<key_gen_year>-<key_gen_month>
@craSH
craSH / extract_offsets.py
Created Sep 3, 2015
Extract chunks between chunk sizes at a given list of offsets. Handy when combined with the output of hachoir-subfile for ELF images in a filesystem, for example.
View extract_offsets.py
#!/usr/bin/env python
"""
Extract chunks between chunk sizes at a given list of offsets.
Handy when combined with the output of hachoir-subfile for ELF images in a filesystem, for example.
Copyleft 2015 Ian Gallagher <crash@neg9.org>
"""
import sys
import os
import logging
@craSH
craSH / indexcode
Last active Aug 29, 2015
Index code with glimpse, ctags, and cscope. Store the indexes and such in a defined cache directory, which may live on a fast SSD
View indexcode
#!/usr/bin/env bash
# Original credit to tecknicaltom@neg9.org for creating this script and concept - thanks!
# Store indexes and such in a cache located on an SSD, and symlink to them
# Ensure the cache location is at the same or better security level (encrypted drive) as the data you are indexing.
cache_root="${HOME}/.indexcodecache"
cur_proj="$(basename -a ${PWD} | tr -d '\n')-$(echo ${PWD} | shasum -a 512 | cut -c 1-16)"
cache_dir="${cache_root}/${cur_proj}"
# Set umask to create files as mode 0600 (user r/w, go none)
View ssh-keygen-remove-all
#!/usr/bin/env bash
function ssh-keygen-remove-all() {
if [ -n $1 ]; then
ssh-keygen -R "$1" >/dev/null 2>&1 && \
echo "Removed complete hostname: $1"
simple_host=$(echo $1 | cut -d '.' -f1)
if [ -n "$simple_host" ]; then
ssh-keygen -R "$simple_host" >/dev/null 2>&1 && \
@craSH
craSH / natstrings.py
Last active Aug 29, 2015
Like strings(1) but only return stuff that is probably english (or whatever locale you set)
View natstrings.py
#!/usr/bin/env python
"""
Like strings(1) but only return stuff that is probably English (or whatever locale you set)
TODO:
* Add a parameter to ignore punctuation as token counts towards the threshold.
e.g. "Foo." vs "Foo........" would both return true.
* Add conditional for not counting digit only results if alphanumeric=True in is_natlang()
* Unicode support - currently it doesn't work with unicode, quite bad for non-english input
@craSH
craSH / diceware.py
Last active Apr 28, 2017
Select easy to use passphrases based on the diceware list; but not their selection methodology [lazy]
View diceware.py
#!/usr/bin/env python
"""
Select easy to use passphrases based on the diceware list; but not their selection methodology [lazy].
Place the diceware and beale wordlists (GPG signed is fine) in /usr/share/dict before use.
* Diceware list: http://world.std.com/~reinhold/diceware.wordlist.asc
* Alternative Beale list: http://world.std.com/~reinhold/beale.wordlist.asc
* EFF List (Large): https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt
* EFF List (Small): https://www.eff.org/files/2016/09/08/eff_short_wordlist_1.txt