Gabriel Staples
https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles
Done and works. I use this daily on all of my Linux computers, including for my family and young kids.
I think it takes 8 to 15 years to get out of the slump at the bottom and start heading upwards on the right:
Artist's depiction of the Dunning-Kruger effect:
Source: I first saw this exact image (not the concept, but this particular image) on @user3666197's Stack Overflow profile here. I don't know where they got it from.
This project started out as just a few helpful nuggets I like to put in my ~/.bashrc
file, for example, as well as some scripts and other configuration files, but I decided to make it a place I put all sorts of reference scripts, files, shortcuts, Linux tips & tricks, Eclipse documentation, etc, I've built up over the years.
(including tracked binary files, such as PDFs)
This repo contains Git Submodules, which simply means that this is a git repo which contains other git repos. It also uses git lfs
(Large File Storage) to more-efficiently store certain binary files, such as PDFs.
git submodule
s
= git submodules: =
section of my "git & Linux cmds doc" notes in my eRCaGuy_dotfiles repo here: eRCaGuy_dotfiles/git & Linux cmds, help, tips & tricks - Gabriel.txt.git submodule
documentation: https://git-scm.com/book/en/v2/Git-Tools-Submodulesgit submodule
notes below were originally copied from my eRCaGuy_hello_world repo here._git lfs
***** https://git-lfs.github.com/ (new link: https://git-lfs.com/) - how to begin tracking files, such as PDF files, with git lfs
:
git lfs status
# list all `git lfs`-tracked files
git lfs ls-files
# see if `git lfs` is installed, and which file types it is tracking
cat .gitattributes
git lfs install
git lfs track "*.pdf"
git lfs track "*.PDF"
git add .gitattributes
git add *.pdf # add all *.pdf files
git add *.PDF # add all *.PDF files
git add -A # (optional) add ALL (`-A`) files
# Check LFS status; useful after `git add`--see here:
# https://stackoverflow.com/a/54452098/4561887
# - Look for `-> LFS:` markers to indicate a file will be getting backed up via Git LFS
# rather than via regular Git. Ex:
#
# # this file will be backed up by Git LFS
# linux/systemd-by-example-book_GS_edit.pdf (Git: 0ef9976 -> LFS: 0ef9976)
# # but this file will be backed up by regular Git
# linux/systemd-by-example-book_GS_edit.pdf (Git: 0ef9976 -> File: 774ea46)
#
git lfs status
# list all `git lfs`-tracked files--ie: files which will be or are backed up by Git LFS
git lfs ls-files
# See if `git lfs` is installed, and which file types it is tracking
# - Sample output if `git lfs` is tracking all *.pdf and *.PDF files:
#
# *.pdf filter=lfs diff=lfs merge=lfs -text
# *.PDF filter=lfs diff=lfs merge=lfs -text
#
cat .gitattributes
git commit -m "Begin tracking PDF files with 'git lfs'"
git lfs
notes: How to use git lfs
as a basic user: this covers the question: "What is the difference between git lfs fetch
, git lfs fetch --all
, git lfs pull
, and git lfs checkout
?"git lfs
correctly?-size +10k
)".find . -not \( -path "./.git" -type d -prune \) \
-type f -size +10k -printf '%s\t%p\n' \
| awk '{printf("%13.6f kiB ", $1/(1024)); \
for (i=2; i<NF; i++) printf("%s ", $i); printf("%s\n", $NF)}' \
| sort -rn \
| awk '{print($NF)}' \
| sed 's/.*\///' | grep -oE "(^[^.]*$|\.[^0-9]*[\.]?[^0-9]*$)" | sort -u
git lfs
Large File Storage files......you must do the following:
# Clone this repo
git clone https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles.git
# cd into the freshly-cloned repo
cd eRCaGuy_dotfiles
# Pull all Git LFS files (large binary files, such as PDFs, tracked with `git lfs`)
git lfs pull
# Recursively clone and update all subrepos (git submodules) it may contain
git submodule update --init --recursive
See especially my answer here: How to update all git submodules in a repo (two ways to do two very different things!):
# 1. Update the outer repo by pulling the latest from upstream
# 1.A. Regular `git pull`
git pull
# 1.B. Also pull LFS (Large File Storage) files; see my answer:
# https://stackoverflow.com/a/72610495/4561887
git lfs pull
# 2. Then, update the subrepos (two ways to do two *very different* things!):
# 2.A. Pull subrepo changes
# Option 1: AS A **USER** OF THE OUTER REPO, pull the latest changes of the
# sub-repos as previously specified (pointed to as commit hashes) by developers
# of this outer repo.
# - This recursively updates all git submodules to their commit hash pointers as
# currently committed in the outer repo.
git submodule update --init --recursive
# Option 2. AS A **DEVELOPER** OF THE OUTER REPO, update all subrepos to force
# them each to pull the latest changes from their respective upstreams (ex: via
# `git pull origin main` or `git pull origin master`, or similar, for each
# sub-repo).
git submodule update --init --recursive --remote
# 2.B. now add and commit these subrepo changes
git add -A
git commit -m "Update all subrepos to their latest upstream changes"
# General format
git submodule add URL_to_repo
# or
git submodule add URL_to_repo path/to/where/you/want/to/put/it
# Examples:
git submodule add https://github.com/ElectricRCAircraftGuy/ripgrep_replace.git
git submodule add https://gitlab.com/ElectricRCAircraftGuy/systemd-by-example.git
# etc.
gdb
, bazel
, various command-line tools, build tools, etc.
git diffn
drop-in-replacement program to show git diff
with line 'n'umbers. As a thin awk
-language-based wrapper around git diff
it supports ALL options and features that git diff
does! Learn how to install and use it here. Screenshot:
git blametool
. See: useful_scripts/README.md.
git branch_
. Same as git branch
except don't show "hidden", user-backed-up branches. See my answer here: Hide but still save a branch with GIT?gs_ssh
alias which automatically sources a custom .bashrc
file in your ssh environment whenever you log in!ls
aliases such as ll
, la
, & l
PS1
) modifications to add terminal titles, current git branch name checked out [VERY USEFUL FEATURE!], bash shell level, etc
git lg
alias, etcrgr
(useful_scripts/rg_replace.sh). This is a wrapper around Ripgrep to give it a find-and-replace feature to replace contents on your disk.Update 18 Sept. 2022: The installation script isn't kept up-to-date at all really. However, pretty much every single file in this entire repo has detailed, stand-alone installation instructions for it in the comments at the top of it. So, just follow those instead, for within each individual file you'd like to use or install.
Note: the installation script isn't kept up-to-date very well. It falls behind frequently as I add new features and useful scripts, then I periodically have to update it again. So, it's not a bad idea to run this installation command anyway, to let it install whatever it can, but then still _manually look into the useful_scripts folder, the home folder, and elsewhere, for other scripts or tools in this repo which this install script doesn't yet install_.
To run the install script for this _eRCaGuydotfiles project:
./install_all.sh
Edit this script first if customization is desired. It's all interactive, however, so it won't overwrite anything without your permission.
However, it's still a good idea to back up your home directory first before running the installation script and to: 1) read the installation prompts carefully as it asks you to for permission to overwrite something, and 2) make sure you back any of those files it's prompting you about before allowing it to overwrite them.
Additionally:
Good applications to install right after you install Linux.
See: useful_apps/README.md.
Here is a list of all of the scripts provided in the "useful_scripts" directory. Some of these are so amazingly useful to me, and powerful, they deserve a section all on their own!
Therefore, I have created an additional readme to describe a few of these scripts in greater detail here: useful_scripts/README.md.
Here is a list of some select scripts which I find especially useful, in a rough order of which ones I use most first:
(tree generated w/tree eRCaGuy_dotfiles/useful_scripts
):
eRCaGuy_dotfiles$ tree useful_scripts/
useful_scripts/
├── apt-cacher-server_proxy.sh
├── apt-cacher-server_proxy_status.sh
├── apt-cacher-server_proxy_toggle.sh
├── chm2html.py
├── desktop_file_install.sh -> ../Desktop_launchers/desktop_file_install.sh
├── desktop_file_uninstall.sh -> ../Desktop_launchers/desktop_file_uninstall.sh
├── find_and_replace.sh
├── find_and_replace_test_folder
│ ├── readme.md
│ ├── test1.cpp
│ ├── test1.txt
│ ├── test2.cpp
│ ├── test2.txt
│ └── test3.txt
├── git-blametool.sh
├── git-branch_.sh
├── git-changes.sh
├── git-diffc.sh
├── git-diffn_screenshot_cropped.png
├── git-diffn_screenshot.png
├── git-diffn.sh
├── git-disable-all-repos_test_subrepo
│ └── test_repo
│ ├── new text file (another copy).txt
│ ├── new text file (copy).txt
│ └── new text file.txt
├── git-disable-repos.sh
├── git-filechange-search.sh
├── git-tree.txt
├── install_all.sh -> ../install_all.sh
├── Link to ElectricRCAircraftGuy - Chrome-Case-Sensitive-Find A case-sensitive Find tool (recommended to use Ctrl + Alt + F) for the Google Chrome Browser.desktop
├── Link to ElectricRCAircraftGuy - eRCaGuy_PyTerm A datalogging serial terminal-console written in Python (I hope to extend it to Telnet and others later).desktop
├── Link to ElectricRCAircraftGuy - git-tree New git features 1) graphically view all your branches in a hierarchical fashion based on forking or desired dependencies; 2) cascade recursive rebases down the line.desktop
├── Link to ElectricRCAircraftGuy - PDF2SearchablePDF `pdf2searchablepdf input.pdf` = voila! ''input_searchable.pdf'' is created & now has searchable text!.desktop
├── open_programming_tools.sh
├── ping_loop.sh
├── README_git-diffn.md
├── README_git-sync_repo_from_pc1_to_pc2.md
├── README.md
├── README_ros_readbagfile.md
├── rgf.sh
├── rgr -> rg_replace.sh
├── rg_replace.sh
├── ros_readbagfile.py
├── ros_readbagfile_sample_output
│ ├── README.md
│ └── topics.yaml
├── scratch_work
│ └── gawk_git_diff_with_line_numbers.sh
├── sublf.sh
├── sync_git_repo_from_pc1_to_pc2--notes.md
├── sync_git_repo_from_pc1_to_pc2.sh
├── tmux-session.sh
├── touchpad_toggle.sh
└── wip
├── git-logn.sh
└── !GS note--wip = "work in progress".txt
6 directories, 51 files
Install speedtest
by Ookla:
wget
line below. Here, I show it for the x86_64
(64-bit processor) option.# Tested in Ubuntu 18.04
mkdir -p ~/Downloads/Install_Files/speedtest--ookla
cd ~/Downloads/Install_Files/speedtest--ookla
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.1.1-linux-x86_64.tgz
FILENAME="ookla-speedtest-1.1.1-linux-x86_64.tgz"
# strip off extension to derive the dirname; see: https://stackoverflow.com/a/965072/4561887
DIRNAME="${FILENAME%.*}"
mkdir -p "$DIRNAME"
tar -xvzf "$FILENAME" --directory="$DIRNAME"
cd "$DIRNAME"
mkdir -p ~/bin
ln -si "$(pwd)/speedtest" ~/bin/speedtest
# log out and log back in now if this is the first time you've created and used the
# ~/bin dir, as this will automatically add it to your $PATH variable in Ubuntu.
# Otherwise, `speedtest` is ready to use immediately.
speedtest
as shown above, a markdown readme for it is found in ~/Downloads/Install_Files/speedtest--ookla/ookla-speedtest-1.1.1-linux-x86_64/speedtest.md
.This repo contains my own content and opinions and does not reflect opinions nor content on behalf of any employer.