Misc interesting projects

Misc interesting projects

  1. Great site for command line explanations: Explain Shell explainshell.com

dotfiles

About dotfiles:

Get latest release from GitHub / latest version

If you need the latest version of Gist follow the described URL pattern: permalink to the latest version of gist

Properly instal Golang

1
2
sudo apt install -y golang
go env

but sometimes you will need the latest version, that can be also done easily as, for Ubuntu, is officially described here

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang

Tool: jq is like sed for JSON data

Install JQ simply by typing:

sudo apt install -y jq

On Windows it’s easy as: scoop install jq

Eternal history file

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cat << EOF | sudo tee /etc/profile.d/eternal-history.sh
# set unlimited history
export HISTFILESIZE=
export HISTSIZE=

# add timestamp to history
export HISTTIMEFORMAT="%F %T » "

# use different file as sometimes .bash_history gets truncated
# http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login
export HISTFILE=~/.eternal_history

# Preserve bash history in multiple bash shells?

# remove duplicates
export HISTCONTROL=ignoredups:erasedups

# appending a on exiting session vs rewriting is turned on by default 
# shopt -s histappend

# force prompt to write history after every command.
# simplest version: after each command, append to the history file and reread it
# "-a" history to file, "-c" clears history, "-r" reads history from file
PROMPT_COMMAND="history -a; history -c; history -r"
EOF
date 01. Jan 0001 | modified 17. Jan 2023
filename: Linux » Dev Environment » Dump