├── .files_work ├── default.sh ├── pedanco.sh └── amp.sh ├── .config ├── nvim │ └── init.vim ├── kitty │ └── kitty.conf └── micro │ └── settings.json ├── .files_functions ├── .DS_Store ├── README.md ├── scrapewebsite.sh ├── showHiddenFiles.sh ├── hideHiddenFiles.sh ├── cmpwasm.sh ├── killPort.sh ├── resizeVideo.sh ├── searchHistory.sh ├── removeSystemctlService.sh ├── executeBashFromLine.sh ├── localscan.sh ├── installSystemctlService.sh ├── pixelartresize.sh ├── ideCli.sh ├── youtubemp3.sh ├── speedtest.sh ├── gitCompletelyRemoveFile.sh ├── backupPiSd.sh ├── gitSyncForkToMaster.sh ├── tunnelAaronTheDev.sh ├── setupsshkeys.sh └── gitgif.sh ├── .files_libs ├── github-markdown-toc │ ├── README.md │ └── gh-md-toc ├── sexy_prompt │ ├── bash_sexy_theme_settings.sh │ └── bash_sexy_theme.sh ├── README.md ├── index.sh ├── gifgen.sh ├── sshrc.sh ├── bebop.sh ├── JSON.sh ├── wifi.sh ├── gvn.sh └── piShrink.sh ├── .files_templates ├── README.md ├── nginx.reverse.proxy ├── nginxstream.service ├── systemctl.service └── createAndCopySystemctlService.sh ├── .files_install_scripts ├── initial_install_atom.sh ├── installSystemctlNoSudo.sh ├── installMosh.sh ├── initial_install_osx.sh ├── installMongo.sh ├── installVundle.sh ├── installGo.sh ├── installFail2Ban.sh ├── old-installCaddy.sh └── installNpm.sh ├── .files_scripts ├── letsEncryptDomains.sh └── googleDomainsDynamicDns.sh ├── .bash_profile ├── .gitignore ├── .sshrc ├── dotFilesCopyFilesToHome.sh ├── .files_atom_packages.list ├── README.md ├── .hyper.js ├── .conkyrc ├── .files_completion.sh ├── .files_aliases.sh ├── .bashrc ├── .vimrc ├── itermGruvbox.itermcolors ├── LICENSE └── itermProfile.json /.files_work/default.sh: -------------------------------------------------------------------------------- 1 | # Our default files to source for work 2 | 3 | source ~/.files_work/amp.sh 4 | -------------------------------------------------------------------------------- /.config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | set runtimepath+=~/.vim,~/.vim/after 2 | set packpath+=~/.vim 3 | source ~/.vimrc 4 | -------------------------------------------------------------------------------- /.files_functions/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torch2424/dotFiles/HEAD/.files_functions/.DS_Store -------------------------------------------------------------------------------- /.files_libs/github-markdown-toc/README.md: -------------------------------------------------------------------------------- 1 | Taken from: https://github.com/ekalinin/github-markdown-toc 2 | 3 | Cached for security 4 | -------------------------------------------------------------------------------- /.files_functions/README.md: -------------------------------------------------------------------------------- 1 | # Bash Functions 2 | 3 | Bash Scripts that declare individual functions (and aliases of these functions) to 4 | acheive tasks 5 | -------------------------------------------------------------------------------- /.files_templates/README.md: -------------------------------------------------------------------------------- 1 | # This directory contains template files for common config files needed for services 2 | e.g. a template for systemctl files, nginx servers, etc... 3 | -------------------------------------------------------------------------------- /.files_install_scripts/initial_install_atom.sh: -------------------------------------------------------------------------------- 1 | apm install editorconfig es6-javascript atom-ternjs javascript-snippets linter linter-eslint language-babel autocomplete-modules file-icons atom-beautifyatom-typescript linter-golinter atom-zentabs gruvbox-plus-syntax 2 | -------------------------------------------------------------------------------- /.files_scripts/letsEncryptDomains.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Use --expand to add more domainss 4 | sudo letsencrypt certonly --standalone -d aaronthedev.com -d files.aaronthedev.com -d mongo.aaronthedev.com -d blog.aaronthedev.com -d git.aaronthedev.com -d testbuild.aaronthedev.com 5 | -------------------------------------------------------------------------------- /.files_functions/scrapewebsite.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | __scrapewebsite() { 4 | wget --recursive --html-extension --no-parent --page-requisites --convert-links $1 5 | } 6 | 7 | alias scrapewebsite='__scrapewebsite' 8 | alias sw='scrapewebsite' 9 | alias scrape-website='sw' 10 | alias scrape='sw' 11 | -------------------------------------------------------------------------------- /.bash_profile: -------------------------------------------------------------------------------- 1 | # Simply Source our agnostice .bashrc 2 | if [ -f "$HOME/.bashrc" ]; then 3 | source "$HOME/.bashrc" 4 | fi 5 | 6 | # startup virtualenv-burrito 7 | if [ -f $HOME/.venvburrito/startup.sh ]; then 8 | . $HOME/.venvburrito/startup.sh 9 | fi 10 | 11 | export PATH="$HOME/.cargo/bin:$PATH" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Everything 2 | # Look at article mentioned in README, files are added with 'git add -f FILE_NAME_HERE' 3 | * 4 | 5 | **/.htpasswd 6 | 7 | # Some exceptions to the above rule 8 | !.files_aliases.sh 9 | !.files_functions/* 10 | !.files_libs/* 11 | !.files_templates/* 12 | !.initial_install.sh 13 | -------------------------------------------------------------------------------- /.files_functions/showHiddenFiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fucntion to show hidden files on OSX 4 | 5 | __showHiddenFiles() { 6 | defaults write com.apple.finder AppleShowAllFiles YES 7 | killall Finder 8 | } 9 | 10 | # Aliases for this function 11 | alias showHiddenFiles='__showHiddenFiles' 12 | alias show-hidden-files="showHiddenFiles" 13 | -------------------------------------------------------------------------------- /.files_functions/hideHiddenFiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fucntion to show hidden files on OSX 4 | 5 | __hideHiddenFiles() { 6 | defaults write com.apple.finder AppleShowAllFiles NO 7 | killall Finder 8 | } 9 | 10 | alias hideHiddenFiles='__hideHiddenFiles' 11 | alias hidehiddenfiles='hideHiddenFiles' 12 | alias hide-hidden-files="hideHiddenFiles" 13 | -------------------------------------------------------------------------------- /.files_templates/nginx.reverse.proxy: -------------------------------------------------------------------------------- 1 | # Nginx Reverse proxy to serve an app on a port 2 | server { 3 | listen 80; 4 | server_name [Subdomain goes here].aaronthedev.com; 5 | 6 | location / { 7 | proxy_set_header Host $host; 8 | proxy_set_header X-Real-IP $remote_addr; 9 | proxy_pass http://127.0.0.1:[PORT GOES HERE]; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.sshrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This file will be run on ssh, along with files in ssh.d 4 | # Acces the file from: $SSHHOME/.sshrc.d/FILE_NAME_HERE 5 | echo "sshrc sourcing files..." 6 | 7 | # Source our vimrc 8 | export MYVIMRC='$SSHHOME/.sshrc.d/.vimrc' 9 | export VIMINIT='source $MYVIMRC' 10 | 11 | #Source our aliases 12 | source $SSHHOME/.sshrc.d/.bash_aliases.sh 13 | -------------------------------------------------------------------------------- /.files_functions/cmpwasm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Function to compare wasm binaries 4 | # https://superuser.com/questions/125376/how-do-i-compare-binary-files-in-linux 5 | 6 | __cmpWasm() { 7 | cmp -l $1 $2 | gawk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}' 8 | } 9 | 10 | # Aliases for this function 11 | alias cmpwasm='__cmpWasm' 12 | alias cmp-wasm="cmpwasm" 13 | -------------------------------------------------------------------------------- /.files_libs/sexy_prompt/bash_sexy_theme_settings.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Set some of the colors mentioned by the sexy bash prompt 4 | # https://github.com/twolfson/sexy-bash-prompt#configurationi 5 | # Color Guide: https://linuxtidbits.files.wordpress.com/2008/08/tputcolors.png?w=776 6 | PROMPT_USER_COLOR="$(tput bold)$(tput setaf 9)" 7 | PROMPT_PREPOSITION_COLOR="$(tput bold)$(tput setaf 7)" 8 | -------------------------------------------------------------------------------- /.files_functions/killPort.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | function __killPort() { 4 | if [ "$#" -ne 1 ]; then 5 | echo "Usage (Requires sudo): ./killPort.sh [port number]" 6 | else 7 | if [[ "$OSTYPE" == "darwin"* ]]; then 8 | sudo lsof -nti:$1 | xargs kill -9 9 | else 10 | sudo fuser -k $1/tcp 11 | fi 12 | fi 13 | } 14 | 15 | alias killPort='__killPort' 16 | alias killport='killPort' 17 | alias kill-port='killport' 18 | -------------------------------------------------------------------------------- /dotFilesCopyFilesToHome.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | # Inform user of copy 4 | echo " " 5 | echo "Copying dotfiles with 'cp -r .* ~', and deleting the extra 'dotFiles' folder" 6 | echo " " 7 | 8 | # Simply a command to run for dotfiles to be copied to the home directory 9 | cp -r .* ~ 10 | 11 | # Go back home and delete the dot file repo 12 | cd ~ 13 | rm -rf dotFiles 14 | 15 | echo " " 16 | echo "Done! Please note, any errors about copying git is fine, and should be expected." 17 | echo " " 18 | -------------------------------------------------------------------------------- /.files_functions/resizeVideo.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | __resizeVideo() { 4 | 5 | if [ "$#" -ne 2 ]; then 6 | echo "shortcut for: https://trac.ffmpeg.org/wiki/Scaling%20(resizing)%20with%20ffmpeg" 7 | echo "USAGE:" 8 | echo "resizeVideo.sh [inputfile] [width to resize/scale to]" 9 | else 10 | ffmpeg -i $1 -vf scale=$2:-1 "$2_$1" 11 | fi 12 | 13 | } 14 | 15 | alias resizeVideo='__resizeVideo' 16 | alias resizevideo="resizeVideo" 17 | alias scaleVideo="resizeVideo" 18 | alias scalevideo="resizeVideo" 19 | -------------------------------------------------------------------------------- /.files_functions/searchHistory.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | __searchHistory() { 4 | 5 | if (("$#" == 1)); then 6 | history | grep "$1.*" 7 | elif (("$#" == 0)); then 8 | history 9 | else 10 | echo "Please pass an argument" 11 | fi 12 | } 13 | 14 | alias searchhistory='__searchHistory' 15 | alias showHistory='searchhistory' 16 | alias showhistory='showHistory' 17 | alias historySearch='searchhistory' 18 | alias search-history='searchhistory' 19 | alias show-history='searchhistory' 20 | -------------------------------------------------------------------------------- /.files_install_scripts/installSystemctlNoSudo.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | # https://github.com/torch2424/dotFiles/blob/master/.files_templates/createAndCopySystemctlService.sh#L65 4 | FILE=/etc/sudoers.d/systemctl-no-sudo 5 | echo " " 6 | echo "Enabling systemctl no sudo in $FILE" 7 | sudo touch $FILE 8 | sudo echo "$(whoami) ALL=NOPASSWD: /bin/systemctl" | sudo tee $FILE 9 | 10 | echo " " 11 | echo "Reading/Logging $FILE :" 12 | echo " " 13 | 14 | sudo cat $FILE 15 | 16 | echo " " 17 | echo "Done!" 18 | echo " " 19 | 20 | -------------------------------------------------------------------------------- /.files_functions/removeSystemctlService.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | removeSystemctlService() { 4 | if [ "$#" -lt 1 ] || [ "$#" -gt 1 ]; then 5 | echo "removeSystemctlService USAGE:" 6 | echo "removeSystemctlService [service file]" 7 | else 8 | echo "Removing /etc/systemd/system/$1" 9 | sudo rm /etc/systemd/system/$(basename $1) 10 | fi 11 | } 12 | 13 | alias remove-systemctl-service='removeSystemctlService' 14 | alias removesystemctlservice='removeSystemctlService' 15 | alias rss='removesystemctlservice' 16 | -------------------------------------------------------------------------------- /.files_templates/nginxstream.service: -------------------------------------------------------------------------------- 1 | # Follow this guide for compiling nginx for rtmp 2 | # https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/ 3 | # 4 | # Copy this file to: /etc/systemd/system 5 | [Unit] 6 | Description=The NGINX HTTP and reverse proxy server 7 | After=syslog.target network.target remote-fs.target nss-lookup.target 8 | 9 | [Service] 10 | Type=forking 11 | ExecStart=/usr/local/nginx/sbin/nginx 12 | PrivateTmp=true 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /.files_libs/README.md: -------------------------------------------------------------------------------- 1 | # This folder contains some cool libraries to improve bash! 2 | 3 | Alot of these were found from [awesome shell](https://github.com/alebcay/awesome-shell) 4 | 5 | The index.sh is sourced, which then handles loading these libraries in an appropriate way 6 | 7 | ## Library Links 8 | [wifi.sh](https://github.com/dominictarr/wifi.sh) 9 | 10 | [json.sh](https://github.com/dominictarr/JSON.sh) 11 | 12 | [sshrc.sh](https://github.com/Russell91/sshrc) 13 | 14 | [sexy_bash_prompt](https://github.com/twolfson/sexy-bash-prompt) 15 | -------------------------------------------------------------------------------- /.files_functions/executeBashFromLine.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | 4 | # Fucntion to execute a bash script starting at line number 5 | 6 | __executefromline() { 7 | if [ "$#" -ne 2 ]; then 8 | echo "USAGE: executeFromLine.sh [script file] [line # to execute from]" 9 | else 10 | cat $1 | awk "NR>=$2" | bash 11 | fi 12 | } 13 | 14 | alias executefromline='__executefromline' 15 | alias bashfromline='executefromline' 16 | alias executebashfromline='executefromline' 17 | alias scriptfromline='executefromline' 18 | alias exectueatline='executefromline' 19 | -------------------------------------------------------------------------------- /.files_functions/localscan.sh: -------------------------------------------------------------------------------- 1 | # Do a scan on the local network for devices 2 | 3 | function __localscan() { 4 | # Get IP: https://stackoverflow.com/a/21336679 5 | my_ip=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}') 6 | 7 | # replace the last .x with .0/24 8 | # https://unix.stackexchange.com/a/329085 9 | scan_ip=$(awk -F"." '{print $1"."$2"."$3".0/24"}'<<<$my_ip) 10 | 11 | echo "Scanning $scan_ip..." 12 | 13 | # Run the scan 14 | sudo nmap -sn $scan_ip 15 | } 16 | 17 | alias portscan='__localscan' 18 | alias localscan='__localscan' 19 | -------------------------------------------------------------------------------- /.files_functions/installSystemctlService.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | installSystemctlService() { 4 | 5 | if [ "$#" -lt 1 ] || [ "$#" -gt 1 ]; then 6 | echo "installSystemctlService (Copy a service file to /etc/systemd/system) USAGE:" 7 | echo "installSystemctlService [service file]" 8 | else 9 | echo "Copying to /etc/systemd/system" 10 | sudo cp $1 /etc/systemd/system 11 | fi 12 | } 13 | 14 | alias install-systemctl-service='installSystemctlService' 15 | alias installsystemctlservice='installSystemctlService' 16 | alias iss='installsystemctlservice' 17 | alias sscp='iss' 18 | -------------------------------------------------------------------------------- /.files_functions/pixelartresize.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Function to resize pixel with pint filter, to not lose any quality at any size 4 | function __pixelartupscale() { 5 | if [ "$#" -ne 2 ]; then 6 | echo "USAGE:" 7 | echo "./pixelartresize [file to be resized] [new width of file (can only be scaled by aspect ratio)]" 8 | echo " " 9 | echo "Note: This will edit the file in place" 10 | else 11 | mogrify -resize $2x -filter point -quality 100 "$1" 12 | fi 13 | } 14 | 15 | alias pixelartupscale='__pixelartupscale' 16 | alias pixelartresize='pixelartupscale' 17 | -------------------------------------------------------------------------------- /.files_functions/ideCli.sh: -------------------------------------------------------------------------------- 1 | # Collection of functions to add IDE like commands to terminal 2 | searchjsproject() { 3 | 4 | PATTERN=$1 5 | DIRECTORY="./" 6 | 7 | if [ $# -eq 2 ]; then 8 | DIRECTORY=$2 9 | fi 10 | 11 | if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then 12 | echo "searchjsproject USAGE:" 13 | echo "searchjsproject [pattern]" 14 | echo "searchjsproject [pattern] [directory]" 15 | else 16 | grep --exclude-dir={**/node_modules,**/*dist*,**/*build*,**/.git,**/.docz,**/third_party} -rn $DIRECTORY -e $PATTERN 17 | fi 18 | } 19 | 20 | alias searchproject='searchjsproject' 21 | -------------------------------------------------------------------------------- /.files_atom_packages.list: -------------------------------------------------------------------------------- 1 | advanced-open-file@0.16.7 2 | atom-beautify@0.32.0 3 | atom-typescript@12.3.4 4 | busy-signal@1.4.3 5 | color-picker@2.2.5 6 | es6-javascript@1.0.0 7 | file-icons@2.1.17 8 | gruvbox-plus-syntax@1.3.1 9 | intentions@1.1.5 10 | language-babel@2.84.0 11 | language-brightscript@0.6.3 12 | language-caddyfile@0.1.7 13 | language-lua@0.9.11 14 | language-mips@0.3.0 15 | language-pico8@1.0.0 16 | linter@2.2.0 17 | linter-eslint@8.4.1 18 | linter-golinter@1.2.2 19 | linter-jshint@3.1.6 20 | linter-ui-default@1.7.1 21 | minimap@4.29.8 22 | pigments@0.40.2 23 | pinned-tabs@2.0.5 24 | print-code@0.7.1 25 | 26 | -------------------------------------------------------------------------------- /.files_templates/systemctl.service: -------------------------------------------------------------------------------- 1 | # How to create systemd services: http://neilwebber.com/notes/2016/02/10/making-a-simple-systemd-file-for-raspberry-pi-jessie/ 2 | # Original Template: https://github.com/torch2424/dotFiles/blob/master/.files_templates/systemctl.service 3 | 4 | # Copy the file to /etc/systemd/system 5 | [Unit] 6 | Description=Torch2424 Template for simple systemctl service 7 | After=network.target 8 | 9 | [Service] 10 | Type=simple 11 | User=[USER] 12 | WorkingDirectory=/home/[USER] 13 | ExecStart=/bin/bash --login -c 'source $HOME/.bashrc; cd [DIRECTORY] && [COMMAND]' 14 | Restart=always 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /.files_install_scripts/installMosh.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | #function to print mosh install usage 4 | printmoshinstallusage() { 5 | echo "This install script will only work on Ubuntu, Debian, and OSX" 6 | echo "Brew for osx" 7 | echo "apt-get for ubuntu / debian" 8 | } 9 | 10 | if [ "$(uname)" == "Darwin" ] && [ -x "$(command -v brew)" ]; then 11 | brew install mobile-shell 12 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ] && [ -x "$(command -v apt-get)" ]; then 13 | sudo apt-get install -y mosh 14 | else 15 | echo "This install script will only work on Ubuntu, Debian, and OSX" 16 | echo "Brew required for osx" 17 | echo "apt-get required for ubuntu / debian" 18 | fi 19 | -------------------------------------------------------------------------------- /.files_functions/youtubemp3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Function to download a youtube video and convert to mp3 4 | __youtubemp3() { 5 | if [ $# -ne "2" ]; then 6 | echo "Youtube Video to mp3" 7 | echo "Usage:" 8 | echo "./youtubemp3 [Youtube URL] [Output Path e.g './video.mp3']" 9 | return 10 | fi 11 | 12 | if hash ytdl 2>/dev/null; then 13 | ytdl $1 > /tmp/$2 14 | ffmpeg -i /tmp/$2 -acodec libmp3lame -aq 4 $2 15 | else 16 | echo "ytdl is not installed. run: npm install -g ytdl" 17 | fi 18 | } 19 | 20 | alias youtubemp3='__youtubemp3' 21 | alias youtube-mp3="youtubemp3" 22 | alias youtubeMp3="youtubemp3" 23 | alias youtubetomp3="youtubemp3" 24 | alias youtube2mp3="youtubemp3" -------------------------------------------------------------------------------- /.files_install_scripts/initial_install_osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Initial install Script for torch2424 on OSx 4 | # Will require some user input to get things going. just follow the prompts! 5 | 6 | # With Help From: https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ 7 | 8 | # Install Command Line tools (Xcode tools), will bring up a modal agreement 9 | xcode-select --install 10 | 11 | # Run the ruby brew install script 12 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 13 | 14 | # Initialize brew 15 | brew doctor 16 | brew update 17 | 18 | # Install some apps using brew 19 | brew install neofetch 20 | brew install sshrc 21 | -------------------------------------------------------------------------------- /.files_functions/speedtest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Cool speedtest function, works by using wget 4 | # (Which shows speed in kilobytes per second or Megabytes per second) 5 | # And tries to download an ubuntu iso 6 | # (Which has no affiliation to isps) 7 | # to a directory that auto deletes itself 8 | function __speedtest() { 9 | if [ "$#" -gt 0 ]; then 10 | wget -O/dev/null $1 11 | else 12 | wget -O/dev/null http://mirror.pnl.gov/releases/17.04/ubuntu-17.04-server-amd64.img 13 | fi 14 | } 15 | 16 | # Aliases 17 | alias speedtest='__speedtest' 18 | 19 | # Pacific Northwest Mirror capped at 10 Gbps 20 | alias speedtest-us-west-mirror='speedtest http://mirror.pnl.gov/releases/17.04/ubuntu-17.04-server-amd64.img' 21 | # Canadian Mirror capped at 4Gbps https://launchpad.net/ubuntu/+cdmirrors 22 | alias speedtest-canada-mirror='speedtest http://ubuntu-cd.mirror.iweb.ca/17.04/ubuntu-17.04-server-amd64.img' 23 | -------------------------------------------------------------------------------- /.files_functions/gitCompletelyRemoveFile.sh: -------------------------------------------------------------------------------- 1 | #bin/bash 2 | 3 | function __gitCompletelyRemoveFile() { 4 | echo "This will completely remove a file from repo by reqriting history" 5 | echo "https://stackoverflow.com/questions/16877530/completely-remove-a-file-from-whole-git-repository" 6 | echo "https://help.github.com/articles/removing-sensitive-data-from-a-repository/" 7 | 8 | echo "https://dalibornasevic.com/posts/2-permanently-remove-files-and-folders-from-git-repo" 9 | 10 | echo " " 11 | echo " " 12 | 13 | if [ "$#" -eq 1 ]; then 14 | 15 | git filter-branch --force --index-filter \ 16 | "git rm --cached --ignore-unmatch $1" \ 17 | HEAD 18 | 19 | else 20 | echo "You must pass in a file path e.g .files/hello.js" 21 | fi 22 | } 23 | 24 | alias gitcompletelyremovefile='__gitCompletelyRemoveFile' 25 | alias gitCompletelyRemoveFile='__gitCompletelyRemoveFile' 26 | alias gfb="__gitCompletelyRemoveFile" 27 | alias gcrf="gfb" 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotFiles 2 | 3 | ![Last Commit](https://img.shields.io/github/last-commit/torch2424/dotFiles.svg) 4 | ![Commit Activity 4 weeks](https://img.shields.io/github/commit-activity/4w/torch2424/dotFiles.svg) 5 | ![Top Language](https://img.shields.io/github/languages/top/torch2424/dotFiles.svg) 6 | ![Number of Languages]( https://img.shields.io/github/languages/count/torch2424/dotFiles.svg) 7 | ![Repository Size](https://img.shields.io/github/repo-size/torch2424/dotFiles.svg) 8 | 9 | ![torch2424 Avatar](https://avatars1.githubusercontent.com/u/1448289?s=460&v=4) 10 | 11 | A repo containing all the cool stuff that makes my ~ feel like $HOME. See the helpful links below for what a "dotfiles repo" is. 12 | 13 | # Helpful links 14 | 15 | * [Article on building your own dotfiles](https://www.foraker.com/blog/get-your-dotfiles-under-control) 16 | 17 | * [Another helpful guide on dotfiles](https://dotfiles.github.io/) 18 | 19 | * [Iterm Gruvbox Colors](https://github.com/morhetz/gruvbox-contrib/blob/master/iterm2/gruvbox-dark.itermcolors) 20 | 21 | -------------------------------------------------------------------------------- /.files_functions/backupPiSd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function __backupPiSd() { 4 | if [ "$#" -ne 2 ]; then 5 | echo "USAGE: ./backupPiSd.sh [Disk e.g (/dev/disk1) or (/dev/sdb)] [nameOfImageFile]" 6 | else 7 | echo "This command will run dd. Please beware, and ensure this is the correct disk to be backed up." 8 | echo " " 9 | echo "Backing up pi sd card. This will take a while" 10 | 11 | # From the pi hut: https://thepihut.com/blogs/raspberry-pi-tutorials/17789160-backing-up-and-restoring-your-raspberry-pis-sd-card 12 | sudo dd if="$1" of="$2".img 13 | 14 | # Mention piShrink 15 | echo "Image backup Completed!" 16 | echo " " 17 | echo "Next try piShink for minimize the pi image" 18 | echo "https://github.com/Drewsif/PiShrink/" 19 | echo " " 20 | echo "Or, if using torch2424/dotFiles, simply run the piShrink function!" 21 | fi 22 | } 23 | 24 | alias backuppi="__backupPiSd" 25 | alias backuppisd="backuppi" 26 | alias backup-pi-sd="backuppi" 27 | -------------------------------------------------------------------------------- /.files_libs/index.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This file is meant for sourcing all imported libraries 3 | 4 | # Sexy Prompt is loaded from the .bashrc, that way it can easily be disabled for terminal recordings 5 | 6 | # Write some aliases to wrap around imported libs 7 | alias json="sh ~/.files_libs/JSON.sh < " 8 | alias wifi="~/.files_libs/wifi.sh " 9 | alias gifgen="~/.files_libs/gifgen.sh " 10 | alias sshrc="~/.files_libs/sshrc.sh " 11 | alias piShrink="~/.files_libs/piShrink.sh " 12 | alias pishrink="piShrink" 13 | 14 | # Gvn Alias 15 | gvn() { 16 | ~/.files_libs/gvn.sh $@ 17 | } 18 | alias gvnh="gvn help" 19 | alias gvna="gvn add" 20 | alias gvnr="gvn reset" 21 | alias gvnp="gvn pull" 22 | alias gvns="gvn status" 23 | alias gvnc="gvn commit" 24 | alias gvnl="gvn log" 25 | alias gvnd="gvn diff" 26 | 27 | # Aliases for local gh-md-toc 28 | # https://github.com/ekalinin/github-markdown-toc 29 | toc() { 30 | ~/.files_libs/github-markdown-toc/gh-md-toc $@ 31 | } 32 | alias table='toc' 33 | alias tableofcontents='toc' 34 | alias readmetable='toc' 35 | alias gh-md-toc='toc' 36 | alias github-markdown-toc='toc' 37 | -------------------------------------------------------------------------------- /.files_scripts/googleDomainsDynamicDns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Modified From: https://gist.github.com/cyrusboadway/5a7b715665f33c237996 4 | 5 | # Add this to your crontab for autmated usage 6 | # https://www.raspberrypi.org/documentation/linux/usage/cron.md 7 | # Runs every 30 minutes 8 | # */30 * * * * /my/absolute/path/googleDomainsDynamicDns.sh [USERNAME] [PASSWORD] [HOSTNAME] >> /my/absolute/path/googleDomainsDynamicDns.log 9 | 10 | # Make sure we pass our version 11 | if [ "$#" -ne 3 ]; then 12 | 13 | echo "USAGE:" 14 | echo "./googleDomainsDynamicDns.sh [USERNAME] [PASSWORD] [HOSTNAME]" 15 | 16 | else 17 | 18 | # Update Google DNS Record 19 | URL="https://$1:$2@domains.google.com/nic/update?hostname=$3" 20 | 21 | echo " " 22 | echo " " 23 | 24 | echo "Date for logging purposes" 25 | 26 | date 27 | 28 | echo " " 29 | echo " " 30 | 31 | echo "Making a Request to: $URL" 32 | 33 | echo "See response values here: https://support.google.com/domains/answer/6147083" 34 | 35 | echo " " 36 | echo " " 37 | 38 | curl -s $URL 39 | 40 | echo " " 41 | echo " " 42 | 43 | echo "Done!" 44 | 45 | fi 46 | -------------------------------------------------------------------------------- /.files_work/pedanco.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Aliases and things for pedanco 4 | 5 | # Pedanco Postgres 6 | export PATH=$PATH:/usr/local/bin/postgres 7 | 8 | # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. 9 | export PATH="$PATH:$HOME/.rvm/bin" 10 | 11 | # Load RVM into a shell session *as a function* 12 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 13 | 14 | # Pendanco Aliases 15 | alias woprengine='WORKERS=ConversationEventWorker rake sneakers:run' 16 | 17 | 18 | # Skip CI for pedanco 19 | # https://gist.github.com/shytikov/3132078 20 | function pedanco_gc() { 21 | 22 | if [[ $(pwd) == *"pedanco"* ]] || [[ $(pwd) == *"wopr"* ]]; then 23 | 24 | if [ "$#" -eq 1 ]; then 25 | git commit -m "$1 --skip-ci" 26 | else 27 | echo " " 28 | echo "pedanco_gc USAGE:" 29 | echo " " 30 | echo "pedanco_gc 'COMMIT_MESSAGE_IN_QUOTES'" 31 | echo " " 32 | echo "Aborting commit due to empty commit message." 33 | fi 34 | 35 | else 36 | git commit 37 | fi 38 | } 39 | 40 | alias gc='pedanco_gc' 41 | alias gcnoskip='git commit' 42 | 43 | source ~/.files_work/sourceEnvVariablesPedanco.sh -------------------------------------------------------------------------------- /.config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # From MIT Licesned: https://github.com/dexpota/kitty-themes 2 | 3 | # Don't Confirm before closing: 4 | confirm_os_window_close 0 5 | 6 | # gruvbox dark by morhetz, https://github.com/morhetz/gruvbox 7 | # This work is licensed under the terms of the MIT license. 8 | # For a copy, see https://opensource.org/licenses/MIT. 9 | 10 | background #282828 11 | foreground #ebdbb2 12 | 13 | cursor #928374 14 | 15 | selection_foreground #928374 16 | selection_background #3c3836 17 | 18 | color0 #282828 19 | color8 #928374 20 | 21 | # red 22 | color1 #cc241d 23 | # light red 24 | color9 #fb4934 25 | 26 | # green 27 | color2 #98971a 28 | # light green 29 | color10 #b8bb26 30 | 31 | # yellow 32 | color3 #d79921 33 | # light yellow 34 | color11 #fabd2d 35 | 36 | # blue 37 | color4 #458588 38 | # light blue 39 | color12 #83a598 40 | 41 | # magenta 42 | color5 #b16286 43 | # light magenta 44 | color13 #d3869b 45 | 46 | # cyan 47 | color6 #689d6a 48 | # lighy cyan 49 | color14 #8ec07c 50 | 51 | # light gray 52 | color7 #a89984 53 | # dark gray 54 | color15 #928374 55 | -------------------------------------------------------------------------------- /.files_functions/gitSyncForkToMaster.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | __gitSyncForkToMaster() { 4 | 5 | GIT_BRANCH=master 6 | 7 | if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]; then 8 | echo "Must pass fork git clone url" 9 | echo "e.g https://github.com/ampproject/amphtml.git" 10 | echo "Exiting..." 11 | return 1; 12 | fi 13 | 14 | # Remove the old upstream 15 | echo "Removing any old 'upstream' remote..." 16 | git remote rm upstream 17 | 18 | # Add the remote, call it "upstream": 19 | 20 | git remote add upstream $1 21 | 22 | # Fetch all the branches of that remote into remote-tracking branches, 23 | # such as upstream/master: 24 | 25 | git fetch upstream 26 | 27 | # Make sure that you're on your master branch: 28 | 29 | git checkout $2 30 | 31 | # Rewrite your master branch so that any commits of yours that 32 | # aren't already in upstream/master are replayed on top of that 33 | # other branch: 34 | 35 | git rebase upstream/$2 36 | 37 | # Force push to our master 38 | git push -f origin $2 39 | } 40 | 41 | # Alaises 42 | alias gitSyncForkToMaster='__gitSyncForkToMaster' 43 | alias gitSyncFork='gitSyncForkToMaster' 44 | alias git-sync-fork='gitSyncFork' 45 | alias gitforksync='gitSyncFork' 46 | alias gitsyncfork='gitSyncFork' 47 | -------------------------------------------------------------------------------- /.files_functions/tunnelAaronTheDev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | : ' 4 | 5 | ABOUT: 6 | 7 | ngrok / localtunnel funcitonality over ssh 8 | 9 | Follows this guide: https://blog.rodneyrehm.de/archives/38-You-may-not-need-localtunnel-or-ngrok.html 10 | 11 | TL;DR 12 | 13 | ------------------------------------------ 14 | 15 | On your remote server, inside /etc/ssh/sshd_config add: 16 | 17 | AllowTcpForwarding yes 18 | GatewayPorts yes 19 | 20 | 21 | Then to expose your port: 22 | 23 | ssh -p ${sshPort} ${user}@${remoteServer} -N -R ${remoteHttpPort}:localhost:${localHttpPort} 24 | ' 25 | 26 | aaronTheDevHttpPortShare() { 27 | 28 | if [ "$#" -ne 2 ]; then 29 | echo " " 30 | echo "USAGE:" 31 | echo "./aaronTheDevHttpPortShare [user] [localPort]" 32 | echo " " 33 | else 34 | 35 | echo "Connecting to $1@apps-11-2021.aaronthedev.com -p 1124." 36 | echo "Remote Url: http://apps-11-2021.aaronthedev.com:9090 or https://tunnel.aaronthedev.com" 37 | echo " " 38 | echo "NOTE: Service will continue to run without confirmation of successful connection." 39 | echo " " 40 | 41 | ssh -p 1124 "$1"@apps-11-2021.aaronthedev.com -N -R 9091:localhost:"$2" 42 | fi 43 | } 44 | 45 | # Some brand name aliases 46 | alias shareport='aaronTheDevHttpPortShare' 47 | alias portshare='shareport' 48 | alias sp='shareport' 49 | alias tunnel='sp' 50 | -------------------------------------------------------------------------------- /.files_install_scripts/installMongo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # From: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04 4 | 5 | echo " " 6 | echo "Installing MongoDB..." 7 | echo "This will require sudo..." 8 | echo " " 9 | 10 | sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 11 | echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list 12 | sudo apt-get update 13 | sudo apt-get install -y mongodb-org 14 | sudo systemctl start mongod 15 | sudo systemctl enable mongod 16 | 17 | echo " " 18 | echo "MongoDB Installed, and enabled at boot, showing systemctl status..." 19 | echo " " 20 | 21 | sudo systemctl status --no-pager mongod 22 | 23 | echo " " 24 | echo "If you see a status here, Mongo is installed! And control mongo (mongod) with systemctl!" 25 | echo " " 26 | echo "Learn how to secure mongodb:" 27 | echo "https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-mongodb-on-ubuntu-16-04" 28 | echo "Create a escalate user admin to root:" 29 | echo "https://docs.mongodb.com/v2.6/tutorial/add-admin-user/" 30 | echo " " 31 | echo "Done! Enjoy Losing your data! Jk! See the joke below:" 32 | echo "https://www.reddit.com/r/mongodb/comments/43m2om/how_exactly_does_mongodb_lose_data_and_is_it/" 33 | echo " " 34 | -------------------------------------------------------------------------------- /.files_install_scripts/installVundle.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/jez/vim-as-an-ide/commit/dcc0c8d 2 | 3 | echo "Installing vim & neovim..." 4 | if [ "$(uname)" == "Darwin" ]; then 5 | # Do something under Mac OS X platform 6 | 7 | # Vim instlled by default 8 | # echo "vim already installed" 9 | 10 | # Install neovim 11 | brew install neovim 12 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then 13 | # Do something under GNU/Linux platform 14 | sudo apt update 15 | sudo apt install -y vim vim-gui-common neovim 16 | fi 17 | 18 | echo "Installing fzf..." 19 | if [ "$(uname)" == "Darwin" ]; then 20 | # Do something under Mac OS X platform 21 | 22 | brew install fzf 23 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then 24 | # Do something under GNU/Linux platform 25 | 26 | sudo apt install fzf 27 | fi 28 | 29 | 30 | echo "Installing Vundle..." 31 | 32 | git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 33 | 34 | # Run the plugin install 35 | # https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks 36 | vim -c VundleUpdate -c quitall 37 | 38 | # nerdtree broke clicking a file to open it in 6.10.5, so we need to manually switch to this release 39 | # As in my experience, it was not fixed completely. 40 | # See: https://github.com/preservim/nerdtree/issues/1224 41 | # See: https://github.com/preservim/nerdtree/pull/1225 42 | (cd ~/.vim/bundle/nerdtree && git checkout 6.10.4) 43 | 44 | echo "Done!" 45 | -------------------------------------------------------------------------------- /.files_functions/setupsshkeys.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | # https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ 4 | 5 | setupSshKeys() { 6 | 7 | if [ "$#" -lt 3 ] || [ "$#" -gt 3 ]; then 8 | echo "setupSshKeys USAGE:" 9 | echo "setupSshKeys [username] [url] [port]" 10 | else 11 | 12 | echo " " 13 | echo "Will have to login for $1@$2 multiple times :)" 14 | echo " " 15 | 16 | echo "--- LOCAL SERVER ---" 17 | echo " " 18 | 19 | echo "Generating passwordless keys if none..." 20 | SSH_FILE=/home/$(whoami)/.ssh/id_rsa 21 | if test -f "$SSH_FILE"; then 22 | echo "$SSH_FILE was found, skipping generation..." 23 | else 24 | echo "$SSH_FILE was NOT found, generating..." 25 | ssh-keygen -f $SSH_FILE -t rsa -N '' 26 | fi 27 | 28 | echo " " 29 | echo "--- REMOTE SERVER ---" 30 | echo " " 31 | 32 | 33 | echo "Creating .ssh directory if none" 34 | ssh -p $3 $1@$2 mkdir -p .ssh 35 | 36 | echo "Appending ssh key to authorized keys..." 37 | cat /home/$(whoami)/.ssh/id_rsa.pub | ssh -p $3 $1@$2 'cat >> .ssh/authorized_keys' 38 | 39 | echo "Setting .ssh permissions..." 40 | ssh -p $3 $1@$2 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys" 41 | 42 | echo " " 43 | echo "Done!" 44 | echo "Please try to SSh now:" 45 | echo "$1@$2" 46 | echo " " 47 | fi 48 | } 49 | 50 | alias setupsshkeys='setupSshKeys' 51 | alias setup-ssh-keys='setupsshkeys' 52 | -------------------------------------------------------------------------------- /.files_install_scripts/installGo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Make sure we pass our version 4 | if [ "$#" -ne 1 ]; then 5 | echo "Must pass the go version you would like to install" 6 | echo "Go Downloads page: https://golang.org/dl/" 7 | echo " " 8 | echo "USAGE: ./installGo.sh [Go version => \"1.8.1\"]" 9 | else 10 | # Install Go 11 | GO_VERSION=$1 12 | 13 | GO_OS="" 14 | if [ "$(uname)" == "Darwin" ]; then 15 | GO_OS="darwin-amd64" 16 | elif [ "$(dpkg --print-architecture)" == "armhf" ]; then 17 | GO_OS="linux-armv6l" 18 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then 19 | GO_OS="linux-amd64" 20 | fi 21 | 22 | echo "Downloading go$GO_VERSION.$GO_OS.tar.gz" 23 | curl -O https://storage.googleapis.com/golang/go$GO_VERSION.$GO_OS.tar.gz 24 | echo 'Unpacking go language' 25 | sudo tar -C /usr/local -xzf go$GO_VERSION.$GO_OS.tar.gz 26 | sudo chown -R root:root /usr/local/go 27 | #Cleanup 28 | sudo rm go$GO_VERSION.$GO_OS.tar.gz 29 | 30 | echo "Finished! Run the following code to set up your go paths in your bashrc if you have not already:" 31 | echo ' 32 | #Editing .bashrc 33 | BASHRC="~/.bashrc" 34 | echo "Setting up correct env. variables" 35 | echo "export GOROOT=/usr/local/go" >> $BASHRC 36 | echo "export GOPATH=~/goPath" >> $BASHRC 37 | echo "export PATH=\"$PATH:$GOROOT/bin:$GOPATH/bin\"" >> $BASHRC 38 | echo "export GO111MODULE=on" >> $BASHRC 39 | source $BASHRC 40 | 41 | #Create reuired go folders 42 | mkdir -p $GOPATH/{bin,pkg,src} 43 | ' 44 | fi 45 | -------------------------------------------------------------------------------- /.config/micro/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoclose": true, 3 | "autoindent": true, 4 | "autosave": false, 5 | "basename": false, 6 | "colorcolumn": 0, 7 | "colorscheme": "gruvbox", 8 | "cursorline": true, 9 | "eofnewline": true, 10 | "fastdirty": true, 11 | "fileformat": "unix", 12 | "filemanager-compressparent": true, 13 | "filemanager-foldersfirst": true, 14 | "filemanager-openonstart": false, 15 | "filemanager-showdotfiles": true, 16 | "filemanager-showignored": true, 17 | "ftoptions": true, 18 | "hidehelp": false, 19 | "ignorecase": false, 20 | "indentchar": " ", 21 | "infobar": true, 22 | "keepautoindent": false, 23 | "keymenu": false, 24 | "linter": true, 25 | "literate": true, 26 | "matchbrace": true, 27 | "matchbraceleft": false, 28 | "mouse": true, 29 | "pluginchannels": [ 30 | "https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json" 31 | ], 32 | "pluginrepos": [], 33 | "rmtrailingws": true, 34 | "ruler": true, 35 | "savecursor": false, 36 | "savehistory": true, 37 | "saveundo": false, 38 | "scrollbar": true, 39 | "scrollmargin": 3, 40 | "scrollspeed": 3, 41 | "softwrap": true, 42 | "splitbottom": true, 43 | "splitright": true, 44 | "statusline": true, 45 | "sucmd": "sudo", 46 | "syntax": true, 47 | "tabmovement": false, 48 | "tabsize": 2, 49 | "tabstospaces": true, 50 | "termtitle": false, 51 | "useprimary": true 52 | } 53 | -------------------------------------------------------------------------------- /.files_install_scripts/installFail2Ban.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fail2ban guide 4 | 5 | 6 | #Find a line containing the text, and replace the entire line with the other passed text 7 | #Reference: http://stackoverflow.com/questions/11245144/replace-whole-line-containing-a-string-using-sed 8 | #@param $1 - The First argument, The Text to be found in a file 9 | #@param $2 - The second argument, the line the will be replacing the entire first line 10 | #@param $3 - The Third/Last argument, the file this function will be run against 11 | find-replace-line() { 12 | sudo sed -i "s/^$1.*/$2/" $3 13 | } 14 | 15 | # Install fail2ban 16 | sudo apt-get update 17 | sudo apt-get install -y fail2ban 18 | 19 | # Copy into a jail.local 20 | sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local 21 | 22 | # Replace some lines in the file 23 | find-replace-line "bantime =" "bantime = 10000000" /etc/fail2ban/jail.local 24 | find-replace-line "findtime =" "findtime = 6000" /etc/fail2ban/jail.local 25 | find-replace-line "maxretry =" "maxretry = 10" /etc/fail2ban/jail.local 26 | 27 | # Enable for SSH 28 | # Remember we need to escape special characters!!! 29 | find-replace-line "\[sshd\]" "[sshd]\nenable = true" /etc/fail2ban/jail.local 30 | 31 | # Restart fail2ban 32 | sudo service fail2ban stop 33 | sudo service fail2ban start 34 | 35 | # Show fail2ban is working 36 | 37 | echo " " 38 | echo "fail2ban installed! use 'sudo fail2ban-client' for future use:" 39 | echo "showing some statuses..." 40 | echo " " 41 | 42 | sudo fail2ban-client status 43 | sudo fail2ban-client status sshd 44 | -------------------------------------------------------------------------------- /.files_work/amp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Google Amp productive funtions and aliases 4 | 5 | # See: https://github.com/ampproject/amphtml/blob/master/contributing/TESTING.md#testing-commands 6 | 7 | # Fix Java 8 | # https://github.com/ampproject/amphtml/issues/11574 9 | # export JAVA_HOME=`/usr/libexec/java_home -v 1.8` 10 | 11 | # Ampe pre commit - useful stuff to run before commiting to ensure travis builds are going to work 12 | ampprecommit() { 13 | gulp lint --local-changes 14 | gulp check-types --local-changes 15 | gulp test --local-changes 16 | # gulp presubmit 17 | } 18 | 19 | alias amp-pre-commit='ampprecommit' 20 | alias amppresubmit='ampprecommit' 21 | 22 | # Function to simply run the passed test file with optimal flags 23 | amptestfile() { 24 | gulp test --watch --files=$1 25 | } 26 | 27 | amptestlocalchanges() { 28 | gulp test --local-changes --watch 29 | } 30 | 31 | ampserveexample() { 32 | gulp --extensions_from=$1 --with_inabox 33 | } 34 | 35 | ampvisualdiff() { 36 | 37 | if [ $# -eq 0 ]; then 38 | echo "Must pass regex for tests you want to run." 39 | return 40 | fi 41 | 42 | echo " " 43 | echo "Don't forget to run 'gulp build --fortesting' before running visual diffs on clean project." 44 | echo " " 45 | echo "Don't forget to add PERCY_TOKEN in .files_work/.env" 46 | echo " " 47 | 48 | source ~/.files_work/.env 49 | 50 | echo "Using PERCY_TOKEN: $PERCY_TOKEN" 51 | 52 | sleep 1s 53 | 54 | gulp visual-diff --nobuild --percy_project ampproject/torch2424 --percy_token $PERCY_TOKEN --percy_branch master --grep $1 55 | } 56 | 57 | alias amptest='amptestfile' 58 | 59 | # Use our 'gitsyncfork' alias but for amphtml master 60 | alias gitsyncforkamp='gitsyncfork https://github.com/ampproject/amphtml.git' 61 | 62 | alias ampvisual='ampvisualdiff' 63 | alias amppercy='ampvisual' 64 | -------------------------------------------------------------------------------- /.files_libs/gifgen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Taken From: https://github.com/lukechilds/gifgen 4 | 5 | # Echo help/usage message 6 | show_help() { 7 | echo "gifgen 1.1.2" 8 | echo 9 | echo "Usage: gifgen [options] [input]" 10 | echo 11 | echo "Options:" 12 | echo " -o Output file [input.gif]" 13 | echo " -f Frames per second [10]" 14 | echo " -s Optimize for static background" 15 | echo " -v Display verbose output from ffmpeg" 16 | echo 17 | echo "Examples:" 18 | echo " $ gifgen video.mp4" 19 | echo " $ gifgen -o demo.gif SCM_1457.mp4" 20 | echo " $ gifgen -sf 15 screencap.mov" 21 | } 22 | 23 | # Setup defaults 24 | pid=$$ 25 | palette="/tmp/gif-palette-$pid.png" 26 | fps="10" 27 | verbosity="warning" 28 | stats_mode="full" 29 | dither="sierra2_4a" 30 | 31 | # Parse args 32 | while getopts "hi:o:f:sv" opt; do 33 | case "$opt" in 34 | h) 35 | show_help=true 36 | ;; 37 | o) 38 | output=$OPTARG 39 | ;; 40 | f) 41 | fps=$OPTARG 42 | ;; 43 | s) 44 | stats_mode="diff" 45 | dither="none" 46 | ;; 47 | v) 48 | verbosity="info" 49 | ;; 50 | esac 51 | done 52 | shift "$((OPTIND-1))" 53 | # Grab input file from end of command 54 | input=$1 55 | 56 | # Show help and exit if we have no input 57 | [[ "$input" = "" ]] || [[ $show_help = true ]] && show_help && exit 58 | 59 | # Check for ffmpeg before encoding 60 | type ffmpeg >/dev/null 2>&1 || { 61 | echo "Error: gifgen requires ffmpeg to be installed" 62 | exit 1 63 | } 64 | 65 | # Set output if not specified 66 | if [[ "$output" = "" ]]; then 67 | input_filename=${input##*/} 68 | output=${input_filename%.*}.gif 69 | fi 70 | 71 | # Encode GIF 72 | echo "Generating palette..." 73 | ffmpeg -v "$verbosity" -i "$input" -vf "fps=$fps,palettegen=stats_mode=$stats_mode" -y "$palette" 74 | [[ "$verbosity" = "info" ]] && echo 75 | echo "Encoding GIF..." 76 | ffmpeg -v "$verbosity" -i "$input" -i "$palette" -lavfi "fps=$fps [x]; [x][1:v] paletteuse=dither=$dither" -y "$output" 77 | echo "Done!" 78 | -------------------------------------------------------------------------------- /.files_install_scripts/old-installCaddy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script to install and build my custom fork of caddy at: 4 | # https://github.com/torch2424/caddy 5 | # Please see my reason for doing this at: 6 | # https://github.com/torch2424/dotFiles/issues/12 7 | 8 | 9 | # Slightly Go version parser 10 | # https://gist.github.com/pyk/ab63cfbd53668c3eed50 11 | function go_version { 12 | version=$(go version) 13 | regex="([0-9][0-9]?.[0-9][0-9]?.[0-9][0-9]?)" 14 | if [[ $version =~ $regex ]]; then 15 | echo ${BASH_REMATCH[1]} 16 | fi 17 | } 18 | 19 | # Check go to be installed 20 | go version > /dev/null 21 | if [ $? -eq 0 ]; then 22 | # https://stackoverflow.com/questions/30874579/bash-comparison-of-version-strings-with-2-dots 23 | GO_VERSION="$(echo $(go_version) | sed 's/\.//g')" 24 | MIN_VERSION="$(echo "1.8.0" | sed 's/\.//g')" 25 | 26 | echo " " 27 | echo " " 28 | echo "Comparing Go Versions, to ensure it is compatible for Caddy..." 29 | echo "Current Go Version: $GO_VERSION" 30 | echo "Min Go Version: $MIN_VERSION" 31 | echo " " 32 | echo " " 33 | 34 | # Compare our versions 35 | if [ "$GO_VERSION" -gt "$MIN_VERSION" ]; then 36 | 37 | # Install caddy from source 38 | # https://www.calhoun.io/building-caddy-server-from-source/ 39 | echo " " 40 | echo "Getting 'github.com/torch2424/caddy' and 'github.com/caddyserver/builds' ..." 41 | echo " " 42 | cd $GOPATH/src 43 | go get -u github.com/torch2424/caddy 44 | go get -u github.com/caddyserver/builds 45 | 46 | echo " " 47 | echo "Building Caddy for current architecture (May need to check script if this part fails)..." 48 | echo " " 49 | cd $GOPATH/src/github.com/torch2424/caddy/caddy 50 | # May need to pass -goos= and -goarch= 51 | go run build.go 52 | 53 | # Copy to our go path bin 54 | cp caddy "$GOPATH/bin" 55 | 56 | echo "Build Complete! Please check \$GOPATH/src/github.com/torch2424/caddy/caddy" 57 | echo "For Instance:" 58 | echo " " 59 | echo "'cd \$GOPATH/src/github.com/torch2424/caddy/caddy'" 60 | echo "'./caddy'" 61 | echo " " 62 | echo "Copied to the binary to: $GOPATH/bin" 63 | echo "However, you may now copy this binary wherever you would like..." 64 | else 65 | echo "Caddy requires Go 1.8 to be installed." 66 | fi 67 | else 68 | echo "Caddy requires Go 1.8 to be installed." 69 | fi 70 | -------------------------------------------------------------------------------- /.files_templates/createAndCopySystemctlService.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Creates a systemctl service with correct usage 4 | 5 | # Helper function 6 | # https://www.cyberciti.biz/faq/how-to-use-sed-to-find-and-replace-text-in-files-in-linux-unix-shell/ 7 | # $1: What to search for 8 | # $2: replacement 9 | # $3 file 10 | __find_and_replace_in_file() { 11 | sed -i -e "s/$1/$2/g" $3 12 | } 13 | 14 | # Helper function from: https://github.com/torch2424/bebop.sh/blob/master/bebop.sh 15 | __seek_confirmation() { 16 | printf "\n${bold}$@${reset}" 17 | read -p " (y/n) " -n 1 18 | printf "\n" 19 | } 20 | 21 | # Helper function from: https://github.com/torch2424/bebop.sh/blob/master/bebop.sh 22 | __is_confirmed() { 23 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then 24 | return 0 25 | fi 26 | return 1 27 | } 28 | 29 | if [ "$#" -lt 3 ]; then 30 | echo "USAGE: ./createAndCopySystemctlService.sh : Generate systemctl service for the current user, and copies to /etc/systemd/system, as well as keeps a copy in current directory" 31 | echo " " 32 | echo "./createAndCopySystemctlService.sh [service name without .service] [Directory to navigate to] [Command to run in quotes]" 33 | else 34 | 35 | # Copy the cyctemctl service to temp 36 | cp systemctl.service /tmp/tmpSystemctl.service 37 | __find_and_replace_in_file "\[USER\]" "$(whoami)" /tmp/tmpSystemctl.service 38 | 39 | DIRECTORY=$(realpath $2) 40 | #https://unix.stackexchange.com/questions/265267/bash-converting-path-names-for-sed-so-they-escape/265572 41 | DIRECTORY_ESCAPED=${DIRECTORY//\//\\/} 42 | __find_and_replace_in_file "\[DIRECTORY\]" "$DIRECTORY_ESCAPED" /tmp/tmpSystemctl.service 43 | 44 | __find_and_replace_in_file "\[COMMAND\]" "$3" /tmp/tmpSystemctl.service 45 | 46 | echo " " 47 | echo "Resulting $1.service file..." 48 | echo " " 49 | 50 | cat /tmp/tmpSystemctl.service 51 | 52 | echo " " 53 | __seek_confirmation "Does this look okay?" 54 | 55 | if __is_confirmed; then 56 | cp /tmp/tmpSystemctl.service "./$1.service" 57 | sudo cp /tmp/tmpSystemctl.service "/etc/systemd/system/$1.service" 58 | echo " " 59 | echo "Copied to ./$1.service, and /etc/systemd/system/$1.service" 60 | echo " " 61 | echo "Done!" 62 | echo " " 63 | echo "NOTE: If this service needs to be restarted by a script, but dont want to get prompted for password" 64 | echo "Check out: https://askubuntu.com/questions/692701/allowing-user-to-run-systemctl-systemd-services-without-password" 65 | echo "Edit sudoers file with 'sudo visudo -f /etc/sudoers' and then add: 'MY_USER ALL=NOPASSWD: /bin/systemctl'" 66 | echo "And make sure to use sudo /bin/systemctl , not just sudo systemctl" 67 | echo " " 68 | else 69 | echo " " 70 | echo "Cancelled." 71 | echo " " 72 | fi 73 | fi 74 | -------------------------------------------------------------------------------- /.hyper.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | config: { 3 | // default font size in pixels for all tabs 4 | fontSize: 13, 5 | 6 | // font family with optional fallbacks 7 | fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', 8 | 9 | // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) 10 | cursorColor: 'rgba(248,28,229,0.8)', 11 | 12 | // `BEAM` for |, `UNDERLINE` for _, `BLOCK` for █ 13 | cursorShape: 'BLOCK', 14 | 15 | // If true, cursor will blink 16 | cursorBlink: true, 17 | 18 | // color of the text 19 | foregroundColor: '#fff', 20 | 21 | // terminal background color 22 | backgroundColor: '#000', 23 | 24 | // border color (window, tabs) 25 | borderColor: '#333', 26 | 27 | // custom css to embed in the main window 28 | css: '', 29 | 30 | // custom css to embed in the terminal window 31 | termCSS: 'margin-top:-15px', 32 | 33 | // custom padding (css format, i.e.: `top right bottom left`) 34 | padding: '5px 5px 20px 5px', 35 | 36 | // the full list. if you're going to provide the full color palette, 37 | // including the 6 x 6 color cubes and the grayscale map, just provide 38 | // an array here instead of a color map object 39 | colors: { 40 | black: '#020202', 41 | red: '#ff0000', 42 | green: '#33ff00', 43 | yellow: '#ffff00', 44 | blue: '#0066ff', 45 | magenta: '#cc00ff', 46 | cyan: '#00ffff', 47 | white: '#d0d0d0', 48 | lightBlack: '#808080', 49 | lightRed: '#ff0000', 50 | lightGreen: '#33ff00', 51 | lightYellow: '#ffff00', 52 | lightBlue: '#0066ff', 53 | lightMagenta: '#cc00ff', 54 | lightCyan: '#00ffff', 55 | lightWhite: '#ffffff' 56 | }, 57 | 58 | // the shell to run when spawning a new session (i.e. /usr/local/bin/fish) 59 | // if left empty, your system's login shell will be used by default 60 | shell: '', 61 | 62 | // for setting shell arguments (i.e. for using interactive shellArgs: ['-i']) 63 | // by default ['--login'] will be used 64 | shellArgs: ['--login'], 65 | 66 | // for environment variables 67 | env: {}, 68 | 69 | // set to false for no bell 70 | bell: 'SOUND', 71 | 72 | // if true, selected text will automatically be copied to the clipboard 73 | copyOnSelect: false, 74 | 75 | // URL to custom bell 76 | bellSoundURL: 'https://files.aaronthedev.com/$/nsspe' 77 | 78 | // for advanced config flags please refer to https://hyper.is/#cfg 79 | }, 80 | 81 | // a list of plugins to fetch and install from npm 82 | // format: [@org/]project[#version] 83 | // examples: 84 | // `hyperpower` 85 | // `@company/project` 86 | // `project#1.0.1` 87 | plugins: [ 88 | "hyperterm-gruvbox-dark", 89 | "hyperfullscreen" 90 | ], 91 | 92 | // in development, you can create a directory under 93 | // `~/.hyper_plugins/local/` and include it here 94 | // to load it and avoid it being `npm install`ed 95 | localPlugins: [] 96 | }; 97 | -------------------------------------------------------------------------------- /.files_install_scripts/installNpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Bebop helper functions 4 | # https://github.com/torch2424/bebop.sh/blob/master/bebop.sh 5 | __seek_confirmation() { 6 | printf "\n${bold}$@${reset}" 7 | read -p " (y/n) " -n 1 8 | printf "\n" 9 | } 10 | __is_confirmed() { 11 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then 12 | return 0 13 | fi 14 | return 1 15 | } 16 | 17 | # Don't allow running as root, as it will not work 18 | if [ "$EUID" == 0 ] 19 | then echo "Do not run as root. Run as your user to get nvm, and no sudo npm install -g working :)" 20 | exit 21 | fi 22 | 23 | # Ask if can download and run the nvm install script 24 | echo " " 25 | echo "To install Node/Npm, we will be using nvm" 26 | echo "The best way to install nvm is by using the install script provided on the github repo." 27 | echo "Which can be done with: 'curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash'" 28 | echo "Please confirm that the following bash script is okay:" 29 | echo " " 30 | echo "https://raw.githubusercontent.com/creationix/nvm/master/install.sh" 31 | echo " " 32 | __seek_confirmation "Is it alright to run this script?" 33 | 34 | if __is_confirmed; then 35 | #Install NVM (Node Version Manager) 36 | mkdir $HOME/.nvm 37 | curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash 38 | source ~/.bashrc 39 | else 40 | echo " " 41 | echo "Please install nvm manually at: https://github.com/creationix/nvm" 42 | echo " " 43 | exit 1 44 | fi 45 | 46 | # Check nvm to be installed 47 | nvm --version > /dev/null 48 | if [ $? -eq 0 ]; then 49 | echo " " 50 | echo "Installing latest stable Node using nvm..." 51 | echo " " 52 | 53 | #Install Node 54 | nvm install stable 55 | node -v 56 | 57 | # Echo how to set global npm packages in Home directory 58 | echo " " 59 | echo "PLEASE READ THIS:" 60 | echo 'npm is notorious for getting permissions messed up, for using "sudo npm install -g ..." in inappropriate places' 61 | echo "If you would like to have global packages installed to your home directory, and this is reccomended, please add the following to your .bashrc" 62 | echo 'Please note, if you do enable this, you will no longer need "sudo npm install -g .." and you should not be using sudo for this, as the packages are installed in your home directory' 63 | echo "------------------------------------------" 64 | echo "~/.bashrc" 65 | echo " " 66 | echo '# Npm no Sudo 67 | export NPM_PACKAGES="~/.npm-packages" 68 | export NODE_PATH="$NPM_PACKAGES/lib/node_modules${NODE_PATH:+:$NODE_PATH}" 69 | export PATH="$NPM_PACKAGES/bin:$PATH" 70 | # Unset manpath so we can inherit from /etc/manpath via the `manpath` 71 | # command 72 | unset MANPATH # delete if you already modified MANPATH elsewhere in your config 73 | export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"' 74 | 75 | echo " " 76 | echo "Welome to the world of Node.js!" 77 | echo " " 78 | else 79 | echo " " 80 | echo "Nvm is not installed, please check your ~/.bashrc to ensure it is in your PATH, or that if it installed correctly." 81 | echo " " 82 | exit 1 83 | fi 84 | -------------------------------------------------------------------------------- /.conkyrc: -------------------------------------------------------------------------------- 1 | ############################################## 2 | # Settings 3 | ############################################## 4 | background yes 5 | use_xft yes 6 | xftfont sans:pixelsize=11 7 | xftalpha 1 8 | update_interval 1.0 9 | total_run_times 0 10 | own_window yes 11 | own_window_argb_visual yes 12 | # Going to use semi transparent background 13 | #own_window_transparent yes 14 | own_window_argb_value 180 15 | own_window_type desktop 16 | own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager 17 | double_buffer yes 18 | minimum_size 200 200 19 | maximum_width 280 20 | draw_shades no 21 | draw_outline yes 22 | draw_borders no 23 | draw_graph_borders no 24 | 25 | #default_color 656667 #Default Grey 26 | #default_color fff1a1 #A Bright Yellow 27 | #default_color cd8905 #An orange color 28 | default_color ffffff 29 | 30 | default_shade_color 000000 31 | default_outline_color 000000 32 | alignment top_right 33 | gap_x 12 34 | gap_y 56 35 | no_buffers yes 36 | uppercase no 37 | cpu_avg_samples 2 38 | override_utf8_locale yes 39 | short_units yes 40 | temperature_unit fahrenheit 41 | ############################################## 42 | # Output 43 | ############################################## 44 | #leet chars: ┤┤└└┴┴┐┐││┘┘┌┌├├┬┬┼┼┴┴── ││ ▽▼△▲▵▴▾▿ 45 | TEXT 46 | ┌───────────────────────────┐ 47 | │ Uptime: $uptime$alignr${offset -1}│ 48 | ├───────────────────────────┤ 49 | │ Battery: $battery$alignr${offset -1}│ 50 | ├┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┬┤ 51 | 52 | ┌ CPU 0 usage:$alignr ${offset -1}${cpu cpu0}% ┐ 53 | ├ CPU 1 usage:$alignr ${offset -1}${cpu cpu1}% ┤ 54 | ├ CPU 2 usage:$alignr ${offset -1}${cpu cpu2}% ┤ 55 | └ CPU 3 usage:$alignr ${offset -1}${cpu cpu3}% ┘ 56 | 57 | └┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┘ 58 | 59 | 60 | RAM:$alignr$mem // $memmax 61 | ${membar 15,130} ${voffset -10}$alignr$memperc% Used 62 | 63 | 64 | 65 | / $alignr ${fs_used /} ${fs_bar 6,45 /} ${fs_size /} 66 | ├─ /home $alignr${fs_used /home} ${fs_bar 6,45 /home} ${fs_size /home} 67 | ├─ /usr $alignr ${fs_used /usr} ${fs_bar 6,45 /usr} ${fs_size /usr} 68 | ├─ /opt $alignr ${fs_used /opt} ${fs_bar 6,45 /opt} ${fs_size /opt} 69 | ├─ /var $alignr ${fs_used /var} ${fs_bar 6,45 /var} ${fs_size /var} 70 | └─ /tmp $alignr ${fs_used /tmp} ${fs_bar 6,45 /tmp} ${fs_size /tmp} 71 | 72 | Swap:$alignr $swap ${swapbar 6,45} $swapmax 73 | 74 | $alignc::::::::::::::: 75 | 76 | eth0: $alignr ${offset -4}${addr eth0} 77 | ┌───────────────────────────┐ 78 | ├:::: Up:$alignr ${offset -10}${upspeedf eth0} 79 | └:::: Down:$alignr ${offset -10}${downspeedf eth0} 80 | 81 | wlan0: $alignr ${offset -4}${addr wlan0} 82 | ┌───────────────────────────┐ 83 | ├:::: Up:$alignr ${offset -10}${upspeedf wlan0} 84 | └:::: Down:$alignr ${offset -10}${downspeedf wlan0} 85 | 86 | 87 | # No Weather for now 88 | #┌───────────────────────────┐ 89 | #│ Temp:$alignr${offset -1}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ kcak temperature 15}°F │ 90 | #│ Humidity:$alignr${offset -1}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ kcak humidity 15}% │ 91 | #│ Conditions:$alignr${offset -1}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ kcak cloud_cover 15} │ 92 | #│ Activity:$alignr${offset -1}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ kcak weather 15} │ 93 | #└───────────────────────────┘ 94 | -------------------------------------------------------------------------------- /.files_functions/gitgif.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | __gitgif() { 5 | if [ $# -lt 1 ] || [ $# -gt 6 ]; then 6 | echo "This will make a best guess to convert a video into a github friendly .gif" 7 | echo "Works best on videos ~30s" 8 | echo "Default values will give you a ~4 MB file" 9 | echo " " 10 | echo " " 11 | echo "USAGE:" 12 | echo " " 13 | echo "gitgif [video file e.g (example.mp4)] [Optional: width of new video to scale to. Default: 1000] [Optional: fps of the output gif] [Optional: Input FPS of the Input video. Default: 30] [Optional: Where to start the gif in the input video. In seconds. Default: 0] [Optional: Where to end the gif in the input video. In Seconds. Default: Video End time ]" 14 | elif ! type "ffmpeg" > /dev/null 2>&1; then 15 | echo "ffmpeg and gifgen are required for $0" 16 | echo "OSX: brew install lukechilds/tap/gifgen" 17 | echo "OSX: brew install ffmpeg" 18 | echo "Ubuntu: https://github.com/lukechilds/gifgen" 19 | echo "Ubuntu: sudo apt-get install ffmpeg" 20 | elif ! type "gifgen" > /dev/null 2>&1; then 21 | echo "ffmpeg and gifgen are required for $0" 22 | echo "OSX: brew install lukechilds/tap/gifgen" 23 | echo "OSX: brew install ffmpeg" 24 | echo "Ubuntu: https://github.com/lukechilds/gifgen" 25 | echo "Ubuntu: sudo apt-get install ffmpeg" 26 | else 27 | 28 | # Get the dimensions of the video 29 | eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width $1) 30 | WIDTH=${streams_stream_0_width} 31 | 32 | # Define our temporary gif path 33 | TEMP="/tmp/gitgif.gif" 34 | 35 | # Resize the video to about 500 36 | BASEWIDTH=1000 37 | # Check if we passed a width 38 | if [ -z $2 ]; then 39 | BASEWIDTH=1000 40 | else 41 | BASEWIDTH=$2 42 | fi 43 | 44 | # FPS of the Gif 45 | GIF_FPS=15 46 | # Check if we passed a gif FPS 47 | if [ -z $3 ]; then 48 | GIF_FPS=15 49 | else 50 | GIF_FPS=$3 51 | fi 52 | 53 | # FPS of the video 54 | INPUT_FPS=30 55 | # Check if we passed a FPS 56 | if [ -z $4 ]; then 57 | INPUT_FPS=30 58 | else 59 | INPUT_FPS=$4 60 | fi 61 | 62 | # FPS of the output ffmpeg video 63 | OUTPUT_FPS=30 64 | 65 | # Set a start time 66 | STARTTIME=0 67 | if [ -z $5 ]; then 68 | unset STARTTIME 69 | else 70 | STARTTIME=$5 71 | fi 72 | 73 | # Set a durtation 74 | ENDTIME=0 75 | if [ -z $6 ]; then 76 | unset ENDTIME 77 | else 78 | ENDTIME=$6 79 | fi 80 | 81 | if [ $WIDTH -gt $BASEWIDTH ]; then 82 | # Allow CTRL C 83 | trap "exit" INT 84 | until ffmpeg -y -i $1 \ 85 | -framerate $INPUT_FPS -r $OUTPUT_FPS \ 86 | ${STARTTIME:+ -ss "${STARTTIME}"} \ 87 | ${ENDTIME:+ -to "${ENDTIME}"} \ 88 | -vf scale=$BASEWIDTH:-1 \ 89 | $TEMP 90 | do 91 | # Allow CTRL C 92 | sl -e 93 | # Down size the base width as it must not be an even number 94 | BASEWIDTH=$((BASEWIDTH - 1)) 95 | done 96 | else 97 | cp $1 $TEMP 98 | fi 99 | 100 | # Get the filename 101 | FILENAME=$(basename $1) 102 | FILENAME="${FILENAME%.*}" 103 | 104 | # Install gifgen: 105 | # https://github.com/lukechilds/gifgen 106 | # Generate the gif 107 | gifgen -f $GIF_FPS -o "$FILENAME.gif" $TEMP 108 | fi 109 | } 110 | 111 | alias gg='__gitgif' 112 | alias gitgif='gg' 113 | alias githubgif='gg' 114 | alias preetypr='gg' 115 | alias gif='gg' 116 | -------------------------------------------------------------------------------- /.files_completion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Some shortcuts for bash completion on all current functions and aliases 4 | 5 | # https://superuser.com/questions/436314/how-can-i-get-bash-to-perform-tab-completion-for-my-aliases 6 | # Automatically add completion for all aliases to commands having completion functions 7 | function alias_completion { 8 | local namespace="alias_completion" 9 | 10 | # parse function based completion definitions, where capture group 2 => function and 3 => trigger 11 | local compl_regex='complete( +[^ ]+)* -F ([^ ]+) ("[^"]+"|[^ ]+)' 12 | # parse alias definitions, where capture group 1 => trigger, 2 => command, 3 => command arguments 13 | local alias_regex="alias ([^=]+)='(\"[^\"]+\"|[^ ]+)(( +[^ ]+)*)'" 14 | 15 | # create array of function completion triggers, keeping multi-word triggers together 16 | eval "local completions=($(complete -p | sed -Ene "/$compl_regex/s//'\3'/p"))" 17 | (( ${#completions[@]} == 0 )) && return 0 18 | 19 | # create temporary file for wrapper functions and completions 20 | rm -f "/tmp/${namespace}-*.tmp" # preliminary cleanup 21 | local tmp_file; tmp_file="$(mktemp "/tmp/${namespace}-${RANDOM}XXX.tmp")" || return 1 22 | 23 | local completion_loader; completion_loader="$(complete -p -D 2>/dev/null | sed -Ene 's/.* -F ([^ ]*).*/\1/p')" 24 | 25 | # read in " '' ''" lines from defined aliases 26 | local line; while read line; do 27 | eval "local alias_tokens; alias_tokens=($line)" 2>/dev/null || continue # some alias arg patterns cause an eval parse error 28 | local alias_name="${alias_tokens[0]}" alias_cmd="${alias_tokens[1]}" alias_args="${alias_tokens[2]# }" 29 | 30 | # skip aliases to pipes, boolean control structures and other command lists 31 | # (leveraging that eval errs out if $alias_args contains unquoted shell metacharacters) 32 | eval "local alias_arg_words; alias_arg_words=($alias_args)" 2>/dev/null || continue 33 | # avoid expanding wildcards 34 | read -a alias_arg_words <<< "$alias_args" 35 | 36 | # skip alias if there is no completion function triggered by the aliased command 37 | if [[ ! " ${completions[*]} " =~ " $alias_cmd " ]]; then 38 | if [[ -n "$completion_loader" ]]; then 39 | # force loading of completions for the aliased command 40 | eval "$completion_loader $alias_cmd" 41 | # 124 means completion loader was successful 42 | [[ $? -eq 124 ]] || continue 43 | completions+=($alias_cmd) 44 | else 45 | continue 46 | fi 47 | fi 48 | local new_completion="$(complete -p "$alias_cmd")" 49 | 50 | # create a wrapper inserting the alias arguments if any 51 | if [[ -n $alias_args ]]; then 52 | local compl_func="${new_completion/#* -F /}"; compl_func="${compl_func%% *}" 53 | # avoid recursive call loops by ignoring our own functions 54 | if [[ "${compl_func#_$namespace::}" == $compl_func ]]; then 55 | local compl_wrapper="_${namespace}::${alias_name}" 56 | echo "function $compl_wrapper { 57 | (( COMP_CWORD += ${#alias_arg_words[@]} )) 58 | COMP_WORDS=($alias_cmd $alias_args \${COMP_WORDS[@]:1}) 59 | (( COMP_POINT -= \${#COMP_LINE} )) 60 | COMP_LINE=\${COMP_LINE/$alias_name/$alias_cmd $alias_args} 61 | (( COMP_POINT += \${#COMP_LINE} )) 62 | $compl_func 63 | }" >> "$tmp_file" 64 | new_completion="${new_completion/ -F $compl_func / -F $compl_wrapper }" 65 | fi 66 | fi 67 | 68 | # replace completion trigger by alias 69 | new_completion="${new_completion% *} $alias_name" 70 | echo "$new_completion" >> "$tmp_file" 71 | done < <(alias -p | sed -Ene "s/$alias_regex/\1 '\2' '\3'/p") 72 | source "$tmp_file" && rm -f "$tmp_file" 73 | }; alias_completion 74 | -------------------------------------------------------------------------------- /.files_libs/sshrc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | function sshrc() { 3 | local SSHHOME=${SSHHOME:=~} 4 | if [ -f $SSHHOME/.sshrc ]; then 5 | local files=.sshrc 6 | if [ -d $SSHHOME/.sshrc.d ]; then 7 | files="$files .sshrc.d" 8 | fi 9 | SIZE=$(tar cfz - -h -C $SSHHOME $files | wc -c) 10 | if [ $SIZE -gt 65536 ]; then 11 | echo >&2 $'.sshrc.d and .sshrc files must be less than 64kb\ncurrent size: '$SIZE' bytes' 12 | exit 1 13 | fi 14 | if [ -z "$CMDARG" -a ! -e ~/.sshrc.d/.hushlogin ]; then 15 | WELCOME_MSG=" 16 | if [ ! -e ~/.hushlogin ]; then 17 | if [ -e /etc/motd ]; then cat /etc/motd; fi 18 | if [ -e /etc/update-motd.d ]; then run-parts /etc/update-motd.d/ 2>/dev/null; fi 19 | last -F \$USER 2>/dev/null | grep -v 'still logged in' | head -n1 | awk '{print \"Last login:\",\$4,\$5,\$6,\$7,\$8,\"from\",\$3;}' 20 | fi 21 | " 22 | else 23 | WELCOME_MSG="" 24 | fi 25 | ssh -t "$DOMAIN" $SSHARGS " 26 | command -v openssl >/dev/null 2>&1 || { echo >&2 \"sshrc requires openssl to be installed on the server, but it's not. Aborting.\"; exit 1; } 27 | $WELCOME_MSG 28 | export SSHHOME=\$(mktemp -d -t .$(whoami).sshrc.XXXX) 29 | export SSHRCCLEANUP=\$SSHHOME 30 | trap \"rm -rf \$SSHRCCLEANUP; exit\" 0 31 | echo $'"$(cat "$0" | openssl enc -base64)"' | tr -s ' ' $'\n' | openssl enc -base64 -d > \$SSHHOME/sshrc 32 | chmod +x \$SSHHOME/sshrc 33 | 34 | echo $'"$( cat << 'EOF' | openssl enc -base64 35 | if [ -r /etc/profile ]; then source /etc/profile; fi 36 | if [ -r ~/.bash_profile ]; then source ~/.bash_profile 37 | elif [ -r ~/.bash_login ]; then source ~/.bash_login 38 | elif [ -r ~/.profile ]; then source ~/.profile 39 | fi 40 | export PATH=$PATH:$SSHHOME 41 | source $SSHHOME/.sshrc; 42 | EOF 43 | )"' | tr -s ' ' $'\n' | openssl enc -base64 -d > \$SSHHOME/sshrc.bashrc 44 | 45 | echo $'"$( cat << 'EOF' | openssl enc -base64 46 | #!/usr/bin/env bash 47 | exec bash --rcfile <(echo ' 48 | [ -r /etc/profile ] && source /etc/profile 49 | if [ -r ~/.bash_profile ]; then source ~/.bash_profile 50 | elif [ -r ~/.bash_login ]; then source ~/.bash_login 51 | elif [ -r ~/.profile ]; then source ~/.profile 52 | fi 53 | source '$SSHHOME'/.sshrc; 54 | export PATH=$PATH:'$SSHHOME' 55 | ') "$@" 56 | EOF 57 | )"' | tr -s ' ' $'\n' | openssl enc -base64 -d > \$SSHHOME/bashsshrc 58 | chmod +x \$SSHHOME/bashsshrc 59 | 60 | echo $'"$(tar czf - -h -C $SSHHOME $files | openssl enc -base64)"' | tr -s ' ' $'\n' | openssl enc -base64 -d | tar mxzf - -C \$SSHHOME 61 | export SSHHOME=\$SSHHOME 62 | echo \"$CMDARG\" >> \$SSHHOME/sshrc.bashrc 63 | bash --rcfile \$SSHHOME/sshrc.bashrc 64 | " 65 | else 66 | echo "No such file: $SSHHOME/.sshrc" >&2 67 | exit 1 68 | fi 69 | } 70 | 71 | function sshrc_parse() { 72 | while [[ -n $1 ]]; do 73 | case $1 in 74 | -b | -c | -D | -E | -e | -F | -I | -i | -L | -l | -m | -O | -o | -p | -Q | -R | -S | -W | -w ) 75 | SSHARGS="$SSHARGS $1 $2"; shift ;; 76 | -* ) 77 | SSHARGS="$SSHARGS $1" ;; 78 | *) 79 | if [ -z "$DOMAIN" ]; then 80 | DOMAIN="$1" 81 | else 82 | local SEMICOLON=$([[ "$@" = *[![:space:]]* ]] && echo '; ') 83 | CMDARG="$@$SEMICOLON exit" 84 | return; 85 | fi 86 | ;; 87 | esac 88 | shift 89 | done 90 | if [ -z $DOMAIN ]; then 91 | ssh $SSHARGS; exit 1; 92 | fi 93 | } 94 | 95 | command -v openssl >/dev/null 2>&1 || { echo >&2 "sshrc requires openssl to be installed locally, but it's not. Aborting."; exit 1; } 96 | sshrc_parse "$@" 97 | sshrc 98 | -------------------------------------------------------------------------------- /.files_libs/bebop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Bebop.sh 4 | # By: torch2424 5 | # repo: https://github.com/torch2424/bebop.sh 6 | # LICENSE: Apache 2.0 7 | 8 | 9 | # Simply print some new lines for a script 10 | print-spacing() { 11 | echo " " 12 | echo " " 13 | } 14 | 15 | # Prompt the user for sudo access 16 | get-sudo() { 17 | [ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" 18 | } 19 | 20 | # Timeout before running next command 21 | command-delay() { 22 | sleep 2 23 | } 24 | 25 | #Find a line containing the text, and replace the entire line with the other passed text 26 | #Reference: http://stackoverflow.com/questions/11245144/replace-whole-line-containing-a-string-using-sed 27 | #@param $1 - The First argument, The Text to be found in a file 28 | #@param $2 - The second argument, the line the will be replacing the entire first line 29 | #@param $3 - The Third/Last argument, the file this function will be run against 30 | find-replace-line() { 31 | sed -i "/$1/c$2" $3 32 | } 33 | 34 | # Set Colors 35 | # Taken From: https://natelandau.com/bash-scripting-utilities/ 36 | 37 | bold=$(tput bold) 38 | underline=$(tput sgr 0 1) 39 | reset=$(tput sgr0) 40 | 41 | purple=$(tput setaf 171) 42 | red=$(tput setaf 1) 43 | green=$(tput setaf 76) 44 | tan=$(tput setaf 3) 45 | blue=$(tput setaf 38) 46 | 47 | # Headers and Logging 48 | # Taken From: https://natelandau.com/bash-scripting-utilities/ 49 | 50 | e_header() { printf "\n${bold}${purple}==== %s ====${reset}\n" "$@" 51 | } 52 | e_arrow() { printf "~~> $@\n" 53 | } 54 | e_success() { printf "${green}* %s${reset}\n" "$@" 55 | } 56 | e_error() { printf "${red}X %s${reset}\n" "$@" 57 | } 58 | e_warning() { printf "${tan}~~> %s${reset}\n" "$@" 59 | } 60 | e_underline() { printf "${underline}${bold}%s${reset}\n" "$@" 61 | } 62 | e_bold() { printf "${bold}%s${reset}\n" "$@" 63 | } 64 | e_note() { printf "${underline}${bold}${blue}Note:${reset} ${blue}%s${reset}\n" "$@" 65 | } 66 | 67 | # USAGE FOR SEEKING CONFIRMATION 68 | # seek_confirmation "Ask a question" 69 | # Credt: https://github.com/kevva/dotfiles 70 | # Taken From: https://natelandau.com/bash-scripting-utilities/ 71 | # 72 | # if is_confirmed; then 73 | # some action 74 | # else 75 | # some other action 76 | # fi 77 | 78 | seek_confirmation() { 79 | printf "\n${bold}$@${reset}" 80 | read -p " (y/n) " -n 1 81 | printf "\n" 82 | } 83 | 84 | # underlined 85 | seek_confirmation_head() { 86 | printf "\n${underline}${bold}$@${reset}" 87 | read -p "${underline}${bold} (y/n)${reset} " -n 1 88 | printf "\n" 89 | } 90 | 91 | # Test whether the result of an 'ask' is a confirmation 92 | is_confirmed() { 93 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then 94 | return 0 95 | fi 96 | return 1 97 | } 98 | 99 | # Test whether a command exists 100 | # $1 = cmd to test 101 | # Taken From: https://natelandau.com/bash-scripting-utilities/ 102 | # Usage: 103 | # if type_exists 'git'; then 104 | # some action 105 | # else 106 | # some other action 107 | # fi 108 | 109 | type_exists() { 110 | if [ $(type -P $1) ]; then 111 | return 0 112 | fi 113 | return 1 114 | } 115 | 116 | # Test which OS the user runs 117 | # Taken From: https://natelandau.com/bash-scripting-utilities/ 118 | # $1 = OS to test 119 | # Usage: if is_os 'darwin'; then 120 | 121 | is_os() { 122 | if [[ "${OSTYPE}" == $1* ]]; then 123 | return 0 124 | fi 125 | return 1 126 | } 127 | -------------------------------------------------------------------------------- /.files_libs/github-markdown-toc/gh-md-toc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Steps: 5 | # 6 | # 1. Download corresponding html file for some README.md: 7 | # curl -s $1 8 | # 9 | # 2. Discard rows where no substring 'user-content-' (github's markup): 10 | # awk '/user-content-/ { ... 11 | # 12 | # 3.1 Get last number in each row like ' ... sitemap.js.*<\/h/)+2, RLENGTH-5) 21 | # 22 | # 5. Find anchor and insert it inside "(...)": 23 | # substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) 24 | # 25 | 26 | gh_toc_version="0.4.9" 27 | 28 | gh_user_agent="gh-md-toc v$gh_toc_version" 29 | 30 | # 31 | # Download rendered into html README.md by its url. 32 | # 33 | # 34 | gh_toc_load() { 35 | local gh_url=$1 36 | 37 | if type curl &>/dev/null; then 38 | curl --user-agent "$gh_user_agent" -s "$gh_url" 39 | elif type wget &>/dev/null; then 40 | wget --user-agent="$gh_user_agent" -qO- "$gh_url" 41 | else 42 | echo "Please, install 'curl' or 'wget' and try again." 43 | exit 1 44 | fi 45 | } 46 | 47 | # 48 | # Converts local md file into html by GitHub 49 | # 50 | # ➥ curl -X POST --data '{"text": "Hello world github/linguist#1 **cool**, and #1!"}' https://api.github.com/markdown 51 | #

Hello world github/linguist#1 cool, and #1!

'" 52 | gh_toc_md2html() { 53 | local gh_file_md=$1 54 | URL=https://api.github.com/markdown/raw 55 | TOKEN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/token.txt" 56 | if [ -f "$TOKEN" ]; then 57 | URL="$URL?access_token=$(cat $TOKEN)" 58 | fi 59 | curl -s --user-agent "$gh_user_agent" \ 60 | --data-binary @"$gh_file_md" -H "Content-Type:text/plain" \ 61 | $URL 62 | } 63 | 64 | # 65 | # Is passed string url 66 | # 67 | gh_is_url() { 68 | case $1 in 69 | https* | http*) 70 | echo "yes";; 71 | *) 72 | echo "no";; 73 | esac 74 | } 75 | 76 | # 77 | # TOC generator 78 | # 79 | gh_toc(){ 80 | local gh_src=$1 81 | local gh_src_copy=$1 82 | local gh_ttl_docs=$2 83 | 84 | if [ "$gh_src" = "" ]; then 85 | echo "Please, enter URL or local path for a README.md" 86 | exit 1 87 | fi 88 | 89 | 90 | # Show "TOC" string only if working with one document 91 | if [ "$gh_ttl_docs" = "1" ]; then 92 | 93 | echo "Table of Contents" 94 | echo "=================" 95 | echo "" 96 | gh_src_copy="" 97 | 98 | fi 99 | 100 | if [ "$(gh_is_url "$gh_src")" == "yes" ]; then 101 | gh_toc_load "$gh_src" | gh_toc_grab "$gh_src_copy" 102 | else 103 | gh_toc_md2html "$gh_src" | gh_toc_grab "$gh_src_copy" 104 | fi 105 | } 106 | 107 | # 108 | # Grabber of the TOC from rendered html 109 | # 110 | # $1 — a source url of document. 111 | # It's need if TOC is generated for multiple documents. 112 | # 113 | gh_toc_grab() { 114 | # if closed is on the new line, then move it on the prev line 115 | # for example: 116 | # was: The command foo1 117 | # 118 | # became: The command foo1 119 | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n<\/h/<\/h/g' | 120 | # find strings that corresponds to template 121 | grep -E -o '//' | sed 's/<\/code>//' | 124 | # now all rows are like: 125 | # ... .*<\/h/)+2, RLENGTH-5)"](" gh_url substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) ")"}' | sed 'y/+/ /; s/%/\\x/g')" 130 | } 131 | 132 | # 133 | # Returns filename only from full path or url 134 | # 135 | gh_toc_get_filename() { 136 | echo "${1##*/}" 137 | } 138 | 139 | # 140 | # Options hendlers 141 | # 142 | gh_toc_app() { 143 | local app_name="gh-md-toc" 144 | 145 | if [ "$1" = '--help' ] || [ $# -eq 0 ] ; then 146 | echo "GitHub TOC generator ($app_name): $gh_toc_version" 147 | echo "" 148 | echo "Usage:" 149 | echo " $app_name src [src] Create TOC for a README file (url or local path)" 150 | echo " $app_name - Create TOC for markdown from STDIN" 151 | echo " $app_name --help Show help" 152 | echo " $app_name --version Show version" 153 | return 154 | fi 155 | 156 | if [ "$1" = '--version' ]; then 157 | echo "$gh_toc_version" 158 | return 159 | fi 160 | 161 | if [ "$1" = "-" ]; then 162 | if [ -z "$TMPDIR" ]; then 163 | TMPDIR="/tmp" 164 | elif [ -n "$TMPDIR" -a ! -d "$TMPDIR" ]; then 165 | mkdir -p "$TMPDIR" 166 | fi 167 | local gh_tmp_md 168 | gh_tmp_md=$(mktemp $TMPDIR/tmp.XXXXXX) 169 | while read input; do 170 | echo "$input" >> "$gh_tmp_md" 171 | done 172 | gh_toc_md2html "$gh_tmp_md" | gh_toc_grab "" 173 | return 174 | fi 175 | 176 | for md in "$@" 177 | do 178 | echo "" 179 | gh_toc "$md" "$#" 180 | done 181 | 182 | echo "" 183 | echo "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)" 184 | } 185 | 186 | # 187 | # Entry point 188 | # 189 | gh_toc_app "$@" 190 | -------------------------------------------------------------------------------- /.files_libs/JSON.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Taken From: https://github.com/dominictarr/JSON.sh 4 | 5 | throw() { 6 | echo "$*" >&2 7 | exit 1 8 | } 9 | 10 | BRIEF=0 11 | LEAFONLY=0 12 | PRUNE=0 13 | NO_HEAD=0 14 | NORMALIZE_SOLIDUS=0 15 | 16 | usage() { 17 | echo 18 | echo "Usage: JSON.sh [-b] [-l] [-p] [-s] [-h]" 19 | echo 20 | echo "-p - Prune empty. Exclude fields with empty values." 21 | echo "-l - Leaf only. Only show leaf nodes, which stops data duplication." 22 | echo "-b - Brief. Combines 'Leaf only' and 'Prune empty' options." 23 | echo "-n - No-head. Do not show nodes that have no path (lines that start with [])." 24 | echo "-s - Remove escaping of the solidus symbol (straight slash)." 25 | echo "-h - This help text." 26 | echo 27 | } 28 | 29 | parse_options() { 30 | set -- "$@" 31 | local ARGN=$# 32 | while [ "$ARGN" -ne 0 ] 33 | do 34 | case $1 in 35 | -h) usage 36 | exit 0 37 | ;; 38 | -b) BRIEF=1 39 | LEAFONLY=1 40 | PRUNE=1 41 | ;; 42 | -l) LEAFONLY=1 43 | ;; 44 | -p) PRUNE=1 45 | ;; 46 | -n) NO_HEAD=1 47 | ;; 48 | -s) NORMALIZE_SOLIDUS=1 49 | ;; 50 | ?*) echo "ERROR: Unknown option." 51 | usage 52 | exit 0 53 | ;; 54 | esac 55 | shift 1 56 | ARGN=$((ARGN-1)) 57 | done 58 | } 59 | 60 | awk_egrep () { 61 | local pattern_string=$1 62 | 63 | gawk '{ 64 | while ($0) { 65 | start=match($0, pattern); 66 | token=substr($0, start, RLENGTH); 67 | print token; 68 | $0=substr($0, start+RLENGTH); 69 | } 70 | }' pattern="$pattern_string" 71 | } 72 | 73 | tokenize () { 74 | local GREP 75 | local ESCAPE 76 | local CHAR 77 | 78 | if echo "test string" | egrep -ao --color=never "test" >/dev/null 2>&1 79 | then 80 | GREP='egrep -ao --color=never' 81 | else 82 | GREP='egrep -ao' 83 | fi 84 | 85 | if echo "test string" | egrep -o "test" >/dev/null 2>&1 86 | then 87 | ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})' 88 | CHAR='[^[:cntrl:]"\\]' 89 | else 90 | GREP=awk_egrep 91 | ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})' 92 | CHAR='[^[:cntrl:]"\\\\]' 93 | fi 94 | 95 | local STRING="\"$CHAR*($ESCAPE$CHAR*)*\"" 96 | local NUMBER='-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?' 97 | local KEYWORD='null|false|true' 98 | local SPACE='[[:space:]]+' 99 | 100 | # Force zsh to expand $A into multiple words 101 | local is_wordsplit_disabled=$(unsetopt 2>/dev/null | grep -c '^shwordsplit$') 102 | if [ $is_wordsplit_disabled != 0 ]; then setopt shwordsplit; fi 103 | $GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | egrep -v "^$SPACE$" 104 | if [ $is_wordsplit_disabled != 0 ]; then unsetopt shwordsplit; fi 105 | } 106 | 107 | parse_array () { 108 | local index=0 109 | local ary='' 110 | read -r token 111 | case "$token" in 112 | ']') ;; 113 | *) 114 | while : 115 | do 116 | parse_value "$1" "$index" 117 | index=$((index+1)) 118 | ary="$ary""$value" 119 | read -r token 120 | case "$token" in 121 | ']') break ;; 122 | ',') ary="$ary," ;; 123 | *) throw "EXPECTED , or ] GOT ${token:-EOF}" ;; 124 | esac 125 | read -r token 126 | done 127 | ;; 128 | esac 129 | [ "$BRIEF" -eq 0 ] && value=$(printf '[%s]' "$ary") || value= 130 | : 131 | } 132 | 133 | parse_object () { 134 | local key 135 | local obj='' 136 | read -r token 137 | case "$token" in 138 | '}') ;; 139 | *) 140 | while : 141 | do 142 | case "$token" in 143 | '"'*'"') key=$token ;; 144 | *) throw "EXPECTED string GOT ${token:-EOF}" ;; 145 | esac 146 | read -r token 147 | case "$token" in 148 | ':') ;; 149 | *) throw "EXPECTED : GOT ${token:-EOF}" ;; 150 | esac 151 | read -r token 152 | parse_value "$1" "$key" 153 | obj="$obj$key:$value" 154 | read -r token 155 | case "$token" in 156 | '}') break ;; 157 | ',') obj="$obj," ;; 158 | *) throw "EXPECTED , or } GOT ${token:-EOF}" ;; 159 | esac 160 | read -r token 161 | done 162 | ;; 163 | esac 164 | [ "$BRIEF" -eq 0 ] && value=$(printf '{%s}' "$obj") || value= 165 | : 166 | } 167 | 168 | parse_value () { 169 | local jpath="${1:+$1,}$2" isleaf=0 isempty=0 print=0 170 | case "$token" in 171 | '{') parse_object "$jpath" ;; 172 | '[') parse_array "$jpath" ;; 173 | # At this point, the only valid single-character tokens are digits. 174 | ''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;; 175 | *) value=$token 176 | # if asked, replace solidus ("\/") in json strings with normalized value: "/" 177 | [ "$NORMALIZE_SOLIDUS" -eq 1 ] && value=$(echo "$value" | sed 's#\\/#/#g') 178 | isleaf=1 179 | [ "$value" = '""' ] && isempty=1 180 | ;; 181 | esac 182 | [ "$value" = '' ] && return 183 | [ "$NO_HEAD" -eq 1 ] && [ -z "$jpath" ] && return 184 | 185 | [ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 0 ] && print=1 186 | [ "$LEAFONLY" -eq 1 ] && [ "$isleaf" -eq 1 ] && [ $PRUNE -eq 0 ] && print=1 187 | [ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 1 ] && [ "$isempty" -eq 0 ] && print=1 188 | [ "$LEAFONLY" -eq 1 ] && [ "$isleaf" -eq 1 ] && \ 189 | [ $PRUNE -eq 1 ] && [ $isempty -eq 0 ] && print=1 190 | [ "$print" -eq 1 ] && printf "[%s]\t%s\n" "$jpath" "$value" 191 | : 192 | } 193 | 194 | parse () { 195 | read -r token 196 | parse_value 197 | read -r token 198 | case "$token" in 199 | '') ;; 200 | *) throw "EXPECTED EOF GOT $token" ;; 201 | esac 202 | } 203 | 204 | if ([ "$0" = "$BASH_SOURCE" ] || ! [ -n "$BASH_SOURCE" ]); 205 | then 206 | parse_options "$@" 207 | tokenize | parse 208 | fi 209 | 210 | # vi: expandtab sw=2 ts=2 211 | -------------------------------------------------------------------------------- /.files_aliases.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Bash Aliases by: torch2424 4 | # Repo: https://github.com/torch2424/dotFiles 5 | 6 | # Show our bash rc 7 | alias cb='cat ~/.bashrc' 8 | alias catbash='cb' 9 | alias catbashrc='cb' 10 | 11 | # Show our aliases 12 | alias showalias="cat ~/.files_aliases.sh" 13 | alias showaliases="showalias" 14 | alias showbashalias="showalias" 15 | alias showbashalaises="showalias" 16 | alias listalias="showalias" 17 | alias listaliases="showalias" 18 | alias lsalias="showalias" 19 | alias lsaliases="showalias" 20 | 21 | # Show our functions 22 | alias showfunction='ls ~/.files_functions/functions' 23 | alias showfunctions='showfunction' 24 | 25 | # Source our .bashrc again 26 | alias re-source='source ~/.bashrc' 27 | alias resource="re-source" 28 | alias reSource="re-source" 29 | 30 | # Install .debs with ease 31 | alias install-deb="sudo dpkg -i " 32 | 33 | # Default ls with colors 34 | alias ls="ls -Gp" 35 | 36 | # Default df with readable byte 37 | alias df="df -h" 38 | 39 | # Github Aliases 40 | alias gs='git status ' 41 | alias gc='git commit' 42 | alias ga='git add -A ' 43 | alias gp='git push origin HEAD ' 44 | alias guc='git reset HEAD~ ' 45 | alias gpo='git push origin ' 46 | alias gpoh='git push origin HEAD ' 47 | alias gpom='gpoh ' 48 | alias gauc="git update-index --assume-unchanged " 49 | alias guac="gauc" 50 | alias ungauc="git update-index --no-assume-unchanged " 51 | alias noguac="ungauc" 52 | alias gnauc="ungauc" 53 | alias unguac="ungauc" 54 | alias gitdiffbranch="git diff master...HEAD" 55 | alias gdb="gitdiffbranch" 56 | alias gitdiffbranchstat="gitdiffbranch --stat" 57 | alias gdbs="gitdiffbranchstat" 58 | alias gdsb="gdbs" 59 | 60 | # systemctl alias 61 | alias ssdr='sudo systemctl daemon-reload' 62 | alias ssstart='sudo systemctl start ' 63 | alias ssstatus='sudo systemctl status --no-pager ' 64 | alias ssrestart='sudo systemctl restart ' 65 | alias ssenable='sudo systemctl enable ' 66 | alias ssstop='sudo systemctl stop ' 67 | alias ssdisable='sudo systemctl disable ' 68 | alias sj='sudo journalctl -a --no-pager -u ' 69 | 70 | # Cron Aliases 71 | alias cronedit='crontab -e' 72 | alias cronlog='sudo grep CRON /var/log/syslog' 73 | alias cronlogs='sudo grep CRON /var/log/syslog' 74 | 75 | # Vagrant Aliases 76 | alias vu='vagrant up' 77 | alias vh='vagrant halt' 78 | alias vs='vagrant status' 79 | alias vssh='vagrant ssh' 80 | alias vd='vagrant destroy' 81 | 82 | # Docker Aliases 83 | alias dcb='docker-compose build --no-cache' 84 | alias dcu='docker-compose up' 85 | alias dcr='docker-compose run' 86 | alias dsp="docker system prune" 87 | alias dcp='dsp' 88 | alias di='docker images' 89 | alias dl='di' 90 | alias dci='di' 91 | alias dcl='di' 92 | 93 | # cd aliases 94 | alias cdvs='cd ~/vagrantBox/' 95 | alias cds='cd ~/Source/' 96 | alias cdg='cd ~/goPath/' 97 | alias cdpico='cd ~/Library/Application\ Support/pico-8/carts/' 98 | alias cdpico8='cdpico' 99 | alias cdw='cd /mnt/c/Users/torch' 100 | alias cdws='cd /mnt/c/Users/torch/Source' 101 | 102 | # chmod aliases 103 | alias chmx='chmod +x' 104 | alias exe='chmx' 105 | alias +x='chmx' 106 | 107 | # Copy recursively with progress 108 | alias copyprogress='rsync -avh --progress' 109 | alias cpprogress='copyprogress' 110 | 111 | # tmux aliasas 112 | alias tmuxnew='tmux new -s' 113 | alias tmuxkill='tmux kill-session -t' 114 | alias tmuxrm='tmuxkill' 115 | alias tmuxls='tmux ls' 116 | alias tmuxattach='tmux attach -t' 117 | alias tmuxattatch='tmuxattach' 118 | alias tmuxjoin='tmuxattach' 119 | 120 | # Mosh aliases 121 | # Only my servers would be using mosh, so use my default ssh port 122 | alias mosh='mosh --ssh="ssh -p 1124"' 123 | alias mosh22='mosh --ssh="ssh -p 22"' 124 | 125 | # Show our current app ports 126 | alias showports="sudo netstat -lptn" 127 | alias showserver="showports" 128 | alias showport="showports" 129 | alias showservers="showports" 130 | 131 | # Ios Simulator alias: http://stackoverflow.com/questions/10379622/how-to-run-iphone-emulator-without-starting-xcode 132 | alias simulator='open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app' 133 | alias iossimulator='simulator' 134 | alias ios-simulator='simulator' 135 | 136 | #Android SDK and simulator 137 | #http://stackoverflow.com/questions/19238476/mac-terminal-how-to-start-android-virtual-device-manager-on-cli 138 | alias androidsdk="bash ~/Library/Android/sdk/tools/android" 139 | alias android-sdk="androidsdk" 140 | alias androidavd="androidsdk avd" 141 | alias android-avd="androidavd" 142 | 143 | #Pico 8 from console 144 | alias pico8="/Applications/PICO-8.app/Contents/MacOS/pico8" 145 | alias pico-8="pico8" 146 | 147 | # Gbdk Compiler 148 | alias gbdk="lcc" 149 | 150 | # Alias to scan wifi for things like raspberry pi's 151 | alias scanwifi='nmap -sP 192.168.1.0/24' 152 | alias scanwifi-onhub='nmap -sP 192.168.86.0/24' 153 | 154 | # Screen record 24fps seconds of x 155 | # -r Frames per second 156 | # -i is the x display 157 | # -s is video size (Make this bigger if only recording terminal or something. Starts from upper left corner of display) 158 | alias screenrecord='ffmpeg -f x11grab -s 1280x720 -r 30 -i :0 screenrecord.avi' 159 | 160 | # Aliases to backup and restore atom settings 161 | # https://discuss.atom.io/t/how-to-backup-all-your-settings/15674 162 | alias backupatom='apm list --installed --bare > ~/.files_atom_packages.list' 163 | alias restoreatom='apm install `cat ~/.files_atom_packages.list`' 164 | 165 | # Weather 166 | alias w='curl wttr.in' 167 | alias weather='w' 168 | 169 | # Use local project webpack 170 | # From the docs: 171 | # https://webpack.js.org/guides/getting-started/ 172 | alias webpack='./node_modules/.bin/webpack --config webpack.config.js' 173 | 174 | # Use local karma for stuff 175 | alias karma='./node_modules/karma/bin/karma' 176 | alias karmatestfile='karma start --auto-watch --grep' 177 | 178 | # Vim Aliases (I'm using NeoVim by default) 179 | # Need to allow CTRL S for vim: https://stackoverflow.com/questions/3446320/in-vim-how-to-map-save-to-ctrl-s 180 | # alias vim="stty stop '' start '' -ixoff; nvim" 181 | alias vim='nvim' 182 | alias v='vim' 183 | alias vi='vim' 184 | # When you're a crip, but you love to code... 185 | alias cim='vim' 186 | # When you have a homie who is a blood, 187 | # and you try to teach them to code... 188 | alias bim='vim' 189 | 190 | # npm aliases 191 | alias n='npm' 192 | alias p='pnpm' 193 | 194 | # Gifgen 195 | alias gifgen='~/gifgen/gifgen' 196 | -------------------------------------------------------------------------------- /.files_libs/wifi.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | #Taken From: https://github.com/dominictarr/wifi.sh 4 | 5 | WPA_CONF=${WPA_CONF-/etc/wpa_supplicant.conf} 6 | 7 | isroot () { 8 | # check that the script is running as root 9 | # this is required for controlling wifi device. 10 | 11 | if [ $UID -ne 0 ]; then 12 | echo 'Error: must run as root to access wifi devices' >&2 13 | exit 1 14 | fi 15 | } 16 | 17 | _add () { 18 | # use wpa_passphrase command to add the new network to wpa_supplicant conf. 19 | # wpa_passphrase dumps the error message on stdout 20 | # because they do not understand unix. 21 | # detect this case and exit with a helpful error message. 22 | 23 | PASS=`wpa_passphrase "$1" "$2"` || { 24 | echo Error: $PASS 1>&2 25 | exit 1 26 | } 27 | 28 | echo "$PASS" 29 | } 30 | 31 | add () { 32 | _add "$1" "$2" >> $WPA_CONF 33 | exit 0 34 | } 35 | 36 | ## SCAN FOR NETWORKS 37 | 38 | # readable list of available networks. 39 | 40 | parse () { 41 | # parse the output of iw scan 42 | while read LINE; 43 | do 44 | LINE=${LINE# *} 45 | 46 | case "$LINE" in 47 | BSS*) 48 | if [ x"$BSS" != x ]; then 49 | printf '%-40s, %5s , %s\n' "$SSID" "$SIGNAL" "$ENC" 50 | SIGNAL= 51 | ENC= 52 | fi 53 | BSS=${LINE#BSS } 54 | BSS=${BSS%(*} 55 | ;; 56 | SSID*) 57 | SSID=${LINE#SSID: } 58 | if [ "$SSID" = "SSID:" ]; then 59 | SSID=$BSS 60 | fi 61 | ;; 62 | signal*) 63 | SIGNAL=${LINE#signal: } 64 | SIGNAL=${SIGNAL% dBm} 65 | ;; 66 | *) 67 | E=${LINE%%:*} 68 | E="$E"${LINE#*Version: } 69 | ENC="$ENC$E " 70 | ;; 71 | esac 72 | done 73 | printf '%-40s, %5s , %s\n' "$SSID" "$SIGNAL" "$ENC" 74 | } 75 | 76 | preparse () { 77 | grep -E '(^BSS)|SSID|signal|WPA|WPS|WEP|RSN' 78 | } 79 | 80 | _scanraw () { 81 | iw dev "$INTERFACE" scan | preparse 82 | } 83 | 84 | scanraw () { 85 | isroot 86 | get_interface 87 | _scanraw 88 | exit 0 89 | } 90 | 91 | scan () { 92 | isroot 93 | get_interface 94 | ip link set $INTERFACE up 95 | echo 'SSID , SIGNAL , SECURITY' 96 | 97 | # to be honest, I can't figure out the correct parameters 98 | # to sort, but this seems to produce good output. 99 | _scanraw | parse | sort -k 3 100 | exit 0 101 | } 102 | 103 | ## NETWORK INTERFACES 104 | 105 | # detect network interfaces 106 | 107 | parse_interface () { 108 | while read line; 109 | do 110 | iface=${line#*: } 111 | iface=${iface%%:*} 112 | done 113 | echo $iface 114 | } 115 | 116 | get_interface () { 117 | # Grab the most recently added interface with the prefix wl. 118 | # Your laptop may use a wifi chipset that has poor linux driver support. 119 | # (this is because of microsoft's consipracy against linux) 120 | # In this case, you may have more success using a usb wifi dongle. 121 | # If you are using a wifi dongle this should return the one 122 | # that you most recently plugged in. 123 | 124 | INTERFACE=${INTERFACE-$(ip -o link | grep '^[0-9]\+: wl' | parse_interface)} 125 | echo $INTERFACE 126 | } 127 | 128 | interface () { 129 | get_interface 130 | exit 0 131 | } 132 | 133 | dump () { 134 | cat $WPA_CONF 135 | exit 0 136 | } 137 | 138 | ## CONNECTIONS 139 | 140 | connect () { 141 | isroot 142 | dhcpcd #start dhcpcd if necessary 143 | get_interface 144 | 145 | # if there is a password, create a temp wpa_supplicant.conf 146 | if [ "x$1" != x ]; then 147 | WPA_CONF=/tmp/wifish.wpa_supplicant.conf 148 | _add "$1" "$2" > $WPA_CONF 149 | fi 150 | 151 | # if there are two wpa_supplicants running, things break. 152 | killall wpa_supplicant 153 | echo wpa_supplicant -i $INTERFACE -c"$WPA_CONF" 154 | wpa_supplicant -i $INTERFACE -c"$WPA_CONF" 155 | exit $? 156 | } 157 | 158 | open () { 159 | # because iw does not block, we need to start it, 160 | # and then start polling the status. 161 | # if the connection drops, reconnect automatically. 162 | 163 | isroot 164 | dhcpcd #start dhcpcd if necessary 165 | get_interface 166 | 167 | while true 168 | do 169 | # If the interface was down, put it back up. 170 | # (for example, if you had turned wifi off with a hardware switch) 171 | ip link set $INTERFACE up 172 | 173 | # ensure we are disconnected. 174 | # (otherwise, may get "operation already in progress") 175 | iw dev "$INTERFACE" disconnect 176 | 177 | # connect to an open wifi network. 178 | # 1: Unspecified failure probably means that the name you 179 | # entered was not an open wifi network. 180 | 181 | iw dev "$INTERFACE" connect -w "$1" 182 | STATUS= 183 | 184 | # poll the status to check if we are still connected. 185 | # if we become disconnected, come back into the main loop and reconnect. 186 | 187 | while [ "$STATUS" != 'Not connected.' ] 188 | do 189 | sleep 1 190 | STATUS=$(iw dev "$INTERFACE" link) 191 | echo "$STATUS" 192 | done 193 | done 194 | exit $? 195 | } 196 | 197 | disconnect () { 198 | get_interface 199 | killall wpa_supplicant 200 | iw dev "$INTERFACE" disconnect 201 | exit 0 202 | } 203 | 204 | ## MAC ADDRESSES ## 205 | 206 | # change your mac. 207 | # useful for airport wifi... 208 | 209 | _setmac () { 210 | set -e 211 | ip link set dev $INTERFACE address $1 2> /dev/null 212 | 213 | } 214 | 215 | _random () { 216 | r=$r`printf %X%X%X $RANDOM $RANDOM $RANDOM` 217 | o=${r:0:2} 218 | o=$o:${r:2:2} 219 | o=$o:${r:4:2} 220 | o=$o:${r:6:2} 221 | o=$o:${r:8:2} 222 | o=$o:${r:10:2} 223 | echo $o 224 | } 225 | 226 | mac () { 227 | get_interface > /dev/null 228 | d=`ip link show $INTERFACE` 229 | d=${d#*link/ether } 230 | d=${d%% *} 231 | echo $d 232 | exit 0 233 | } 234 | 235 | setmac () { 236 | isroot 237 | get_interface > /dev/null 238 | ip link set dev $INTERFACE down 239 | _setmac $1 240 | ip link set dev $INTERFACE up 241 | exit 0 242 | } 243 | 244 | randmac () { 245 | isroot 246 | get_interface > /dev/null 247 | ip link set dev $INTERFACE down 248 | 249 | # sometimes this doesn't work, so try a few times... 250 | until (_setmac `_random`); do true; done 251 | ip link set dev $INTERFACE up 252 | mac 253 | } 254 | 255 | 256 | version () { 257 | v=$(grep version $(dirname $(realpath "$0"))/package.json) 258 | v=${v%'"'*} 259 | v=${v##*'"'} 260 | echo $v 261 | exit 0 262 | } 263 | 264 | [ "$1" = "-v" ] && version 265 | 266 | if [ "$0" = "$BASH_SOURCE" ]; then 267 | 268 | "$@" 269 | echo 'USAGE scan|connect|add {network} {pass}|open {network}|dump|interface|version|mac|randmac|setmac {mac}' >&2 270 | 271 | fi 272 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Function to check our enviornment for variables quietly 4 | # Usage: checkenv [ENV_VARIABLE_TO_CHECK] [0 for it exists, 1 for it does not] 5 | checkenv() { 6 | if env | grep -q $1 ; then 7 | # True in bash = 0 8 | if [ $2 -eq 0 ]; then 9 | return 0 10 | else 11 | return 1 12 | fi 13 | else 14 | # False in bash = 1 15 | if [ $2 -eq 0 ]; then 16 | return 1 17 | else 18 | return 0 19 | fi 20 | fi 21 | } 22 | 23 | # Command to check the current env 24 | # env | tr '\n' ' \\\ ' 25 | 26 | # Check if we are scp or sftp by grepping our env 27 | # SCP will have an ssh client, but not SSH TTY 28 | # Run all check env commands here 29 | checkenv "SSH_CLIENT" 0 && checkenv "SSH_TTY" 1 30 | 31 | # Check if the last command did NOT return true / success. Thus, we want to check 32 | # for != 0. Also, sometimes things go weird with this check, so lets just allow us to override 33 | # with a variable. This is helpful for using Terminus's Mosh Functionality 34 | if [ $? -ne 0 ] || [ "$TORCH_SOURCE_BASHRC" = true ] ; then 35 | # Fucntion to source from the user home directory 36 | _user_source() { 37 | source ~/$1 38 | } 39 | 40 | # Function to source all files in folder 41 | _source_all() { 42 | for f in ~/$1/*.sh; do source $f; done; 43 | } 44 | 45 | # load our bash aliases 46 | _user_source .files_aliases.sh 47 | 48 | # Load our bash function 49 | _source_all .files_functions 50 | 51 | # Load our active default work aliases and fucntions 52 | _user_source .files_work/default.sh 53 | 54 | # Load Our bash libraries 55 | _user_source .files_libs/index.sh 56 | 57 | # Completion for all of our aliases 58 | # Not Working on OSX as of 10-3-2023 59 | # _user_source .files_completion.sh 60 | 61 | # Cache our Git credentials 62 | git config --global credential.helper 'cache --timeout=36000' 63 | 64 | # Set default editor 65 | export VISUAL=vim 66 | export EDITOR="$VISUAL" 67 | 68 | # Load NVM 69 | export NVM_DIR="$HOME/.nvm" 70 | [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm 71 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 72 | 73 | # Add support for globally installed Yarn Packages 74 | export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" 75 | 76 | # Npm no Sudo 77 | export NPM_PACKAGES="~/.npm-packages" 78 | export NODE_PATH="$NPM_PACKAGES/lib/node_modules${NODE_PATH:+:$NODE_PATH}" 79 | export PATH="$NPM_PACKAGES/bin:$PATH" 80 | # Unset manpath so we can inherit from /etc/manpath via the `manpath` 81 | # command 82 | unset MANPATH # delete if you already modified MANPATH elsewhere in your config 83 | export MANPATH="$NPM_PACKAGES/share/man:$(manpath)" 84 | 85 | # Go Settings 86 | export PATH=$PATH:/usr/local/go/bin 87 | export GOPATH=$HOME/goPath 88 | # Go bin Global 89 | export PATH="$PATH:$GOPATH/bin" 90 | # Add support for Go Modules 91 | export GO111MODULE=on 92 | #TinyGo 93 | export PATH=$PATH:/usr/local/tinygo/bin 94 | 95 | # Rust settings 96 | export PATH="$HOME/.cargo/bin:$PATH" 97 | 98 | # PyEnv Python Managment 99 | export PATH="/home/torch2424/.pyenv/bin:$PATH" 100 | # https://stackoverflow.com/a/677212 101 | if hash pyenv 2>/dev/null; then 102 | eval "$(pyenv init -)" 103 | eval "$(pyenv virtualenv-init -)" 104 | fi 105 | 106 | # Wasmer 107 | export WASMER_DIR="$HOME/.wasmer" 108 | [ -s "$WASMER_DIR/wasmer.sh" ] && source "$WASMER_DIR/wasmer.sh" # This loads wasmer 109 | 110 | # Fastly / Lucet 111 | export PATH="/opt/lucet/bin:${PATH}" 112 | export LD_LIBRARY_PATH="/opt/lucet/lib:${LD_LIBRARY_PATH}" 113 | export DYLD_LIBRARY_PATH="/opt/lucet/lib:${DYLD_LIBRARY_PATH}" 114 | #if [ $# -gt 0 ]; then 115 | # exec "$@" 116 | #fi 117 | export PATH="$HOME/ecp-js:$PATH" 118 | 119 | # Wasmtime 120 | export WASMTIME_HOME="$HOME/.wasmtime" 121 | export PATH="$WASMTIME_HOME/bin:$PATH" 122 | 123 | # Google CLoud SDK 124 | # The next line updates PATH for the Google Cloud SDK. 125 | if [ -f '/home/torch2424/google-cloud-sdk/path.bash.inc' ]; then . '/home/torch2424/google-cloud-sdk/path.bash.inc'; fi 126 | # The next line enables shell command completion for gcloud. 127 | if [ -f '/home/torch2424/google-cloud-sdk/completion.bash.inc' ]; then . '/home/torch2424/google-cloud-sdk/completion.bash.inc'; fi 128 | 129 | # GBDK 130 | export PATH="/opt/gbdk/bin:$PATH" 131 | 132 | # gifgen 133 | export PATH="$HOME/gifgen/gifgen:$PATH" 134 | 135 | # Wasienv 136 | export WASIENV_DIR="$HOME/.wasienv" 137 | [ -s "$WASIENV_DIR/wasienv.sh" ] && source "$WASIENV_DIR/wasienv.sh" 138 | 139 | # Wabt 140 | export PATH="$HOME/wabt/bin:$PATH" 141 | 142 | # Spotter AWS 143 | export AWS_PROFILE=aws1 144 | 145 | 146 | # Set OSX Development Paths 147 | if [ "$(uname)" == "Darwin" ]; then 148 | # Java Path 149 | # TODO: Broken on my M1 Macbook Air? 150 | # export JAVA_HOME=`/usr/libexec/java_home -v 1.8` 151 | # Android Path 152 | export ANDROID_PATH="/Users/aaron/Library/Android/sdk" 153 | export PATH="/Applications/VLC.app/Contents/MacOS/VLC:$PATH" 154 | 155 | # Homebrew Package Manager 156 | eval "$(/opt/homebrew/bin/brew shellenv)" 157 | 158 | # LLVM / Wasm Settings 159 | # https://00f.net/2019/04/07/compiling-to-webassembly-with-llvm-and-clang/ 160 | export PATH="/usr/local/opt/llvm/bin:$PATH" 161 | fi 162 | 163 | # Set Linux Development Paths 164 | if [ "$(uname)" == "Linux" ]; then 165 | export LLVM_BIN="/usr/lib/llvm-*/bin" 166 | 167 | # Kitty terminal 168 | export PATH="$HOME/.local/bin/:$PATH" 169 | 170 | # Fzf 171 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 172 | fi 173 | 174 | # Clear the console 175 | # This will cause "TERM environment variable not set" error 176 | # https://stackoverflow.com/questions/16242025/term-environment-variable-not-set#comment78763554_33679937 177 | # clear 178 | 179 | # Load our bash theme, if we are in an interactive shell 180 | if [[ $- == *i* ]]; then 181 | # Disabling Sexy Prompt as it's having issues with Kitty Term on the latest MacOs 10-3-2023 182 | _source_all .files_libs/sexy_prompt 183 | 184 | # Load a Demo friendly Bash theme 185 | # https://ezprompt.net/ 186 | # export PS1="\[\e[36m\]demouser\[\e[m\] in \[\e[35m\]\w\[\e[m\] \\$ " 187 | 188 | # return 189 | fi 190 | 191 | # Finally, load neo fetch if it is installed 192 | if hash neofetch 2>/dev/null; then 193 | neofetch 194 | # return 195 | else 196 | echo " " 197 | echo "To be really cool, install neofetch: https://github.com/dylanaraps/neofetch" 198 | echo " " 199 | fi 200 | else 201 | # Do not allow sourcing the bashrc 202 | return 203 | fi 204 | -------------------------------------------------------------------------------- /.files_libs/gvn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # gvn 4 | # By: torch2424 5 | # repo: https://github.com/torch2424/gvn 6 | # LICENSE: Apache 2.0 7 | 8 | # Define our path where we would like gvn to live 9 | GVN_UPDATE_PATH="$HOME/.gvn" 10 | GVN_SKIP_UPDATE_CHECK="--skip-update-check" 11 | 12 | # Check if we have a gvn in our update path, if so use that. And if we are that, keep going 13 | # "${@: -1}" = get last passed argument 14 | if [[ "${@: -1}" != "$GVN_SKIP_UPDATE_CHECK" ]] && [ -f "$GVN_UPDATE_PATH/gvn.sh" ]; then 15 | bash "$GVN_UPDATE_PATH/gvn.sh" "$@" "$GVN_SKIP_UPDATE_CHECK" 16 | exit 0 17 | fi 18 | 19 | # Our URL Path for gvn for updating 20 | GVN_URL="https://raw.githubusercontent.com/torch2424/gvn/master/gvn.sh" 21 | 22 | # Define our svn changelist name 23 | GVN_CHANGELIST="gvn-changelist" 24 | 25 | # Helper function from: https://github.com/torch2424/bebop.sh/blob/master/bebop.sh 26 | __seek_confirmation() { 27 | printf "\n${bold}$@${reset}" 28 | read -p " (y/n) " -n 1 29 | printf "\n" 30 | } 31 | 32 | # Helper function from: https://github.com/torch2424/bebop.sh/blob/master/bebop.sh 33 | __is_confirmed() { 34 | if [[ "$REPLY" =~ ^[Yy]$ ]]; then 35 | return 0 36 | fi 37 | return 1 38 | } 39 | 40 | # Usage Docs 41 | function __printgvninfo() { 42 | echo " " 43 | echo ",---.. ,,---." 44 | echo "| | \ / | |" 45 | echo "\`---| \`' \` '" 46 | echo "\`---' " 47 | echo "alpha v1.0" 48 | echo " " 49 | echo "Help:" 50 | echo " " 51 | echo "gvn is a simple wrapper around svn to seem more git-like. Not everything will be implemented. But here's a quick primer:" 52 | echo " " 53 | echo "This is coming from someone who is just barely learning svn. But from my understanding: svn is a centralized version control system, while git is decentralized. Git is more easily imagined as a tree, while svn is represents more of a file structure. Most operations on git and svn are the same, but some key gotchas:" 54 | echo " " 55 | echo "1. svn commiting goes straight to the server. There are no local commits in svn compared to git." 56 | echo " " 57 | echo "2. svn workflow can vary greatly from github. In git it is usually encouraged to branch everything, as merging is not a headache once you understand it. Master is supposed to be an always working build, and feature branches are reviewed before being pulled in. However, rumor is, merging is kind of a pain in svn, because its master branch, called trunk, is a centralized source of truth, and will often times not like what you are brining in. So svn workflows can follow the standard git style. Or follow a wild wild west trunk that everyone just commits to, and makes branches when there is a well tested point in time, or revision, for release." 58 | echo " " 59 | echo "Commands:" 60 | echo " " 61 | echo "gvn update" 62 | echo "fetches latest gvn, and places into $GVN_UPDATE_PATH" 63 | echo " " 64 | echo "gvn clone [URL of repository]" 65 | echo "checkout the svn repository" 66 | echo "Compare to: git clone" 67 | echo " " 68 | echo "gvn pull" 69 | echo "update the svn repository" 70 | echo "Compare to: git pull" 71 | echo " " 72 | echo "gvn status" 73 | echo "shows svn repo info, and the current working changes (status)" 74 | echo "Compare to: git status" 75 | echo " " 76 | echo "gvn checkout [FILE_PATH]" 77 | echo "Checkout local changes to a file" 78 | echo "Compare to: git checkout [FILE]" 79 | echo " " 80 | echo "gvn add [FILE_PATH]" 81 | echo "Add a file to be committed later" 82 | echo "Compare to: git add [FILE]" 83 | echo " " 84 | echo "gvn reset [FILE_PATH]" 85 | echo "Remove a file from being committed later" 86 | echo "Compare to: git reset [FILE]" 87 | echo " " 88 | echo "gvn commit [Commit message in quotes]" 89 | echo "commit local changes to repo" 90 | echo "Compare to: git commit -m [Commit message] && git push origin HEAD" 91 | echo " " 92 | echo "gvn log" 93 | echo "Show latest 10 log changes to repository" 94 | echo "Compare to: git log -n 10" 95 | echo " " 96 | echo "gvn diff [FILE]" 97 | echo "Show diff between file and server. Only supports a single file however" 98 | echo "Compare to: git diff" 99 | echo " " 100 | echo "Don't see what you are looking for?" 101 | echo "Try: https://github.com/garethrees/git-to-svn-guide/blob/master/README.md" 102 | } 103 | 104 | 105 | # CLI For git users to do svn stuff 106 | # USing this and learning repo as practice: https://github.com/garethrees/git-to-svn-guide/blob/master/README.md 107 | if [ "$#" -lt 1 ] || [ "$1" == "$GVN_SKIP_UPDATE_CHECK" ]; then 108 | __printgvninfo 109 | elif [ "$1" == "help" ]; then 110 | __printgvninfo 111 | elif [ "$1" == "update" ]; then 112 | echo " " 113 | echo "Gvn will update by creating a $GVN_UPDATE_PATH path, and storing the latest copy of gvn there." 114 | echo "Please review the current gvn script at: https://github.com/torch2424/gvn/blob/master/gvn.sh" 115 | echo " " 116 | __seek_confirmation "Is this okay?" 117 | echo " " 118 | 119 | if __is_confirmed; then 120 | echo "Updating gvn, please wait a moment..." 121 | echo " " 122 | 123 | mkdir "$GVN_UPDATE_PATH" 124 | curl "$GVN_URL" -o "$GVN_UPDATE_PATH/gvn.sh" 125 | 126 | echo "Update complete!" 127 | echo "Check the latest gvn script at: $GVN_UPDATE_PATH/gvn.sh" 128 | else 129 | echo "Local gvn will be used. Update cancelled..." 130 | echo " " 131 | fi 132 | elif [ "$1" == "clone" ]; then 133 | # Git clone -> svn checkout 134 | svn checkout "$2" 135 | elif [ "$1" == "pull" ]; then 136 | # git pull -> svn update 137 | svn update 138 | elif [ "$1" == "add" ]; then 139 | # git add -> svn changelist my-changelist [File here] 140 | svn add --force "$2" 141 | svn changelist "$GVN_CHANGELIST" "$2" 142 | elif [ "$1" == "reset" ]; then 143 | # git reset -> svn changelist --remove [File here] 144 | svn changelist --remove "$2" 145 | elif [ "$1" == "status" ]; then 146 | # git status -> svn status 147 | # Doing both info and stuts, because git will show you current branch and stuff 148 | svn info 149 | echo " " 150 | echo "SVN Status:" 151 | echo " " 152 | svn status | grep -v gvn 153 | echo " " 154 | echo "GVN Changes to be committed:" 155 | echo " (use \"gvn reset \" to unstage)" 156 | svn st --changelist "$GVN_CHANGELIST" | grep -v Changelist | cut -b 3- 157 | echo " " 158 | elif [ "$1" == "checkout" ]; then 159 | # git checkout file -> svn checkout file 160 | echo "This is checkout for files..." 161 | svn revert "$2" 162 | elif [ "$1" == "commit" ]; then 163 | 164 | if [ "$#" -eq 2 ]; then 165 | # git add $1 && git commit -m "$2" && git push origin HEAD -> svn commit $2 -m "$3" 166 | # After &&, # Remove all files from changelist, but keep changelist 167 | echo "Commiting changelist..." 168 | svn commit --changelist "$GVN_CHANGELIST" --keep-changelists -m "$2" && \ 169 | svn changelist --remove --recursive --cl "$GVN_CHANGELIST" . | grep -v D 170 | else 171 | echo "Must enter a commit message to commit the current changelist." 172 | fi 173 | elif [ "$1" == "log" ]; then 174 | # git log -n 10 -> svn log -v -l10 175 | svn log -l 5 -r PREV:HEAD 176 | elif [ "$1" == "diff" ]; then 177 | # git diff [FILE]. If git supports single file diffing? 178 | echo "Using Vim For colorful diffs" 179 | svn diff -r HEAD "$2" | vim -R - 180 | else 181 | echo "Command $1 is not suported. Type [gvn help] for info/help/usage and tips!" 182 | fi 183 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " Use double quotes to write a comment, with no closing quote 2 | 3 | " https://github.com/jez/vim-as-an-ide/commit/dff7da3 4 | 5 | " Need to run ':PluginInstall' for Vundle Plugins 6 | 7 | " Enable most vim settings 8 | set nocompatible 9 | 10 | " Force bash as shell (fish/vundle not compatible) 11 | set shell=/bin/bash 12 | 13 | " Vundle Setup 14 | filetype off 15 | 16 | set rtp+=~/.vim/bundle/Vundle.vim 17 | call vundle#begin() 18 | 19 | " Vundle set up 20 | Plugin 'VundleVim/Vundle.vim' 21 | 22 | " Vim Powerling clone 23 | Plugin 'itchyny/lightline.vim' 24 | 25 | " Color Scheme 26 | Plugin 'morhetz/gruvbox' 27 | 28 | " File Tree 29 | Plugin 'preservim/nerdtree' 30 | Plugin 'jistr/vim-nerdtree-tabs' 31 | 32 | " Editor Config 33 | Plugin 'editorconfig/editorconfig-vim' 34 | 35 | " () and {} autocomplete 36 | Plugin 'tpope/vim-surround' 37 | 38 | " Syntax Checking and Highlighting 39 | Plugin 'sheerun/vim-polyglot' 40 | 41 | " Inline Git 42 | Plugin 'airblade/vim-gitgutter' 43 | 44 | " Fuzzy Finding 45 | " Plugin 'ctrlpvim/ctrlp.vim' 46 | Plugin 'junegunn/fzf' 47 | Plugin 'junegunn/fzf.vim' 48 | 49 | " Linting 50 | " Plugin 'dense-analysis/ale' 51 | 52 | " Go Support 53 | " https://github.com/fatih/vim-go 54 | Plugin 'fatih/vim-go' 55 | 56 | " Autocomplete 57 | if has('nvim') 58 | Plugin 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } 59 | endif 60 | 61 | "Vim scrolling that wont make your eyes bleed 62 | " Plugin 'yuttie/comfortable-motion.vim' 63 | 64 | " Vim Multiple Cursors 65 | " Not using as they break my vim often 66 | " Plugin 'terryma/vim-multiple-cursors' 67 | " Plugin 'mg979/vim-visual-multi' 68 | 69 | call vundle#end() 70 | 71 | filetype plugin indent on 72 | 73 | " General Vim Settings 74 | set backspace=indent,eol,start 75 | set ruler 76 | set number 77 | set showcmd 78 | set incsearch 79 | set hlsearch 80 | " Always show gutter (dont move left to right) 81 | set signcolumn=yes 82 | " Update git and syntax more quickly 83 | set updatetime=250 84 | syntax on 85 | 86 | " --- PLUGIN SETTINGS START --- 87 | 88 | " Theme 89 | colorscheme gruvbox 90 | set background=dark 91 | let g:lightline = { 92 | \ 'colorscheme': 'wombat', 93 | \ } 94 | 95 | " File tree 96 | " ----- jistr/vim-nerdtree-tabs ----- 97 | " Open/close NERDTree Tabs with \t 98 | nmap t :NERDTreeTabsToggle 99 | " Double click to open files in a new tab 100 | function! OpenNERDTreeFileInTab() 101 | let l:node = g:NERDTreeFileNode.GetSelected() 102 | if l:node != {} && has_key(l:node, 'path') 103 | if !l:node.path['isDirectory'] 104 | let l:filepath = l:node.path.str() 105 | exec 'tabedit ' . l:filepath 106 | else 107 | call l:node.toggleOpen() 108 | endif 109 | endif 110 | NERDTreeRefresh 111 | endfunction 112 | autocmd FileType nerdtree nnoremap <2-LeftMouse> :call OpenNERDTreeFileInTab() 113 | " To have NERDTree always open on startup 114 | let g:nerdtree_tabs_open_on_console_startup = 1 115 | let NERDTreeShowHidden=1 116 | autocmd VimEnter * call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "FileNode", 'callback': "OpenInTab", 'override':1 }) 117 | function! OpenInTab(node) 118 | call a:node.activate({'reuse': 'all', 'where': 't'}) 119 | endfunction 120 | 121 | " We need this for plugins like Syntastic and vim-gitgutter which put symbols 122 | " in the sign column. 123 | hi clear SignColumn 124 | 125 | " ----- Deoplete settings ----- 126 | if has('nvim') 127 | let g:deoplete#enable_at_startup = 1 128 | endif 129 | 130 | " ----- Ale settings ----- 131 | let g:ale_sign_error = '✘' 132 | let g:ale_sign_warning = '▲' 133 | 134 | " ----- Ctrl-p settings ----- 135 | " Ctrl-p new tab 136 | let g:ctrlp_prompt_mappings = { 137 | \ 'AcceptSelection("e")': [''], 138 | \ 'AcceptSelection("t")': ['', '<2-LeftMouse>'], 139 | \ } 140 | " Ctrl-p not finding all files 141 | " https://github.com/kien/ctrlp.vim/issues/234 142 | let g:ctrlp_max_files=0 143 | let g:ctrlp_max_depth=100 144 | 145 | " ----- fzf settings ----- 146 | " fzf new tab 147 | let g:fzf_action = { 148 | \ 'return': 'tab split', 149 | \ 'ctrl-j': 'split', 150 | \ 'ctrl-k': 'vsplit' } 151 | " Command for git grep 152 | " - fzf#vim#grep(command, with_column, [options], [fullscreen]) 153 | command! -bang -nargs=* GGrep 154 | \ call fzf#vim#grep( 155 | \ 'git grep --line-number '.shellescape(), 0, 156 | \ { 'dir': systemlist('git rev-parse --show-toplevel')[0] }, 0) 157 | " When we need better searching / replacing 158 | " https://thevaluable.dev/vim-search/ 159 | " Ctrl p to serch files 160 | nmap :Files 161 | imap :Files 162 | " Ctrl f to search in project 163 | nmap :GGrep 164 | imap :GGrep 165 | 166 | " --- vim-go --- 167 | " Set our fmt command 168 | let g:go_fmt_command = "goimports" 169 | 170 | " Vim Multiple Curosrs Mouse Support 171 | " Undo Ctrl C mapping 172 | let g:VM_maps = {} 173 | let g:VM_maps["Visual Cursors"] = '' 174 | let g:VM_maps["Case Setting"] = '' 175 | 176 | " Mouse 177 | " let g:VM_mouse_mappings = 1 178 | " Doing this manually because CTRL Left click is an osx thing 179 | " So biunding to both left and right mouse 180 | nmap g 181 | nmap g 182 | imap g 183 | imap g 184 | 185 | " --- PLUGIN SETTINGS END --- 186 | 187 | " Use the mouse for everything 188 | " http://vim.wikia.com/wiki/Make_mouse_drag_not_select_text_or_go_into_visual_mode 189 | set mouse=a 190 | " Copy paste only: 191 | " set mouse=r 192 | " Mouse select on long lines 193 | " https://stackoverflow.com/questions/7000960/in-vim-why-doesnt-my-mouse-work-past-the-220th-column 194 | if !has('nvim') 195 | set ttymouse=sgr 196 | endif 197 | 198 | " Fix Copy Paste 199 | " https://stackoverflow.com/questions/17561706/vim-yank-does-not-seem-to-work 200 | if system('uname -s') == "Darwin\n" 201 | set clipboard=unnamed "OSX 202 | else 203 | set clipboard=unnamedplus "Linux 204 | endif 205 | 206 | " Stop auto comment insertion 207 | " https://superuser.com/questions/271023/can-i-disable-continuation-of-comments-to-the-next-line-in-vim 208 | autocmd BufNewFile,BufRead * setlocal formatoptions-=cro 209 | 210 | " Ctrl s to save 211 | nmap :w 212 | imap :wa 213 | 214 | " Ctrl q to quit 215 | nmap :q 216 | imap :qa 217 | 218 | " Ctrl v to paste like a normal person (with auto fixing indentation) 219 | " http://vim.wikia.com/wiki/Format_pasted_text_automatically 220 | nmap p p=`] 221 | nmap p 222 | 223 | " Vim Tips for normal Copy/Pase/Undo, etc.. 224 | " http://vim.wikia.com/wiki/VimTip356 225 | vmap yi 226 | vmap di 227 | imap pi 228 | imap ddi 229 | map 230 | imap ui 231 | 232 | " Reselect visual paste after shifting block 233 | " https://vi.stackexchange.com/questions/598/faster-way-to-move-a-block-of-text 234 | xnoremap > >gv 235 | xnoremap < 258 | noremap 259 | 260 | " Add support for file write detection by things like parcel 261 | " https://en.parceljs.org/hmr.html#safe-write 262 | :set backupcopy=yes 263 | -------------------------------------------------------------------------------- /itermGruvbox.itermcolors: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ansi 0 Color 6 | 7 | Alpha Component 8 | 1 9 | Blue Component 10 | 0.11759774386882782 11 | Color Space 12 | Calibrated 13 | Green Component 14 | 0.11759573966264725 15 | Red Component 16 | 0.11759927868843079 17 | 18 | Ansi 1 Color 19 | 20 | Alpha Component 21 | 1 22 | Blue Component 23 | 0.090684391558170319 24 | Color Space 25 | Calibrated 26 | Green Component 27 | 0.05879192054271698 28 | Red Component 29 | 0.74529051780700684 30 | 31 | Ansi 10 Color 32 | 33 | Alpha Component 34 | 1 35 | Blue Component 36 | 0.11661489307880402 37 | Color Space 38 | Calibrated 39 | Green Component 40 | 0.69061970710754395 41 | Red Component 42 | 0.66574931144714355 43 | 44 | Ansi 11 Color 45 | 46 | Alpha Component 47 | 1 48 | Blue Component 49 | 0.1444794088602066 50 | Color Space 51 | Calibrated 52 | Green Component 53 | 0.6926688551902771 54 | Red Component 55 | 0.96949708461761475 56 | 57 | Ansi 12 Color 58 | 59 | Alpha Component 60 | 1 61 | Blue Component 62 | 0.52537077665328979 63 | Color Space 64 | Calibrated 65 | Green Component 66 | 0.58534377813339233 67 | Red Component 68 | 0.44289660453796387 69 | 70 | Ansi 13 Color 71 | 72 | Alpha Component 73 | 1 74 | Blue Component 75 | 0.53848373889923096 76 | Color Space 77 | Calibrated 78 | Green Component 79 | 0.43883562088012695 80 | Red Component 81 | 0.78096956014633179 82 | 83 | Ansi 14 Color 84 | 85 | Alpha Component 86 | 1 87 | Blue Component 88 | 0.41142863035202026 89 | Color Space 90 | Calibrated 91 | Green Component 92 | 0.71257460117340088 93 | Red Component 94 | 0.49072420597076416 95 | 96 | Ansi 15 Color 97 | 98 | Alpha Component 99 | 1 100 | Blue Component 101 | 0.63873869180679321 102 | Color Space 103 | Calibrated 104 | Green Component 105 | 0.82989895343780518 106 | Red Component 107 | 0.90061241388320923 108 | 109 | Ansi 2 Color 110 | 111 | Alpha Component 112 | 1 113 | Blue Component 114 | 0.082894742488861084 115 | Color Space 116 | Calibrated 117 | Green Component 118 | 0.53061914443969727 119 | Red Component 120 | 0.52591603994369507 121 | 122 | Ansi 3 Color 123 | 124 | Alpha Component 125 | 1 126 | Blue Component 127 | 0.10328958928585052 128 | Color Space 129 | Calibrated 130 | Green Component 131 | 0.53254079818725586 132 | Red Component 133 | 0.80126690864562988 134 | 135 | Ansi 4 Color 136 | 137 | Alpha Component 138 | 1 139 | Blue Component 140 | 0.4586675763130188 141 | Color Space 142 | Calibrated 143 | Green Component 144 | 0.45008346438407898 145 | Red Component 146 | 0.21694663166999817 147 | 148 | Ansi 5 Color 149 | 150 | Alpha Component 151 | 1 152 | Blue Component 153 | 0.45103743672370911 154 | Color Space 155 | Calibrated 156 | Green Component 157 | 0.29604318737983704 158 | Red Component 159 | 0.62685638666152954 160 | 161 | Ansi 6 Color 162 | 163 | Alpha Component 164 | 1 165 | Blue Component 166 | 0.34128850698471069 167 | Color Space 168 | Calibrated 169 | Green Component 170 | 0.55607825517654419 171 | Red Component 172 | 0.34054014086723328 173 | 174 | Ansi 7 Color 175 | 176 | Alpha Component 177 | 1 178 | Blue Component 179 | 0.44320183992385864 180 | Color Space 181 | Calibrated 182 | Green Component 183 | 0.5310559868812561 184 | Red Component 185 | 0.5926094651222229 186 | 187 | Ansi 8 Color 188 | 189 | Alpha Component 190 | 1 191 | Blue Component 192 | 0.37962067127227783 193 | Color Space 194 | Calibrated 195 | Green Component 196 | 0.43934443593025208 197 | Red Component 198 | 0.49889594316482544 199 | 200 | Ansi 9 Color 201 | 202 | Alpha Component 203 | 1 204 | Blue Component 205 | 0.15763583779335022 206 | Color Space 207 | Calibrated 208 | Green Component 209 | 0.18880486488342285 210 | Red Component 211 | 0.96744710206985474 212 | 213 | Background Color 214 | 215 | Alpha Component 216 | 1 217 | Blue Component 218 | 0.11759774386882782 219 | Color Space 220 | Calibrated 221 | Green Component 222 | 0.11759573966264725 223 | Red Component 224 | 0.11759927868843079 225 | 226 | Badge Color 227 | 228 | Alpha Component 229 | 0.5 230 | Blue Component 231 | 0.056549370288848877 232 | Color Space 233 | Calibrated 234 | Green Component 235 | 0.28100395202636719 236 | Red Component 237 | 0.7928692102432251 238 | 239 | Bold Color 240 | 241 | Alpha Component 242 | 1 243 | Blue Component 244 | 1 245 | Color Space 246 | Calibrated 247 | Green Component 248 | 1 249 | Red Component 250 | 1 251 | 252 | Cursor Color 253 | 254 | Alpha Component 255 | 1 256 | Blue Component 257 | 0.63873869180679321 258 | Color Space 259 | Calibrated 260 | Green Component 261 | 0.82989895343780518 262 | Red Component 263 | 0.90061241388320923 264 | 265 | Cursor Guide Color 266 | 267 | Alpha Component 268 | 1 269 | Blue Component 270 | 0.15993706881999969 271 | Color Space 272 | Calibrated 273 | Green Component 274 | 0.16613791882991791 275 | Red Component 276 | 0.17867125570774078 277 | 278 | Cursor Text Color 279 | 280 | Alpha Component 281 | 1 282 | Blue Component 283 | 0.11759774386882782 284 | Color Space 285 | Calibrated 286 | Green Component 287 | 0.11759573966264725 288 | Red Component 289 | 0.11759927868843079 290 | 291 | Foreground Color 292 | 293 | Alpha Component 294 | 1 295 | Blue Component 296 | 0.63873869180679321 297 | Color Space 298 | Calibrated 299 | Green Component 300 | 0.82989895343780518 301 | Red Component 302 | 0.90061241388320923 303 | 304 | Link Color 305 | 306 | Alpha Component 307 | 1 308 | Blue Component 309 | 0.056549370288848877 310 | Color Space 311 | Calibrated 312 | Green Component 313 | 0.28100395202636719 314 | Red Component 315 | 0.7928692102432251 316 | 317 | Selected Text Color 318 | 319 | Alpha Component 320 | 1 321 | Blue Component 322 | 0.26041668653488159 323 | Color Space 324 | Calibrated 325 | Green Component 326 | 0.2891082763671875 327 | Red Component 328 | 0.32501408457756042 329 | 330 | Selection Color 331 | 332 | Alpha Component 333 | 1 334 | Blue Component 335 | 0.63873869180679321 336 | Color Space 337 | Calibrated 338 | Green Component 339 | 0.82989895343780518 340 | Red Component 341 | 0.90061241388320923 342 | 343 | 344 | 345 | -------------------------------------------------------------------------------- /.files_libs/piShrink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Taken From: https://github.com/Drewsif/PiShrink/ 4 | 5 | usage() { echo "Usage: $0 [-s] imagefile.img [newimagefile.img]"; exit -1; } 6 | 7 | should_skip_autoexpand=false 8 | 9 | while getopts ":s" opt; do 10 | case "${opt}" in 11 | s) should_skip_autoexpand=true ;; 12 | *) usage ;; 13 | esac 14 | done 15 | shift $((OPTIND-1)) 16 | 17 | #Args 18 | img=$1 19 | 20 | #Usage checks 21 | if [[ -z $img ]]; then 22 | usage 23 | fi 24 | if [[ ! -e $img ]]; then 25 | echo "ERROR: $img is not a file..." 26 | exit -2 27 | fi 28 | if (( EUID != 0 )); then 29 | echo "ERROR: You need to be running as root." 30 | exit -3 31 | fi 32 | 33 | #Check that what we need is installed 34 | A=`which parted 2>&1` 35 | if (( $? != 0 )); then 36 | echo "ERROR: parted is not installed." 37 | exit -4 38 | fi 39 | 40 | #Copy to new file if requested 41 | if [ -n "$2" ]; then 42 | echo "Copying $1 to $2..." 43 | cp --reflink=auto --sparse=always "$1" "$2" 44 | if (( $? != 0 )); then 45 | echo "ERROR: Could not copy file..." 46 | exit -5 47 | fi 48 | img=$2 49 | fi 50 | 51 | #Gather info 52 | beforesize=`ls -lah $img | cut -d ' ' -f 5` 53 | partnum=`parted -m $img unit B print | tail -n 1 | cut -d ':' -f 1 | tr -d '\n'` 54 | partstart=`parted -m $img unit B print | tail -n 1 | cut -d ':' -f 2 | tr -d 'B\n'` 55 | loopback=`losetup -f --show -o $partstart $img` 56 | currentsize=`tune2fs -l $loopback | grep 'Block count' | tr -d ' ' | cut -d ':' -f 2 | tr -d '\n'` 57 | blocksize=`tune2fs -l $loopback | grep 'Block size' | tr -d ' ' | cut -d ':' -f 2 | tr -d '\n'` 58 | 59 | #Check if we should make pi expand rootfs on next boot 60 | if [ "$should_skip_autoexpand" = false ]; then 61 | #Make pi expand rootfs on next boot 62 | mountdir=`mktemp -d` 63 | mount $loopback $mountdir 64 | 65 | if [ `md5sum $mountdir/etc/rc.local | cut -d ' ' -f 1` != "a27a4d8192ea6ba713d2ddd15a55b1df" ]; then 66 | echo Creating new /etc/rc.local 67 | mv $mountdir/etc/rc.local $mountdir/etc/rc.local.bak 68 | ###Do not touch the following 6 lines including EOF### 69 | cat <<\EOF > $mountdir/etc/rc.local 70 | #!/bin/bash 71 | /usr/bin/raspi-config --expand-rootfs 72 | rm -f /etc/rc.local; cp -f /etc/rc.local.bak /etc/rc.local; reboot 73 | exit 0 74 | EOF 75 | ###End no touch zone### 76 | chmod +x $mountdir/etc/rc.local 77 | fi 78 | umount $mountdir 79 | else 80 | echo Skipping autoexpanding process... 81 | fi 82 | 83 | #Make sure filesystem is ok 84 | e2fsck -f $loopback 85 | minsize=`resize2fs -P $loopback | cut -d ':' -f 2 | tr -d ' ' | tr -d '\n'` 86 | if [[ $currentsize -eq $minsize ]]; then 87 | echo ERROR: Image already shrunk to smallest size 88 | exit -6 89 | fi 90 | 91 | #Add some free space to the end of the filesystem 92 | if [[ `expr $currentsize - $minsize - 5000` -gt 0 ]]; then 93 | minsize=`expr $minsize + 5000 | tr -d '\n'` 94 | elif [[ `expr $currentsize - $minsize - 1000` -gt 0 ]]; then 95 | minsize=`expr $minsize + 1000 | tr -d '\n'` 96 | elif [[ `expr $currentsize - $minsize - 100` -gt 0 ]]; then 97 | minsize=`expr $minsize + 100 | tr -d '\n'` 98 | fi 99 | 100 | #Shrink filesystem 101 | resize2fs -p $loopback $minsize 102 | if [[ $? != 0 ]]; then 103 | echo ERROR: resize2fs failed... 104 | mount $loopback $mountdir 105 | mv $mountdir/etc/rc.local.bak $mountdir/etc/rc.local 106 | umount $mountdir 107 | losetup -d $loopback 108 | exit $rc 109 | fi 110 | sleep 1 111 | 112 | #Shrink partition 113 | losetup -d $loopback 114 | partnewsize=`expr $minsize \* $blocksize | tr -d '\n'` 115 | newpartend=`expr $partstart + $partnewsize | tr -d '\n'` 116 | part1=`parted $img rm $partnum` 117 | part2=`parted $img unit B mkpart primary $partstart $newpartend` 118 | 119 | #Truncate the file 120 | endresult=`parted -m $img unit B print free | tail -1 | cut -d ':' -f 2 | tr -d 'B\n'` 121 | truncate -s $endresult $img 122 | aftersize=`ls -lah $img | cut -d ' ' -f 5` 123 | 124 | echo "Shrunk $img from $beforesize to $aftersize" 125 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /.files_libs/sexy_prompt/bash_sexy_theme.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Sexy bash prompt by twolfson 3 | # https://github.com/twolfson/sexy-bash-prompt 4 | # Forked from gf3, https://gist.github.com/gf3/306785 5 | 6 | # If we are on a colored terminal 7 | if tput setaf 1 &> /dev/null; then 8 | # Reset the shell from our `if` check 9 | tput sgr0 &> /dev/null 10 | 11 | # If you would like to customize your colors, use 12 | # # Attribution: http://linuxtidbits.wordpress.com/2008/08/11/output-color-on-bash-scripts/ 13 | # for i in $(seq 0 $(tput colors)); do 14 | # echo " $(tput setaf $i)Text$(tput sgr0) $(tput bold)$(tput setaf $i)Text$(tput sgr0) $(tput sgr 0 1)$(tput setaf $i)Text$(tput sgr0) \$(tput setaf $i)" 15 | # done 16 | 17 | # Save common color actions 18 | sexy_bash_prompt_bold="$(tput bold)" 19 | sexy_bash_prompt_reset="$(tput sgr0)" 20 | 21 | # If the terminal supports at least 256 colors, write out our 256 color based set 22 | if [[ "$(tput colors)" -ge 256 ]] &> /dev/null; then 23 | sexy_bash_prompt_user_color="$sexy_bash_prompt_bold$(tput setaf 27)" # BOLD BLUE 24 | sexy_bash_prompt_preposition_color="$sexy_bash_prompt_bold$(tput setaf 7)" # BOLD WHITE 25 | sexy_bash_prompt_device_color="$sexy_bash_prompt_bold$(tput setaf 39)" # BOLD CYAN 26 | sexy_bash_prompt_dir_color="$sexy_bash_prompt_bold$(tput setaf 76)" # BOLD GREEN 27 | sexy_bash_prompt_git_status_color="$sexy_bash_prompt_bold$(tput setaf 154)" # BOLD YELLOW 28 | sexy_bash_prompt_git_progress_color="$sexy_bash_prompt_bold$(tput setaf 9)" # BOLD RED 29 | else 30 | # Otherwise, use colors from our set of 8 31 | sexy_bash_prompt_user_color="$sexy_bash_prompt_bold$(tput setaf 4)" # BOLD BLUE 32 | sexy_bash_prompt_preposition_color="$sexy_bash_prompt_bold$(tput setaf 7)" # BOLD WHITE 33 | sexy_bash_prompt_device_color="$sexy_bash_prompt_bold$(tput setaf 6)" # BOLD CYAN 34 | sexy_bash_prompt_dir_color="$sexy_bash_prompt_bold$(tput setaf 2)" # BOLD GREEN 35 | sexy_bash_prompt_git_status_color="$sexy_bash_prompt_bold$(tput setaf 3)" # BOLD YELLOW 36 | sexy_bash_prompt_git_progress_color="$sexy_bash_prompt_bold$(tput setaf 1)" # BOLD RED 37 | fi 38 | 39 | sexy_bash_prompt_symbol_color="$sexy_bash_prompt_bold" # BOLD 40 | 41 | else 42 | # Otherwise, use ANSI escape sequences for coloring 43 | # If you would like to customize your colors, use 44 | # DEV: 30-39 lines up 0-9 from `tput` 45 | # for i in $(seq 0 109); do 46 | # echo -n -e "\033[1;${i}mText$(tput sgr0) " 47 | # echo "\033[1;${i}m" 48 | # done 49 | 50 | sexy_bash_prompt_reset="\033[m" 51 | sexy_bash_prompt_user_color="\033[1;34m" # BLUE 52 | sexy_bash_prompt_preposition_color="\033[1;37m" # WHITE 53 | sexy_bash_prompt_device_color="\033[1;36m" # CYAN 54 | sexy_bash_prompt_dir_color="\033[1;32m" # GREEN 55 | sexy_bash_prompt_git_status_color="\033[1;33m" # YELLOW 56 | sexy_bash_prompt_git_progress_color="\033[1;31m" # RED 57 | sexy_bash_prompt_symbol_color="" # NORMAL 58 | fi 59 | 60 | # Define the default prompt terminator character '$' 61 | if [[ "$UID" == 0 ]]; then 62 | sexy_bash_prompt_symbol="#" 63 | else 64 | sexy_bash_prompt_symbol="\$" 65 | fi 66 | 67 | # Apply any color overrides that have been set in the environment 68 | if [[ -n "$PROMPT_USER_COLOR" ]]; then sexy_bash_prompt_user_color="$PROMPT_USER_COLOR"; fi 69 | if [[ -n "$PROMPT_PREPOSITION_COLOR" ]]; then sexy_bash_prompt_preposition_color="$PROMPT_PREPOSITION_COLOR"; fi 70 | if [[ -n "$PROMPT_DEVICE_COLOR" ]]; then sexy_bash_prompt_device_color="$PROMPT_DEVICE_COLOR"; fi 71 | if [[ -n "$PROMPT_DIR_COLOR" ]]; then sexy_bash_prompt_dir_color="$PROMPT_DIR_COLOR"; fi 72 | if [[ -n "$PROMPT_GIT_STATUS_COLOR" ]]; then sexy_bash_prompt_git_status_color="$PROMPT_GIT_STATUS_COLOR"; fi 73 | if [[ -n "$PROMPT_GIT_PROGRESS_COLOR" ]]; then sexy_bash_prompt_git_progress_color="$PROMPT_GIT_PROGRESS_COLOR"; fi 74 | if [[ -n "$PROMPT_SYMBOL" ]]; then sexy_bash_prompt_symbol="$PROMPT_SYMBOL"; fi 75 | if [[ -n "$PROMPT_SYMBOL_COLOR" ]]; then sexy_bash_prompt_symbol_color="$PROMPT_SYMBOL_COLOR"; fi 76 | 77 | # Set up symbols 78 | sexy_bash_prompt_synced_symbol="" 79 | sexy_bash_prompt_dirty_synced_symbol="*" 80 | sexy_bash_prompt_unpushed_symbol="△" 81 | sexy_bash_prompt_dirty_unpushed_symbol="▲" 82 | sexy_bash_prompt_unpulled_symbol="▽" 83 | sexy_bash_prompt_dirty_unpulled_symbol="▼" 84 | sexy_bash_prompt_unpushed_unpulled_symbol="⬡" 85 | sexy_bash_prompt_dirty_unpushed_unpulled_symbol="⬢" 86 | 87 | # Apply symbol overrides that have been set in the environment 88 | # DEV: Working unicode symbols can be determined via the following gist 89 | # **WARNING: The following gist has 64k lines and may freeze your browser** 90 | # https://gist.github.com/twolfson/9cc7968eb6ee8b9ad877 91 | if [[ -n "$PROMPT_SYNCED_SYMBOL" ]]; then sexy_bash_prompt_synced_symbol="$PROMPT_SYNCED_SYMBOL"; fi 92 | if [[ -n "$PROMPT_DIRTY_SYNCED_SYMBOL" ]]; then sexy_bash_prompt_dirty_synced_symbol="$PROMPT_DIRTY_SYNCED_SYMBOL"; fi 93 | if [[ -n "$PROMPT_UNPUSHED_SYMBOL" ]]; then sexy_bash_prompt_unpushed_symbol="$PROMPT_UNPUSHED_SYMBOL"; fi 94 | if [[ -n "$PROMPT_DIRTY_UNPUSHED_SYMBOL" ]]; then sexy_bash_prompt_dirty_unpushed_symbol="$PROMPT_DIRTY_UNPUSHED_SYMBOL"; fi 95 | if [[ -n "$PROMPT_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_unpulled_symbol="$PROMPT_UNPULLED_SYMBOL"; fi 96 | if [[ -n "$PROMPT_DIRTY_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_dirty_unpulled_symbol="$PROMPT_DIRTY_UNPULLED_SYMBOL"; fi 97 | if [[ -n "$PROMPT_UNPUSHED_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_unpushed_unpulled_symbol="$PROMPT_UNPUSHED_UNPULLED_SYMBOL"; fi 98 | if [[ -n "$PROMPT_DIRTY_UNPUSHED_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_dirty_unpushed_unpulled_symbol="$PROMPT_DIRTY_UNPUSHED_UNPULLED_SYMBOL"; fi 99 | 100 | function sexy_bash_prompt_get_git_branch() { 101 | # On branches, this will return the branch name 102 | # On non-branches, (no branch) 103 | ref="$(git symbolic-ref HEAD 2> /dev/null | sed -e 's/refs\/heads\///')" 104 | if [[ "$ref" != "" ]]; then 105 | echo "$ref" 106 | else 107 | echo "(no branch)" 108 | fi 109 | } 110 | 111 | function sexy_bash_prompt_get_git_progress() { 112 | # Detect in-progress actions (e.g. merge, rebase) 113 | # https://github.com/git/git/blob/v1.9-rc2/wt-status.c#L1199-L1241 114 | git_dir="$(git rev-parse --git-dir)" 115 | 116 | # git merge 117 | if [[ -f "$git_dir/MERGE_HEAD" ]]; then 118 | echo " [merge]" 119 | elif [[ -d "$git_dir/rebase-apply" ]]; then 120 | # git am 121 | if [[ -f "$git_dir/rebase-apply/applying" ]]; then 122 | echo " [am]" 123 | # git rebase 124 | else 125 | echo " [rebase]" 126 | fi 127 | elif [[ -d "$git_dir/rebase-merge" ]]; then 128 | # git rebase --interactive/--merge 129 | echo " [rebase]" 130 | elif [[ -f "$git_dir/CHERRY_PICK_HEAD" ]]; then 131 | # git cherry-pick 132 | echo " [cherry-pick]" 133 | fi 134 | if [[ -f "$git_dir/BISECT_LOG" ]]; then 135 | # git bisect 136 | echo " [bisect]" 137 | fi 138 | if [[ -f "$git_dir/REVERT_HEAD" ]]; then 139 | # git revert --no-commit 140 | echo " [revert]" 141 | fi 142 | } 143 | 144 | sexy_bash_prompt_is_branch1_behind_branch2 () { 145 | # $ git log origin/master..master -1 146 | # commit 4a633f715caf26f6e9495198f89bba20f3402a32 147 | # Author: Todd Wolfson 148 | # Date: Sun Jul 7 22:12:17 2013 -0700 149 | # 150 | # Unsynced commit 151 | 152 | # Find the first log (if any) that is in branch1 but not branch2 153 | first_log="$(git log $1..$2 -1 2> /dev/null)" 154 | 155 | # Exit with 0 if there is a first log, 1 if there is not 156 | [[ -n "$first_log" ]] 157 | } 158 | 159 | sexy_bash_prompt_branch_exists () { 160 | # List remote branches | # Find our branch and exit with 0 or 1 if found/not found 161 | git branch --remote 2> /dev/null | grep --quiet "$1" 162 | } 163 | 164 | sexy_bash_prompt_parse_git_ahead () { 165 | # Grab the local and remote branch 166 | branch="$(sexy_bash_prompt_get_git_branch)" 167 | remote_branch="origin/$branch" 168 | 169 | # $ git log origin/master..master 170 | # commit 4a633f715caf26f6e9495198f89bba20f3402a32 171 | # Author: Todd Wolfson 172 | # Date: Sun Jul 7 22:12:17 2013 -0700 173 | # 174 | # Unsynced commit 175 | 176 | # If the remote branch is behind the local branch 177 | # or it has not been merged into origin (remote branch doesn't exist) 178 | if (sexy_bash_prompt_is_branch1_behind_branch2 "$remote_branch" "$branch" || 179 | ! sexy_bash_prompt_branch_exists "$remote_branch"); then 180 | # echo our character 181 | echo 1 182 | fi 183 | } 184 | 185 | sexy_bash_prompt_parse_git_behind () { 186 | # Grab the branch 187 | branch="$(sexy_bash_prompt_get_git_branch)" 188 | remote_branch="origin/$branch" 189 | 190 | # $ git log master..origin/master 191 | # commit 4a633f715caf26f6e9495198f89bba20f3402a32 192 | # Author: Todd Wolfson 193 | # Date: Sun Jul 7 22:12:17 2013 -0700 194 | # 195 | # Unsynced commit 196 | 197 | # If the local branch is behind the remote branch 198 | if sexy_bash_prompt_is_branch1_behind_branch2 "$branch" "$remote_branch"; then 199 | # echo our character 200 | echo 1 201 | fi 202 | } 203 | 204 | function sexy_bash_prompt_parse_git_dirty() { 205 | # If the git status has *any* changes (e.g. dirty), echo our character 206 | if [[ -n "$(git status --porcelain 2> /dev/null)" ]]; then 207 | echo 1 208 | fi 209 | } 210 | 211 | function sexy_bash_prompt_is_on_git() { 212 | git rev-parse 2> /dev/null 213 | } 214 | 215 | function sexy_bash_prompt_get_git_status() { 216 | # Grab the git dirty and git behind 217 | dirty_branch="$(sexy_bash_prompt_parse_git_dirty)" 218 | branch_ahead="$(sexy_bash_prompt_parse_git_ahead)" 219 | branch_behind="$(sexy_bash_prompt_parse_git_behind)" 220 | 221 | # Iterate through all the cases and if it matches, then echo 222 | if [[ "$dirty_branch" == 1 && "$branch_ahead" == 1 && "$branch_behind" == 1 ]]; then 223 | echo "$sexy_bash_prompt_dirty_unpushed_unpulled_symbol" 224 | elif [[ "$branch_ahead" == 1 && "$branch_behind" == 1 ]]; then 225 | echo "$sexy_bash_prompt_unpushed_unpulled_symbol" 226 | elif [[ "$dirty_branch" == 1 && "$branch_ahead" == 1 ]]; then 227 | echo "$sexy_bash_prompt_dirty_unpushed_symbol" 228 | elif [[ "$branch_ahead" == 1 ]]; then 229 | echo "$sexy_bash_prompt_unpushed_symbol" 230 | elif [[ "$dirty_branch" == 1 && "$branch_behind" == 1 ]]; then 231 | echo "$sexy_bash_prompt_dirty_unpulled_symbol" 232 | elif [[ "$branch_behind" == 1 ]]; then 233 | echo "$sexy_bash_prompt_unpulled_symbol" 234 | elif [[ "$dirty_branch" == 1 ]]; then 235 | echo "$sexy_bash_prompt_dirty_synced_symbol" 236 | else # clean 237 | echo "$sexy_bash_prompt_synced_symbol" 238 | fi 239 | } 240 | 241 | sexy_bash_prompt_get_git_info () { 242 | # Grab the branch 243 | branch="$(sexy_bash_prompt_get_git_branch)" 244 | 245 | # If there are any branches 246 | if [[ "$branch" != "" ]]; then 247 | # Echo the branch 248 | output="$branch" 249 | 250 | # Add on the git status 251 | output="$output$(sexy_bash_prompt_get_git_status)" 252 | 253 | # Echo our output 254 | echo "$output" 255 | fi 256 | } 257 | 258 | # Define the sexy-bash-prompt 259 | # Modified using ChatGPT to remove echo -n on 10-3-2023 260 | PS1="\[$sexy_bash_prompt_user_color\]\u\[$sexy_bash_prompt_reset\] \ 261 | \[$sexy_bash_prompt_preposition_color\]at\[$sexy_bash_prompt_reset\] \ 262 | \[$sexy_bash_prompt_device_color\]\h\[$sexy_bash_prompt_reset\] \ 263 | \[$sexy_bash_prompt_preposition_color\]in\[$sexy_bash_prompt_reset\] \ 264 | \[$sexy_bash_prompt_dir_color\]\w\[$sexy_bash_prompt_reset\]\ 265 | \$(sexy_bash_prompt_is_on_git && \ 266 | echo \" \[$sexy_bash_prompt_preposition_color\]on\[$sexy_bash_prompt_reset\] \ 267 | \[$sexy_bash_prompt_git_status_color\]\$(sexy_bash_prompt_get_git_info)\ 268 | \[$sexy_bash_prompt_git_progress_color\]\$(sexy_bash_prompt_get_git_progress)\ 269 | \[$sexy_bash_prompt_preposition_color\]\")\[$sexy_bash_prompt_reset\]\ 270 | \[$sexy_bash_prompt_symbol_color\] $sexy_bash_prompt_symbol \[$sexy_bash_prompt_reset\]" 271 | -------------------------------------------------------------------------------- /itermProfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "Ansi 8 Color" : { 3 | "Red Component" : 0.49889594316482544, 4 | "Color Space" : "Calibrated", 5 | "Blue Component" : 0.37962067127227783, 6 | "Alpha Component" : 1, 7 | "Green Component" : 0.43934443593025208 8 | }, 9 | "Tags" : [ 10 | 11 | ], 12 | "Ansi 12 Color" : { 13 | "Red Component" : 0.44289660453796387, 14 | "Color Space" : "Calibrated", 15 | "Blue Component" : 0.52537077665328979, 16 | "Alpha Component" : 1, 17 | "Green Component" : 0.58534377813339233 18 | }, 19 | "Ansi 9 Color" : { 20 | "Red Component" : 0.96744710206985474, 21 | "Color Space" : "Calibrated", 22 | "Blue Component" : 0.15763583779335022, 23 | "Alpha Component" : 1, 24 | "Green Component" : 0.18880486488342285 25 | }, 26 | "Ansi 7 Color" : { 27 | "Red Component" : 0.5926094651222229, 28 | "Color Space" : "Calibrated", 29 | "Blue Component" : 0.44320183992385864, 30 | "Alpha Component" : 1, 31 | "Green Component" : 0.5310559868812561 32 | }, 33 | "Bold Color" : { 34 | "Red Component" : 1, 35 | "Color Space" : "Calibrated", 36 | "Blue Component" : 1, 37 | "Alpha Component" : 1, 38 | "Green Component" : 1 39 | }, 40 | "Custom Directory" : "No", 41 | "Guid" : "8CEDF9FB-7FE6-4760-B004-39388A0BC2D9", 42 | "Link Color" : { 43 | "Red Component" : 0.7928692102432251, 44 | "Color Space" : "Calibrated", 45 | "Blue Component" : 0.056549370288848877, 46 | "Alpha Component" : 1, 47 | "Green Component" : 0.28100395202636719 48 | }, 49 | "Rows" : 25, 50 | "Default Bookmark" : "No", 51 | "Cursor Guide Color" : { 52 | "Red Component" : 0.17867125570774078, 53 | "Color Space" : "Calibrated", 54 | "Blue Component" : 0.15993706881999969, 55 | "Alpha Component" : 1, 56 | "Green Component" : 0.16613791882991791 57 | }, 58 | "Non-ASCII Anti Aliased" : true, 59 | "Use Bright Bold" : true, 60 | "Ansi 10 Color" : { 61 | "Red Component" : 0.66574931144714355, 62 | "Color Space" : "Calibrated", 63 | "Blue Component" : 0.11661489307880402, 64 | "Alpha Component" : 1, 65 | "Green Component" : 0.69061970710754395 66 | }, 67 | "Ambiguous Double Width" : false, 68 | "Jobs to Ignore" : [ 69 | "rlogin", 70 | "ssh", 71 | "slogin", 72 | "telnet" 73 | ], 74 | "Ansi 15 Color" : { 75 | "Red Component" : 0.90061241388320923, 76 | "Color Space" : "Calibrated", 77 | "Blue Component" : 0.63873869180679321, 78 | "Alpha Component" : 1, 79 | "Green Component" : 0.82989895343780518 80 | }, 81 | "Foreground Color" : { 82 | "Red Component" : 0.90061241388320923, 83 | "Color Space" : "Calibrated", 84 | "Blue Component" : 0.63873869180679321, 85 | "Alpha Component" : 1, 86 | "Green Component" : 0.82989895343780518 87 | }, 88 | "Working Directory" : "\/Users\/aaron", 89 | "Blinking Cursor" : true, 90 | "Disable Window Resizing" : true, 91 | "Sync Title" : false, 92 | "Description" : "Default", 93 | "BM Growl" : true, 94 | "Command" : "", 95 | "Mouse Reporting" : true, 96 | "Prompt Before Closing 2" : false, 97 | "Screen" : -1, 98 | "Selection Color" : { 99 | "Red Component" : 0.90061241388320923, 100 | "Color Space" : "Calibrated", 101 | "Blue Component" : 0.63873869180679321, 102 | "Alpha Component" : 1, 103 | "Green Component" : 0.82989895343780518 104 | }, 105 | "Columns" : 80, 106 | "Idle Code" : 0, 107 | "Only The Default BG Color Uses Transparency" : false, 108 | "Ansi 13 Color" : { 109 | "Red Component" : 0.78096956014633179, 110 | "Color Space" : "Calibrated", 111 | "Blue Component" : 0.53848373889923096, 112 | "Alpha Component" : 1, 113 | "Green Component" : 0.43883562088012695 114 | }, 115 | "Custom Command" : "No", 116 | "ASCII Anti Aliased" : true, 117 | "Non Ascii Font" : "Monaco 12", 118 | "Vertical Spacing" : 1.0250282379518074, 119 | "Use Bold Font" : true, 120 | "Option Key Sends" : 0, 121 | "Selected Text Color" : { 122 | "Red Component" : 0.32501408457756042, 123 | "Color Space" : "Calibrated", 124 | "Blue Component" : 0.26041668653488159, 125 | "Alpha Component" : 1, 126 | "Green Component" : 0.2891082763671875 127 | }, 128 | "Background Color" : { 129 | "Red Component" : 0.11759927868843079, 130 | "Color Space" : "Calibrated", 131 | "Blue Component" : 0.11759774386882782, 132 | "Alpha Component" : 1, 133 | "Green Component" : 0.11759573966264725 134 | }, 135 | "Character Encoding" : 4, 136 | "Ansi 11 Color" : { 137 | "Red Component" : 0.96949708461761475, 138 | "Color Space" : "Calibrated", 139 | "Blue Component" : 0.1444794088602066, 140 | "Alpha Component" : 1, 141 | "Green Component" : 0.6926688551902771 142 | }, 143 | "Thin Strokes" : 3, 144 | "Use Italic Font" : true, 145 | "Unlimited Scrollback" : false, 146 | "Keyboard Map" : { 147 | "0xf700-0x260000" : { 148 | "Action" : 10, 149 | "Text" : "[1;6A" 150 | }, 151 | "0x37-0x40000" : { 152 | "Action" : 11, 153 | "Text" : "0x1f" 154 | }, 155 | "0x32-0x40000" : { 156 | "Action" : 11, 157 | "Text" : "0x00" 158 | }, 159 | "0xf709-0x20000" : { 160 | "Action" : 10, 161 | "Text" : "[17;2~" 162 | }, 163 | "0xf70c-0x20000" : { 164 | "Action" : 10, 165 | "Text" : "[20;2~" 166 | }, 167 | "0xf729-0x20000" : { 168 | "Action" : 10, 169 | "Text" : "[1;2H" 170 | }, 171 | "0xf72b-0x40000" : { 172 | "Action" : 10, 173 | "Text" : "[1;5F" 174 | }, 175 | "0xf705-0x20000" : { 176 | "Action" : 10, 177 | "Text" : "[1;2Q" 178 | }, 179 | "0xf703-0x260000" : { 180 | "Action" : 10, 181 | "Text" : "[1;6C" 182 | }, 183 | "0xf700-0x220000" : { 184 | "Action" : 10, 185 | "Text" : "[1;2A" 186 | }, 187 | "0xf701-0x280000" : { 188 | "Action" : 11, 189 | "Text" : "0x1b 0x1b 0x5b 0x42" 190 | }, 191 | "0x38-0x40000" : { 192 | "Action" : 11, 193 | "Text" : "0x7f" 194 | }, 195 | "0x33-0x40000" : { 196 | "Action" : 11, 197 | "Text" : "0x1b" 198 | }, 199 | "0xf703-0x220000" : { 200 | "Action" : 10, 201 | "Text" : "[1;2C" 202 | }, 203 | "0xf701-0x240000" : { 204 | "Action" : 10, 205 | "Text" : "[1;5B" 206 | }, 207 | "0xf70d-0x20000" : { 208 | "Action" : 10, 209 | "Text" : "[21;2~" 210 | }, 211 | "0xf702-0x260000" : { 212 | "Action" : 10, 213 | "Text" : "[1;6D" 214 | }, 215 | "0xf729-0x40000" : { 216 | "Action" : 10, 217 | "Text" : "[1;5H" 218 | }, 219 | "0xf706-0x20000" : { 220 | "Action" : 10, 221 | "Text" : "[1;2R" 222 | }, 223 | "0x34-0x40000" : { 224 | "Action" : 11, 225 | "Text" : "0x1c" 226 | }, 227 | "0xf700-0x280000" : { 228 | "Action" : 11, 229 | "Text" : "0x1b 0x1b 0x5b 0x41" 230 | }, 231 | "0x2d-0x40000" : { 232 | "Action" : 11, 233 | "Text" : "0x1f" 234 | }, 235 | "0xf70e-0x20000" : { 236 | "Action" : 10, 237 | "Text" : "[23;2~" 238 | }, 239 | "0xf702-0x220000" : { 240 | "Action" : 10, 241 | "Text" : "[1;2D" 242 | }, 243 | "0xf703-0x280000" : { 244 | "Action" : 11, 245 | "Text" : "0x1b 0x1b 0x5b 0x43" 246 | }, 247 | "0xf700-0x240000" : { 248 | "Action" : 10, 249 | "Text" : "[1;5A" 250 | }, 251 | "0xf707-0x20000" : { 252 | "Action" : 10, 253 | "Text" : "[1;2S" 254 | }, 255 | "0xf70a-0x20000" : { 256 | "Action" : 10, 257 | "Text" : "[18;2~" 258 | }, 259 | "0x35-0x40000" : { 260 | "Action" : 11, 261 | "Text" : "0x1d" 262 | }, 263 | "0xf70f-0x20000" : { 264 | "Action" : 10, 265 | "Text" : "[24;2~" 266 | }, 267 | "0xf703-0x240000" : { 268 | "Action" : 10, 269 | "Text" : "[1;5C" 270 | }, 271 | "0xf701-0x260000" : { 272 | "Action" : 10, 273 | "Text" : "[1;6B" 274 | }, 275 | "0xf702-0x280000" : { 276 | "Action" : 11, 277 | "Text" : "0x1b 0x1b 0x5b 0x44" 278 | }, 279 | "0xf72b-0x20000" : { 280 | "Action" : 10, 281 | "Text" : "[1;2F" 282 | }, 283 | "0x36-0x40000" : { 284 | "Action" : 11, 285 | "Text" : "0x1e" 286 | }, 287 | "0xf708-0x20000" : { 288 | "Action" : 10, 289 | "Text" : "[15;2~" 290 | }, 291 | "0xf701-0x220000" : { 292 | "Action" : 10, 293 | "Text" : "[1;2B" 294 | }, 295 | "0xf70b-0x20000" : { 296 | "Action" : 10, 297 | "Text" : "[19;2~" 298 | }, 299 | "0xf702-0x240000" : { 300 | "Action" : 10, 301 | "Text" : "[1;5D" 302 | }, 303 | "0xf704-0x20000" : { 304 | "Action" : 10, 305 | "Text" : "[1;2P" 306 | } 307 | }, 308 | "Window Type" : 0, 309 | "Background Image Location" : "", 310 | "Blur" : false, 311 | "Badge Color" : { 312 | "Red Component" : 0.7928692102432251, 313 | "Color Space" : "Calibrated", 314 | "Blue Component" : 0.056549370288848877, 315 | "Alpha Component" : 0.5, 316 | "Green Component" : 0.28100395202636719 317 | }, 318 | "Scrollback Lines" : 1000, 319 | "Send Code When Idle" : false, 320 | "Close Sessions On End" : true, 321 | "Terminal Type" : "xterm-256color", 322 | "Visual Bell" : true, 323 | "Flashing Bell" : false, 324 | "Silence Bell" : false, 325 | "Ansi 14 Color" : { 326 | "Red Component" : 0.49072420597076416, 327 | "Color Space" : "Calibrated", 328 | "Blue Component" : 0.41142863035202026, 329 | "Alpha Component" : 1, 330 | "Green Component" : 0.71257460117340088 331 | }, 332 | "Name" : "Default", 333 | "Cursor Text Color" : { 334 | "Red Component" : 0.11759927868843079, 335 | "Color Space" : "Calibrated", 336 | "Blue Component" : 0.11759774386882782, 337 | "Alpha Component" : 1, 338 | "Green Component" : 0.11759573966264725 339 | }, 340 | "Shortcut" : "", 341 | "Cursor Color" : { 342 | "Red Component" : 0.90061241388320923, 343 | "Color Space" : "Calibrated", 344 | "Blue Component" : 0.63873869180679321, 345 | "Alpha Component" : 1, 346 | "Green Component" : 0.82989895343780518 347 | }, 348 | "Transparency" : 0.022896177030456724, 349 | "Ansi 0 Color" : { 350 | "Red Component" : 0.11759927868843079, 351 | "Color Space" : "Calibrated", 352 | "Blue Component" : 0.11759774386882782, 353 | "Alpha Component" : 1, 354 | "Green Component" : 0.11759573966264725 355 | }, 356 | "Ansi 1 Color" : { 357 | "Red Component" : 0.74529051780700684, 358 | "Color Space" : "Calibrated", 359 | "Blue Component" : 0.090684391558170319, 360 | "Alpha Component" : 1, 361 | "Green Component" : 0.05879192054271698 362 | }, 363 | "Horizontal Spacing" : 1.0819147684487951, 364 | "Ansi 3 Color" : { 365 | "Red Component" : 0.80126690864562988, 366 | "Color Space" : "Calibrated", 367 | "Blue Component" : 0.10328958928585052, 368 | "Alpha Component" : 1, 369 | "Green Component" : 0.53254079818725586 370 | }, 371 | "Right Option Key Sends" : 0, 372 | "Ansi 6 Color" : { 373 | "Red Component" : 0.34054014086723328, 374 | "Color Space" : "Calibrated", 375 | "Blue Component" : 0.34128850698471069, 376 | "Alpha Component" : 1, 377 | "Green Component" : 0.55607825517654419 378 | }, 379 | "Ansi 4 Color" : { 380 | "Red Component" : 0.21694663166999817, 381 | "Color Space" : "Calibrated", 382 | "Blue Component" : 0.4586675763130188, 383 | "Alpha Component" : 1, 384 | "Green Component" : 0.45008346438407898 385 | }, 386 | "Normal Font" : "Menlo-Regular 12", 387 | "Ansi 5 Color" : { 388 | "Red Component" : 0.62685638666152954, 389 | "Color Space" : "Calibrated", 390 | "Blue Component" : 0.45103743672370911, 391 | "Alpha Component" : 1, 392 | "Green Component" : 0.29604318737983704 393 | }, 394 | "Use Non-ASCII Font" : false, 395 | "Ansi 2 Color" : { 396 | "Red Component" : 0.52591603994369507, 397 | "Color Space" : "Calibrated", 398 | "Blue Component" : 0.082894742488861084, 399 | "Alpha Component" : 1, 400 | "Green Component" : 0.53061914443969727 401 | } 402 | } 403 | --------------------------------------------------------------------------------