Skip to content

Instantly share code, notes, and snippets.

View erikw's full-sized avatar
💭
0b011111000110

Erik Westrup erikw

💭
0b011111000110
View GitHub Profile
@flaksp
flaksp / README.md
Last active May 4, 2024 16:07
Convert BitWarden JSON export file to Apple iCloud Keychain CSV import file saving TOTP and notes

BitWarden to Apple iCloud Keychain passwords converter

This Python scripts allows you to move your passwords from BitWarden to Apple iCloud.

You need to know:

  • It ignores secure notes, credit cards and other types that are not passwords.
  • It ignores BitWarden entries without usernames, passwords and URLs.
  • It also ignores URLs that do not start with http:// or https://.
  • It normalizes all TOTP tokens, e.g. wskg vtqa h5kl bhb4 v4v2 ybyo woc6 qme2 will be converted to otpauth://totp/example.com:dude@foo.bar?secret=WSKGVTQAH5KLBHB4V4V2YBYOWOC6QME2&issuer=example.com&algorithm=SHA1&digits=6&period=30.
@erikw
erikw / freebsd_install.sh
Last active May 12, 2022 21:54
A log of how I configured FreeBSD spring 2018 on my Intel NUC Dawson Canyon NUC7i3DNH2
#!/usr/bin/env bash
# A log of how I configured FreeBSD spring 2018 on my Intel NUC Dawson Canyon NUC7i3DNH2E (NUC7i3DNH).
# Modeline {
# vi: foldmarker={,} foldmethod=marker foldlevel=0 tabstop=4
# }
# Links {
# FreeBSD vs Linux:
# http://www.over-yonder.net/~fullermd/rants/bsd4linux/01
@erikw
erikw / ..git-commit-status - Generate git commit message from git-status.md
Last active March 13, 2024 07:44
Generate git commit message from git-status. Will generate a commit message like "Added: file1.py file2.py file3.py Modified: file4.py file5.py Deleted: README.md Renamed: test.txt-> test2.txt". Put this in your .gitconfig.

git commit-status alias

An alias that will generate a git commit message staged changes as shown in git-status. Put this alias (section below) in your .gitconfig.

The message generated will be in the format of:

$ git status --porcelain
A file1.py
A file2.py
A file3.py
@erikw
erikw / unimpaired-delete.vim
Last active October 17, 2021 14:06
vim-unimpaired extended with delete ([d and ]d)
" Extend vim-unimpaired with ]d and [d to delete above and below the current line.
" See https://github.com/tpope/vim-unimpaired/issues/157
"
" Installation: put this file in
" - vim: $HOME/.vim/plugin/
" - neovim: $XDG_CONFIG_HOME/nvim/plugin/
function! s:DeleteUp(count) abort
normal! m`
normal ix
@erikw
erikw / znp
Last active March 2, 2024 17:43
znp: Wrap shell command in ZFS pre-post snapshots and log outputs.
#!/usr/bin/env bash
# Runs a command wrapped in ZFS pre-post snapshots. The whole data pool is recursively snapshotted.
# Analogous to my snp script for BTRFS: https://gist.github.com/erikw/5229436
# Usage: $ znp <commands>
# e.g.: $ znp pgk upgrade
# e.g.: $ znp portmaster -aG
# e.g.: $ znp freebsd-upgrade install
zfs_pool=zroot
@erikw
erikw / brew_ugprade.sh
Last active March 26, 2018 08:19
brew_upgrade.sh: interactively upgrade all local brew & cask packages for macOS
#!/usr/bin/env bash
# Interactively upgrade my homebrew system.
# Usage: brew_upgrade.sh
# Requirements:
# - Install cask upgrade command with: $ brew tap buo/cask-upgrade
# Exit script on SIGINT.
set -e
CLI_PREFIX="📦$(tput setaf 1) ======>$(tput sgr0)"
MOVED TO ⮕ https://github.com/erikw/restic-automatic-backup-scheduler
@ldez
ldez / gmail-github-filters.md
Last active April 3, 2024 11:53
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@jpalmieri
jpalmieri / gist:cb6271004127633a133e9606ddba58b1
Last active July 4, 2021 13:17
git alias to prepend last commit message with '[skip ci]' (to skip a travis build)
git config --global alias.skip-ci '!git reset && COMMIT_MSG=`git show --format=format:%B -s` && git commit --allow-empty --amend -m "[skip ci] $COMMIT_MSG"'
@moisseev
moisseev / Postfix-SASL-client.md
Last active October 28, 2022 09:15
Replacing the default FreeBSD system mailer Sendmail with Postfix using SMTP AUTH, acting as mail client

Replacing the default FreeBSD system mailer Sendmail with Postfix using SMTP AUTH, acting as mail client

Replacing Sendmail with Postfix

# pkg install postfix-sasl1

Would you like to activate Postfix in /etc/mail/mailer.conf [n]? y2

# service sendmail stop