Skip to content

Instantly share code, notes, and snippets.

@carepack
carepack / istats.py
Created October 1, 2020 15:38 — forked from M4cs/istats.py
Getting iStats Widget
import os
import time
import subprocess
while True:
output = subprocess.check_output(['istats', 'cpu'])
output1 = subprocess.check_output(['istats', 'fan'])
output2 = subprocess.check_output(['istats', 'battery'])
new_output = '\n\n\n' + str(output.decode('utf-8')) + '\n' + str(output1.decode('utf-8')) + '\n' + str(output2.decode('utf-8'))
print(new_output.replace('For more stats run `istats extra` and follow the instructions.', ''))
@carepack
carepack / DefaultKeyBindings.dict
Created September 29, 2020 09:50 — forked from Jimbly/DefaultKeyBindings.dict
Mac OSX keybindings to more closely match Windows
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behavior on Windows systems.
You must log out and back in to see these changes.
Here is a rough cheatsheet for syntax.
Key Modifiers
^ : Ctrl
$ : Shift
@carepack
carepack / delete.sh
Created July 9, 2020 10:30 — forked from RLovelett/delete.sh
Delete ZFS snapshots from dataset one-liner
zfs list -r -H -t snapshot -o name stream/lxc/stash | xargs -n1 zfs destroy
@carepack
carepack / client.conf
Created April 2, 2020 16:24
Wireguard on FreeBSD with pf
[Interface]
PrivateKey = ***********************
Address = 192.168.10.2/32, fc::2/128
DNS = 1.1.1.1, 2606:4700:4700::1111
[Peer]
PublicKey = ***********************
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = endpoint.domain.tld:51820
@carepack
carepack / gist:a45c70272ae81ee2b29f763803b07fb1
Created March 27, 2020 08:36 — forked from alexkay/gist:2566869
Mirrored encrypted FreeBSD install
# Start with the setup normally, then select "Shell" at the partitioning step.
# Check device names
camcontrol devlist
# Create a gpt and a bootstrap partition
gpart destroy -F ada0
gpart create -s gpt ada0
gpart add -a 4k -t freebsd-boot -s 64k ada0
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
@carepack
carepack / tmux.md
Created March 27, 2020 08:21 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@carepack
carepack / tmux.md
Created March 27, 2020 08:21 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@carepack
carepack / tmux.md
Created March 27, 2020 08:21 — forked from bdlangton/tmux.md
Tmux Commands

NOTE: All commands that start with tmux can be executed within a tmux session by typing prefix, followed by :, then type the rest of the command (after tmux).

There is a binary script called tat that can be run and it will create a new session named after the directory that you are currently in. If a session with that name already exists, it will just open that session.

Sessions

Command Description
tmux new -s [session name] Start new named session
prefix s Choose a different session using fzf (custom mapping)
@carepack
carepack / tmux-cheats.md
Created March 26, 2020 09:53 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@carepack
carepack / tmux-cheatsheet.markdown
Created March 26, 2020 08:07 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname