A.K.A. Commands I keep forgetting no matter how many milions time I type them
usermod -aG sudo $USER
add user to sudoersexec su -l $USER
Reload a Linux user’s group assignments without logging outscript
record (and play) shell sessionxclip -sel clip < TEXTFILE
copy file to default clipboardhdparm -S 240 /dev/sda
hdd spindown time/sys/class/backlight/intel_backlight/brightness
or/sys/devices/platform/thinkpad_acpi/leds/tpacpi\:\:power/brightness
thinkpad backlight PWM endpointrsync -avzP [email protected]:$SOURCE [email protected]:$DEST
curl -d '{"MyKey":"My Value"}' -H "Content-Type: application/json" $ENDPOINT:$PORT/
curl JSONcurl -d @payload.json -H "Content-Type: application/json" $ENDPOINT:$PORT/
curl JSON filenmcli dev wifi con "$SSID" password "$PASSPHRASE"
ssh -L $REMOTEPORT:localhost:$LOCALPORT [email protected]$REMOTEHOST
SSH loopback a.k.a. $REMOTEHOST:$REMOTEPORT is available at localhost:$LOCALPORT ssh tunneled/encryptedGRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'kaf500!';
MySQL, init wp tableshostnamectl
visudo
and append$USER ALL=(ALL) NOPASSWD: ALL
ffmpeg -i input.mp4 output.mp4 -vcodec libx264 -crf 20
(where CFR accepts value from the 0-51 range: 0 is lossless, 23 is default, and 51 is worst possible. A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so)
apt
apt list -a <packagename>
apt install <packagename>=<packageversion>
fontconfig
fc-cache -fv
refresh cachefc-match serif
,fc-match sans-serif
,fc-match monospace
check default font families
SSH
ssh-copy-id -i $PUBLICKEY [email protected]$HOST
ssh -t [email protected] ssh [email protected] -p 4000
ssh trough ssh tunnelssh -At [email protected] ssh [email protected] -p 4000
same but forwarding the Authentication
GPG
Use ECC
+ ECC
(ed25519
) with Curve 25519
(cv25519
) as elliptic curve.
gpg --list-keys
list keys with key-idsgpg --list-keys --with-fingerprint
list keys in keyring with fingerprints/subkeysgpg --list-kets --format LONG
also show subkeys IDgpg --full-generate-key
key generation wizardgpg --full-generate-key --expert
enable more encryption algorithmsgpg --import $FILE
import key (both public/public parts)gpg --edit-key $FINGERPRINT
,gpg> trust
trustgpg --armor --export $KEYID
ASCII encoded exportgpg --export-secret-keys -a $KEYID
gpg --keyserver http://keys.gnupg.net:11371/ --send-key $KEYID
, submit to keyserverwget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
download and add key as trusted pipe
git
git log -10 --format="%cd %s"
git log -1 --format=%cd
git remote set-url --add origin ORIGIN
origin push to more than one git repository server at a time- After having merged a branch, to continue working on that branch, syncing with master:
# Checkout the default branch (master or develop) git checkout master git pull # Delete the local branch git branch -D nomeBranch # Delete remotely git push origin --delete nomeBranch # Recreate it locally git branch -m 'nomeBranch' # During the first push, specify the branch to remotely track git push --set-upstream origin nomeBranch # Pushing to a remote branch with a different Name git push origin local-name:remote-name # Amend and sign a commit (DCO) git commit --amend --signoff git push --force-with-lease
configuration
Adding --global
applies these settings as default/system wide and not only in current repo.
git config user.email $EMAIL
git config user.name $NAME
git config gpg.program gpg
set gpg executablegit config commit.gpgsign true
enable gpg-signing commitsgit config user.signingkey $FULLFINGERPRINT
set default gpg key to use when signing commits
Common Locations
~/.local/share/applications
user-relative launchers/usr/share/applications
or/usr/local/share/applications
global launchers~/.local/share/user-places.xbel
dolphin bookmarks