• Stars
    star
    204
  • Rank 192,063 (Top 4 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

.bashrc file, terminal prompt that shows current git branch, Arduino setup, Eclipse setup, git diff with line numbers, helpful scripts, improved Linux productivity, etc.

Hits

>> Sponsor Me on GitHub <<

Gabriel Staples

  • These are my Linux Ubuntu configuration files and commonly-used scripts--most of which I've written myself.
  • This project is well-maintained, highly-used by myself, and highly-functional. It's not experimental, it's what I use every day. Feel free to use or borrow from it yourself.
  • Disclaimer: any content herein is my own unless stated otherwise. This repo contains my own beliefs, opinions, words and works. They are not endorsed by nor espoused by any of my past nor present employers.

Also very useful:

  1. My eRCaGuy_hello_world repo.
  2. useful_startup_programs.md

Table of Contents

(click to expand)
  1. Project: eRCaGuy_dotfiles
  2. Status:
  3. Description of contents
  4. Git submodules and Git LFS: how to clone this repo and all git submodules and git lfs files 1. References: 1. To clone this repo plus all sub-repos (git submodules) and all git lfs Large File Storage files... 1. To update this repo: 1. To add a repo as a submodule inside another repo:
  5. Here are some of the contents contained herein:
  6. Installation & Usage:
  7. Useful Applications
  8. Useful Scripts
    1. See useful_scripts/README.md
  9. Misc. Install Instructions:

Project: eRCaGuy_dotfiles

https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles

Status:

Done and works. I use this daily on all of my Linux computers, including for my family and young kids.

Description of contents

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.

Git submodules and Git LFS: how to clone this repo and all git submodules and git lfs files

(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.

References:

  1. git submodules
    1. [my answer] How to update all git submodules in a repo (two ways to do two very different things!)
    2. For more on git submodules, see the = 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.
    3. Official git submodule documentation: https://git-scm.com/book/en/v2/Git-Tools-Submodules
    4. Note: the start of the git submodule notes below were originally copied from my eRCaGuy_hello_world repo here.
  2. git lfs
    1. ***** 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'"
    2. My 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?"
    3. How can I tell if a file will be uploaded to git lfs correctly?
    4. See the parts of my answer here titled, "(Figure out which file extensions to add to git lfs next)" and "Quick reference: list extensions of all files > 10 kiB in size (-size +10k)".
      Example of the latter:
      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

To clone this repo plus all sub-repos (git submodules) and all 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

To update this repo:

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"

To add a repo as a submodule inside another repo:

# 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.

Here are some of the contents contained herein:

  1. git & Linux cmds, help, tips & tricks - Gabriel.txt - a general note-taking document where I jot down Linux commands, examples, notes about how to use gdb, bazel, various command-line tools, build tools, etc.
    1. It's kind of a general place where I write down things I learn which I know I will need later and don't want to forget. Correction: it's actually more correct to say I know I will forget them, so I write them down so I can come back and reference them later.
    2. I can't remember what I learned, but I can remember where I wrote it down, so I frequently reference this document to remind myself what I learned.
  2. 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:
    1. git diffn screenshot
  3. git blametool. See: useful_scripts/README.md.
  4. 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?
  5. ssh key setup information
    1. including a really good gs_ssh alias which automatically sources a custom .bashrc file in your ssh environment whenever you log in!
  6. .bashrc file which contains:
    1. ls aliases such as ll, la, & l
    2. Prompt String 1 (PS1) modifications to add terminal titles, current git branch name checked out [VERY USEFUL FEATURE!], bash shell level, etc
      1. bash shell terminal prompt showing current git branch!
    3. ssh aliases
    4. function to set terminal title
    5. ability to open up default tabs (with unique titles) for rapid launching of tabs in a terminal for development work
  7. .gitconfig file with meld as my difftool, git lg alias, etc
  8. Preferences.sublime-settings = Sublime Text 3 settings I like
  9. .gitignore example
  10. .imwheelrc config to improve mouse wheel scroll speed in Chrome
  11. Templates for right-click --> Create New Document menu in GUI file manager
  12. Desktop launchers (.desktop) files, including install/uninstall scripts
  13. Arduino tools & resources
    1. How to enable uploading to boards by adding user to "dialout" group
    2. How to enable flashing bootloaders with USBasp tool by setting up proper udev rule
  14. Eclipse tools & resources, including a reference & setup manual I've written:
    1. Eclipse setup instructions on a new Linux (or other OS) computer.pdf
    2. Eclipse color theme to make it have syntax highlighting that looks exactly like Sublime Text 3 (thanks to Jeremy Shepherd!)
  15. /etc/udev/rules.d/ udev rules
  16. NoMachine remote login setup info
  17. Useful scripts: see section below
    1. Ripgrep fuzzy finder, "rgf.sh".
    2. Ripgrep Replace, rgr (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.
  18. etc.

Installation & Usage:

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 eRCaGuy_dotfiles 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:

  1. Most files contain comments with additional info, instructions, or helpful links to look at.
  2. Many directories contain readmes, and some contain install scripts, such as my scripts to help install .desktop files.
  3. If a readme exists in a subfolder, take a look at it too for more install help or other usage information.
  4. Essentially, just read the readmes, headers, & other comments and it will become self-explanatory how to use or "install" something. If not, open up an issue or pull request and I'll address it.

Useful Applications

Good applications to install right after you install Linux.
See: useful_apps/README.md.

Useful Scripts

See useful_scripts/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:

  1. touchpad_toggle.sh
  2. open_programming_tools.sh
  3. git-diffn.sh
  4. git-changes.sh
  5. git-blametool.sh
  6. sync_git_repo_from_pc1_to_pc2.sh
  7. git-branch_.sh
  8. rgr / rg_replace
  9. sublf.sh
  10. ros_readbagfile.py
  11. git-filechange-search.sh
  12. find_and_replace.sh
  13. tmux-session.sh

(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

Misc. Install Instructions:

  1. Install speedtest by Ookla:

    1. Go here: https://www.speedtest.net/apps/cli --> scroll to the bottom and click "Download for Linux" --> right-click on the correct architecture option from the download menu dropdown list which shows up, and go to "Copy link address". This is the address used in the 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.
    1. After extracting 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.

More Repositories

1

PDF2SearchablePDF

`pdf2searchablepdf input.pdf` = voila! "input_searchable.pdf" is created & now has searchable text!
Shell
125
star
2

eRCaGuy_hello_world

"hello world" demos & templates for various languages, for beginners and experts alike, incl. gcc build commands for C & C++
C
118
star
3

Windows_Proxy_Toggler

A clickable icon on your Windows desktop to toggle your proxy on and off.
VBScript
72
star
4

eRCaGuy_TimerCounter

An Arduino micros()-like function (encapsulated in a library) with 0.5us precision (since the built-in Arduino micros() function has only 4us precision)
C++
28
star
5

fixed_point_math

Fixed point math practice & test code
C++
27
star
6

RealtekWiFiAdapterSoftware

Software that comes on a tiny little CD with the "LGTERK 1200Mbps USB 3.0 Wifi Adapter" from Amazon
C
25
star
7

ripgrep_replace

ripgrep_replace, or rgr, is a light-weight wrapper around ripgrep, supporting 100% of ripgrep's features + adding '-R' to enable on-disk find-and-replace; rgf2 is an interactive regex finder and viewer with syntax highlighting
Shell
21
star
8

eRCaGuy_PyTime

A simple milli & microsecond-resolution timestamp & loop-synchronization module for Python
Python
20
star
9

eRCaGuy_PyTerm

A datalogging serial terminal/console written in Python (I hope to extend it to Telnet and others later)
Python
15
star
10

eRCaGuy_analogReadXXbit

-A library which does oversampling to allow you to read with a resolution of 10-bit to 21-bit on the Arduino ADC (Analog to Digital Converter)!
C++
12
star
11

BrosTrendWifiAdapterSoftware

Software that comes on the mini CD (which is inconvenient) with BrosTrend WiFi adapters, and my personal installation notes for Linux.
Shell
12
star
12

eRCaGuy_PPM_Writer

An >=11-bit, jitter-free (hardware-based) RC radio PPM signal generator for the Arduino!
C++
7
star
13

MATLAB-Arduino_PPM_Reader_GUI

A program which uses an Arduino to read the stick & switch positions out of the PPM signal on a standard RC Transmitter, and plot and log the data live in MATLAB.
Arduino
5
star
14

Microchip_XC32_Compiler

[Works!] Build your own license-free, GPL version of the latest gcc-based Microchip MPLAB X IDE XC32 C++ compiler
5
star
15

eRCaGuy_ComputaPranksta_Support

Public support for my "Computa Pranksta" mouse jiggler device I sell on Amazon and elsewhere.
5
star
16

ElectricRCAircraftGuy.github.io

My github pages website at gabrielstaples.com
JavaScript
5
star
17

AlfaWiFiAdapterSoftware

Software that comes on the CDs (which are inconvenient) with Alfa WiFi adapters, and my personal installation notes for Linux
C
5
star
18

sublime_gcode

gcode (g-code) syntax highlighting for the Sublime Text editor; useful for viewing or editing CNC or 3D printer gcode files
G-code
4
star
19

eRCaGuy_TouchLamp

-an Arduino-based touch-lamp, using capacitive touch, with NO touch library (just a function) and NO additional touch hardware (just an Arduino and a wire)
Arduino
4
star
20

eRCaGuy_gtest_practice

googletest (gtest) & googlemock (gmock) practice
C++
3
star
21

ElectricRCAircraftGuy

Let me introduce myself to you...
2
star
22

eRCaGuy_ButtonReader

-Based on the main Arduino "Debounce" example, read a button or switch's latest action or state easily, so you can act when the button is pressed OR released!
C++
2
star
23

FreeFileSync

- a copy of FreeFileSync source (~v9.7 or later) from https://www.freefilesync.org/ that I'm patching to make buildable in Linux Ubuntu
C++
2
star
24

PWM_Reader2_WORKS_PERFECTLY_Hayden_car_lights

-not an ongoing project, just a quick proof-of-concept to read an RC PWM signal
C++
2
star
25

Banned_Google_Reviews

Use the Issues tab of this repo to paste your Google reviews which have been removed from Google Maps because someone affiliated with the reviewed establishment clicked the "flag" button to ban the review since it was negative.
2
star
26

eRCaGuy_Peer2Peer

A peer-to-peer send and receive synchronous half-duplex communication protocol with handshaking and auto-timeout, that requires only 2 (and any 2) pins, no timers, and no interrupts
C++
2
star
27

eRCaGuy_WDTimer

-use this code to use the watchdog timer to attach an interrupt that automatically perform some action every ___ms (user-defined). The benefit here is that your attached function is guaranteed to execute at the interval you specify (it can't get blocked by delay() or other functions in your main loop), and that is uses the *watchdog timer*, thereby keeping your other timers (ex: Timer0, Timer1, Timer2) free to be used by other libraries!
C++
2
star
28

MAX5481_DigitalPotCommander

sample code to control and command a MAX5481 digital potentiometer using SPI commands, including storing commands in the chip's on-board EEPROM, or not
Arduino
2
star
29

eRCaGuy_CodeFormatter

A collection of scripts & configuration files to quickly and easily format your code (by calling clang-format, for instance)
Python
1
star
30

eRCaGuy_EventReader

-the most thorough and robust button and event debouncing algorithm for Arduino that man has ever known :)
C++
1
star
31

bug_reports

Consumer bug reports you and I can report for any product or service we use. Add additional details & screenshots to an Issue here and link to it when submitting help requests through their website.
1
star
32

Arduino-STEM-Presentation

An in-depth half-day presentation and workshop I presented to a bunch of teachers in Dayton, Ohio in 2014 while working for the Air Force Research Laboratory.
C++
1
star
33

LibreBulletin

A semi-automated LibreOffice bulletin for Sunday meetings of the Church of Jesus Christ of Latter-day Saints
Python
1
star
34

TVBGone

My TVBGone code version (basically just very minor changes from Ken Shirriff's latest V1.2, which he ported to Arduino)
C++
1
star
35

FIT-Waving-Hand

-gimmicky trinket I programmed at the Florida Institute of Technology (FIT) using at the minimum a light sensor and two servos with a toy hand on a stick to wave at people as they pass by
Arduino
1
star
36

Chrome-Case-Sensitive-Find

A case-sensitive Find tool (recommended to use Ctrl + Shift + F or Ctrl + Alt + F) for the Google Chrome Browser
JavaScript
1
star
37

eRCaGuy_backup

Easily back up your files on any Linux system via a Bash rsync wrapper which supports dry-runs, include & exclude files, and nice logging.
Shell
1
star
38

eRCaGuy_Engineering

General engineering equation sheets, notes, knowledge, links, etc, including Electrical and Aeronautical Engineering
C
1
star
39

arduino-softtimer

Automatically exported from code.google.com/p/arduino-softtimer
C++
1
star
40

eRCaGuy_X9C_digital_pot

Arduino driver for the Renesas X9C102 (1k), X9C103 (10k), X9C503 (50k), and X9C104 (100k) family of digital potentiometers.
C++
1
star
41

ArduSTM

Going from Arduino to professional with STM32 microcontrollers.
1
star