Skip to content

additional command to make using the git cli with github easier. Also help with golang developement

License

Notifications You must be signed in to change notification settings

jolatechno/cli-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cli-utils

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.

Installation

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.

Commands

Base

cmdsup

Used to update this package.


Usage: "sudo cmdsup"
	-h help

install-cmd

installs all commands as exectuables to /bin/ and removes the extension.


Usage: "sudo install-cmd cmd1.sh cmd2.py ..."
	-h help

git

git-stage-commit

Stage 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)

git-https-to-ssh

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 help

git-list-submodules

List 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 url

gitdown

Clones recursively all submodules.


Usage: "gitdown ..."
	-h help

gpg-choose-key

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

git-list-untracked

List untracked files


Usage: "git-list-untracked"
	-h help

	-r recursive (relative to submodules)

gitcheat

Used to give a small git cheat-sheet.


Usage: "gitcheat -v/t"
    -h help

    -v visual cheat-sheet about branches
    -t textual cheat-sheet

gogit

Gets the go version of a directory used as a go package.


Usage: "gogit"
	-h help

gitup

Equivalent 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)

gcrypt-set-repo

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") 

git-redownload-submodules

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 !!

git-delete-history

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)

git-sync-untracked

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 confirmation

git-fix-detached-head

Used 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 on

git-switch-account

Used 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 acount

photo

convert-all-raw

Converts all raw images to jpg.


Usage: "convert-all-raw"
	-h help

	-r recursive

compress-all-jpg

Compress all jpg images here.


Usage: "compress-all-jpg"
	-h help

	-r recursive

deface-auto

Automatically blurs faces in all image files here.


Usage: "compress-all-jpg"
	-h help

iAT-clear-all

Automatically 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)

iAT-download-merge-all

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 data

convert-all-raw-video

Converts all raw videos to mp4.


Usage: "convert-all-raw"
	-h help

	-r recursive

3dPrinting

3dfile-scale-setparam

Sets 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 help

3dfile-scale

Scales a Gcode file. use "param" to set the scaling.


Usage: "3dfile-scale-setparam file1 file2 ..."
    -h help

debian

initall

Installs all .deb or .AppImage the commands find.


Usage: "sudo initall directory1 directory2 ..."
	-h help

desktop

reformat-files-nerd

Reformats all file names to avoid uppercase, special character, and replaces any length of spaces to a single underscore.


Usage: "reformat-files-nerd"
	-h help

pandoc-convert

Can 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 type

compress-all-pdfs

Compresses all pdfs.


Usage: "compress-all-pdfs"
	-h help

	-r recursive

nas

smbdel

Deletes a samba share.


Usage: "sudo smbdel share_name1 share_name2 ..."
	-h help

smbadd

Used 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)

spindown

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")

License

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.

About

additional command to make using the git cli with github easier. Also help with golang developement

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published