Skip to content

Instantly share code, notes, and snippets.

View slackingfred's full-sized avatar

Chang Qian (Fred) slackingfred

View GitHub Profile
@slackingfred
slackingfred / useraddx.sh
Created January 27, 2023 05:24
Create new user $1 with authorized pubkey file $2
#!/bin/bash
# 2014-02-26 custom script for adding user on servers.
# Ubuntu servers were not shipped with `adduser` back then.
# For newer versions of Ubuntu, use `adduser` instead.
sudo su
useradd $1
passwd $1
cd /home
mkdir $1
cd $1
@slackingfred
slackingfred / CreateLargeFileNonSparse.cmd
Created January 3, 2024 08:32
Quickly create large non-sparse NTFS file for use of virtual machine disk image
@echo off
REM Administrator privilege required
fsutil FILE createNew "%1" "%2"
fsutil FILE setValidData "%1" "%2"

List of go module knobs for controlling CI, vendoring, and when go commands access the network

By default, a command like go build ignores the vendor directory and will reach out to the network as needed to satisfy imports.

Some teams will not want the go tooling to touch the network in CI, whereas other teams might want greater control during day-to-day work regarding when the go tooling updates go.mod, how dependencies are obtained, and how vendoring is used.

This list is an attempt to build a more consolidated enumeration of some of the primary knobs and options that people might use to adapt the default Go behavior to better suite their particular use cases. Most of this information is currently spread throughout different sections of the official documentation or modules wiki.

The intent of this list is to help socialize the existence of these knobs, without giving all the detai

@slackingfred
slackingfred / format.sh
Created June 20, 2024 21:09
Initialize ephemeral storage of certain AWS EC2 instance types
#!/bin/bash
mkdir -p /data
mkfs.btrfs -d single -m single /dev/nvme1n1
mount /dev/nvme1n1 /data
chmod 777 /data