Replacing the default FreeBSD system mailer Sendmail with Postfix using SMTP AUTH, acting as mail client
# pkg install postfix-sasl
1
Would you like to activate Postfix in /etc/mail/mailer.conf [n]? y2
# service sendmail stop
#!/usr/bin/env ruby -w | |
## Using ruby's standard OptionParser to get subcommand's in command line arguments | |
## Note you cannot do: opt.rb help command | |
## other options are commander, main, GLI, trollop... | |
# run it as | |
# ruby opt.rb --help | |
# ruby opt.rb foo --help | |
# ruby opt.rb foo -q | |
# etc |
#!/usr/bin/env bash | |
# Runs a command wrapped in btrfs snapper pre-post snapshots. | |
# Usage: $ snp <commands> | |
# e.g.: $ snp pacman -Syyu | |
# Requirements: snapper (https://wiki.archlinux.org/title/snapper) | |
# The latest version of this script is hosted at https://gist.github.com/erikw/5229436 | |
log_path="/var/local/log/snp" | |
date=$(date "+%Y-%m-%d-%H%M%S") | |
log_file="${log_path}/snp_${date}.log" |
extension AVAsset { | |
func videoOrientation() -> (orientation: UIInterfaceOrientation, device: AVCaptureDevicePosition) { | |
var orientation: UIInterfaceOrientation = .Unknown | |
var device: AVCaptureDevicePosition = .Unspecified | |
let tracks :[AVAssetTrack] = self.tracksWithMediaType(AVMediaTypeVideo) | |
if let videoTrack = tracks.first { | |
let t = videoTrack.preferredTransform |
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"' |
MOVED TO ⮕ https://github.com/erikw/restic-automatic-backup-scheduler |
#!/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)" |
#!/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 |
" 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 |