Skip to content

Instantly share code, notes, and snippets.

View webern's full-sized avatar

Matthew James Briggs webern

View GitHub Profile
@webern
webern / chmod.md
Last active July 6, 2023 19:42
chmod
  • 755 - Owner: Everything, Group: Read+Execute, World: Read+Execute
  • 644 - Owner: Read+Write, Group: Read, World: Read

Octal Value

File Permissions Set

Permissions Description

rm -fr .cargo
sudo rm -fr .gomodcache
find packages/ -name '*.tar.gz' -delete
find packages/ -name '*.rpm' -delete
cargo make clean

You may also want to nuke docker from orbit

This guide assumes that you have already set up a Ubiquiti Unifi VPN following the guide:
https://help.ubnt.com/hc/en-us/articles/115005445768-UniFi-L2TP-Remote-Access-VPN-with-USG-as-RADIUS-Server
To configure a Linux machine to be able to connect remotely I followed these steps. This guide was written for Debian 8.
- In Debian install the "xl2tpd" and "strongswan" packages.
- Edit /etc/ipsec.conf to add the connection:
conn YOURVPNCONNECTIONNAME

SublimeText

Linux Paths

  • Key Bindings: $HOME/.config/sublime-text/Packages/User/Default (Linux).sublime-keymap
  • Settings: $HOME/.config/sublime-text/Packages/User/Preferences.sublime-settings
  • Syntax-Specific (e.g. for Plain Text): $HOME/.config/sublime-text/Packages/User/Plain text.sublime-settings

Package Settings: $HOME/.config/sublime-text/Packages/User/Package Control.sublime-settings

@webern
webern / AuthoHotKeyList.txt
Created December 30, 2021 04:13 — forked from csharpforevermore/AuthoHotKeyList.txt
AutoHotKey Key List
Key Name Resulting Keystroke
{F1} - {F24} Function keys. For example: {F12} is the F12 key.
{!} !
{#} #
{+} +
{^} ^
{{} {
{}} }
{Enter} ENTER key on the main keyboard
{Escape} or {Esc} ESCAPE

Fedora

Setup a Separate Boot Device

device=/dev/sda
sudo wipefs --all $device
sudo dd if=/dev/zero of=$device bs=102400 count=2000
sudo parted $device --script mklabel gpt
sudo parted --script $device mkpart --align optimal efi fat32 4MiB 1GiB

Copy from another host

SOURCE_HOST=somehost
SOURCE_HOST_USERNAME=mjb
SOURCE_FILEPATH=/some/path
DESTINATION_FILEPATH=/local/path
scp $SOURCE_HOST_USERNAME@$SOURCE_HOST:$SOURCE_FILEPATH $LOCAL_FILEPATH
@webern
webern / custom-serde.rs
Created October 26, 2021 21:54 — forked from MightyPork/custom-serde.rs
example of custom serialize and deserialize in serde
use serde::ser::SerializeMap;
use serde::{Serialize, Serializer, de::Visitor, de::MapAccess, Deserialize, Deserializer};
use std::fmt;
#[derive(Debug)]
struct Custom(String, u32);
impl Serialize for Custom {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
@webern
webern / docker-commands.md
Last active March 8, 2023 21:35
Nuke Docker from Orbit

You can double-check the docker data directory with this, but I considered too dangerous to include in the rm -rf command.

docker info | grep 'Docker Root Dir' | grep -oE '/.*'

Nuke Docker from Orbit

@webern
webern / init_logger.rs
Last active May 21, 2021 23:07
Initializing Rust env_logger with the settings that I like
// colored = "2"
// chrono = "0"
// env_logger = "0"
// log = "0"
use colored::*;
use std::io::Write;
fn init_logger(default_level: LevelFilter) {
// extract the value of RUST_LOG if it exists