Skip to content

chasup/one-liners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Useful one (ish) liner commands

SSH

Port forwarding, local to remote

ssh -L <local-port>:<target-host>:<remote-port> hostname

e.g. connect local port 8080 to a locally listening port 8001 on myhost.com

ssh -L 8080:localhost:8001 myhost.com

python

Instant webserver

python -m http.server

pip - list / upgrade out of date packages

pip list --outdated

and to upgrade:

pip list --outdated --format=freeze | cut -d= -f1 | xargs -n1 pip install -U

git

Set the latest commit time to now

Useful following squashing / amending commits

git commit --amend --no-edit --date "$(date)"

Add execute permissions to scripts / binaries

git update-index --chmod=+x foo.sh

Remove local branches which have been merged remotely

git branch --merged | grep -v main | xargs git branch -d

github.com

Get public SSH keys associated with an account:

curl https://github.com/<user>.keys

can be used to populate an authorized_keys file, e.g.

curl https://github.com/chasup.keys >> ~/.ssh/authorized_keys

About

Useful one (ish) liner commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published