Additional command to make a variety of my daily tasks easier.
The following readme is mainly automatically generated from the help menu of each command.
Use sudo make target1 target2 ... to install all the commands. "target" here are the title of the sections in "Commands".
If you want to install all the target you can run sudo make all, if you run sudo make, only the base target will be installed.
sudo make update will only update already installed package.
Used to update this package.
Usage: "sudo cmdsup"
-h helpinstalls all commands as exectuables to /bin/ and removes the extension.
Usage: "sudo install-cmd cmd1.sh cmd2.py ..."
-h helpStage commits so that not too many files are added at once.
It is usefull for "git-remote-gcrypt" so that the encrypted commit doesn't exceed the max commit size.
Usage: "git-stage-commit"
-h help
-v verbose
-s max added file size [Mb], default is 25Mb (half of Github recommandation of 50Mb).
If negative, will fallback to gitup.
-m commit name, default is 'update'
-b set branch name, default is whatever beanch you are on
-p push only at the end (default behaviour is to push at each commit)Code by Matt Farmer [https://gist.github.com/m14tode] found at [https://gist.github.com/m14t/3056747]
WARNING: Only tested with Github
This command will set the git origin from https to ssh.
Usage: "git-https-to-shh":
-h helpList all submodules in the current repo.
Usage: "git-list-submodules"
-h help
-r recursivly list submodules (thus list submodules of submodules)
-p print path
-u print urlClones recursively all submodules.
Usage: "gitdown ..."
-h helpGive choise to user of GPG key, and return (print to stdout) properly formated public key. Is usefull for other commands.
Usage: "choose-gpg-key"
-h help
-k key name to first try without user input
-n number of try (default is 3)
-y continue for the first try if a key is found.
ATTENTION: is pretty unsafe because you may have found the wrong key.List untracked files
Usage: "git-list-untracked"
-h help
-r recursive (relative to submodules)Used to give a small git cheat-sheet.
Usage: "gitcheat -v/t"
-h help
-v visual cheat-sheet about branches
-t textual cheat-sheetGets the go version of a directory used as a go package.
Usage: "gogit"
-h helpEquivalent to "git add . ; git commit -am 'update' ; git push -f origin 'branch'"
If "stagecommit.maxfilesize" is set in git config, will fallback to
"git-stage-commit" to respect this set limit.
Usage: "gitup"
-h help
-v verbose
-m commit name, default is 'update'
-b set branch name, default is whatever beanch you are on
-A remove the '-a' flag (don't add un-added files)WARNING: Only tested with Github
Delete all comit history from the main branch of a repo.
Usage: "gcrypt-set-repo"
-h help
-u this flag to change remote url
-k this flag to set gpg key
-v this flag to set git environment variables
-p this flag to pull after the changes (if you pulled the directory as a normal, unencrypted directory)
-b sets the branch for the "git pull" called by the flag "-p" (default: "main") Redownload all submodules from scratch (WARNING : will loose untracked files)
WARNING: Is very likely to lead to loss of untracked files, please backup before use.
Usage: "git-redownload-submodules"
-h help
-r redownload recursively
-Y redownload all submodules without asking, !! DANGEROUS !!WARNING: Some part may only works with Github (for now) !
Delete all comit history from the main branch of a repo.
Usage: "git-delete-history"
-h help
-v verbose
-m commit name, default is 'first_commit'
-b set branch name, default is whatever beanch you are on
-S hard delete (only for repository set up with "git-remote-gcrypt")
-H use https (default is ssh) for cloning for hard delete (-S)
-s (for "git-stage-commit") max added file size [Mb], default is -1 (not limit).
If negative, will fallback to gitup.
-p (for "git-stage-commit") push only at the end (default behaviour is to push at each commit)Copy untracked files from one repo (the "source" repo) to another similar repo (which you should be at the root of). This can be used to restore backup after clowning a repo.
Usage: "git-sync-untracked"
-h help
-s [mandatory] source repository
-r recursive (relative to submodules)
-y copy without asking for confirmationUsed to fix a "git detached HEAD" error without loosing changes.
Usage: "git-fix-detached-head"
-h help
-b set branch name, default is whatever beanch you are onUsed to switch (and manage) between multiple saved git account.
Usage: "git-switch-account"
-h help
-n acount number (default 0 = globaly set account)
-s set account (will not change the local git account)
-d delete the acountConverts all raw images to jpg.
Usage: "convert-all-raw"
-h help
-r recursiveCompress all jpg images here.
Usage: "compress-all-jpg"
-h help
-r recursiveAutomatically blurs faces in all image files here.
Usage: "compress-all-jpg"
-h helpAutomatically unlocks and clears a swissbit archive sd card.
Usage: "iAT-clear-all -m /dev/sdxx"
-h help
-m (required): device mount point (like /dev/sdxx)Automatically unlocks and copies all of the data of a swissbit archive sd card to a single forlder.
Usage: "iAT-download-merge-all -m /dev/sdxx -o ~/Download/sync"
-h help
-m (required): device mount point (like /dev/sdxx)
-o (required): output folder for merged dataConverts all raw videos to mp4.
Usage: "convert-all-raw"
-h help
-r recursiveSets the scaling for "3dfile-scale".
Usage: "sudo 3dfile-scale-setparam axis (char, 'X', 'Y' or 'Z'), scaling_factor (float), base_height (float), offset (float)"
-h helpScales a Gcode file. use "param" to set the scaling.
Usage: "3dfile-scale-setparam file1 file2 ..."
-h helpInstalls all .deb or .AppImage the commands find.
Usage: "sudo initall directory1 directory2 ..."
-h helpReformats all file names to avoid uppercase, special character, and replaces any length of spaces to a single underscore.
Usage: "reformat-files-nerd"
-h helpCan convert .ipynb, .html, .md, and a lot of file type to some other file types.
Usage: "pandoc-convert -p -o file1 file2 ..."
-h help
-p convert to .pdf
-o convert to .odt
-d convert to .docx
-H convert to .html
-i convert to .ipynb
-t convert to .txt
-l convert to .tex
-O any other typeCompresses all pdfs.
Usage: "compress-all-pdfs"
-h help
-r recursiveDeletes a samba share.
Usage: "sudo smbdel share_name1 share_name2 ..."
-h helpUsed to add a samba share.
Usage: "sudo smbadd -n share_name -f share_path -u share_allowed_user"
-h help
-n share name (mendatory)
-f share path (mendatory)
-u allowed user (if not specified will be joseph)Adds a spindown timer to a hard drive.
Usage: "sudo spindown -d drive_device_name -t time"
-h help
-t spin down time (default is 25, see hdparm for more info)
-d drive name (default is "sda")MIT License
Copyright (c) 2020 joseph touzet
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.