Skip to content

Instantly share code, notes, and snippets.

@m-radzikowski
m-radzikowski / script-template.sh
Last active August 18, 2024 12:49
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@IanColdwater
IanColdwater / twittermute.txt
Last active September 2, 2024 06:19
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@TapeWerm
TapeWerm / Bash Advice.md
Last active September 2, 2024 06:12
Bash Advice.md - I don't know everything, but here's the best takeaways from me thus far

I don't know everything, but here's the best takeaways from me thus far

This is my altar to everything that can and will go wrong in bash

Tips

  • Alias frequent commands in your .bashrc. Do not echo in your .bashrc, it breaks SFTP and other programs. Try /etc/motd for welcome messages instead. ^_^
  • if [ -z "$SSH_AGENT_PID" ]; then eval "$(ssh-agent)"; fi; ssh-add $key to avoid retyping your SSH key's password.
  • Learn regex at https://regexr.com. Bash uses globbing but some commands use regex. See also: Special Characters
  • Learn vim and add colo murphy to your .vimrc. Murphy is the most readable color scheme to me. set (no)number and set (no)hlsearch are also useful.
  • man -f $cmd [...] lists short descriptions of several commands.
  • less +G $file opens $file at the bottom.
@finchd
finchd / .vimrc
Last active March 3, 2023 20:29
.vimrc
set nocompatible
" because we don't need vi compatibility, and want our backspace key to work
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
" because we want the defaults, until we don't
" install vim-plug first https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
@QuinnyPig
QuinnyPig / buildspec.yml
Last active October 16, 2018 04:43
The buildspec.yml that deploys Last Week in AWS.
version: 0.2
phases:
install:
commands:
- echo Entered the install phase...
- pip install -r requirements.txt
build:
commands:
- echo Entered the build phase...
@finchd
finchd / Dockerfile-notes.md
Created April 20, 2018 00:07
Every allowed Dockerfile VERB

Dockerfile

FROM #must be first line, can have 2+ though?

MAINTAINER <foo@bar.com>

USER

WORKDIR

@finchd
finchd / .bashrc
Last active April 7, 2019 01:58
public bashrc snippets
## from CoffeeOps Slack Rob Evans
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=100000
HISTFILESIZE=200000
@jessfraz
jessfraz / boxstarter.ps1
Last active July 7, 2024 22:46
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@finchd
finchd / .tmux.conf
Last active July 13, 2022 04:06
.tmux.conf
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
# count windows from one; this means there is no zero
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."