Tips & Tricks to help my fish memory and not to google the same stuff over and over again.
watch ss -antlp
grep -iR 'search' | xargs sed -i 's/search/replace/g'
$ git commit -m "Something terribly misguided" # (0: Your Accident)
$ git reset HEAD~ # (1)
<< edit files as necessary >> # (2)
$ git add . # (3)
$ git commit -c ORIG_HEAD # (4)
git checkout master
git merge dev
git push origin master
git push origin master:newBranch
git checkout <branch_name> -- <paths>
To get package.json from dev branch to current branch:
git checkout dev -- package.json
git stash
git checkout other-branch
git stash pop
The first stash hides away your changes (basically making a temporary commit), and the subsequent stash pop re-applies them.
git stash
git checkout -b new-branch
git stash pop
git filter-branch -f --tree-filter "rm -rf FOLDERNAME" --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo FOLDERNAME/ >> .gitignore
git add .gitignore
git commit -m "Removing FOLDERNAME from git history"
git gc
git push origin master --force
git config --global user.signingkey <YOUR_SIGNING_KEY>
git config --global commit.gpgsign true
git config --global gpg.program gpg
gpg --list-secret-keys --keyid-format LONG
gpg --armor --export 189ABH19KLDU83
sshfs -p 22 -C -o follow_symlinks,auto_cache,reconnect ~/MOUNT_FOLDER USERNAME@SERVERIP:/home/USERNAME
Install seahorse
sudo pacman -S seahorse
/usr/lib/seahorse/ssh-askpass ~/.ssh/id_rsa
user=test
useradd -m -d /home/$user -s /bin/bash $user
ssh-keygen -b 2048 -t rsa -f ./$user'_sshkey' -q -N ""
mv $user'_sshkey' $user'_sshkey'.private
mkdir -p /home/$user/.ssh
cat $user'_sshkey'.pub > /home/$user/.ssh/authorized_keys
chown -R $user:$user /home/$user/.ssh
chmod 600 /home/$user/.ssh/authorized_keys
chmod 700 /home/$user/.ssh
cat $user'_sshkey'.private
xhost +si:localuser:root
docker run --rm -it --net=host \
--privileged \
-e DISPLAY \
--device /dev/dri \
--device /dev/snd \
--device /dev/video0 \
--device /dev/input \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /etc/localtime:/etc/localtime:ro \
-v $(pwd):/app \
ubuntu /bin/bash
dd bs=4M if=path/to/distro.iso of=/dev/sdX status=progress oflag=sync
docker run --rm -ti --runtime=nvidia nvidia/cuda nvidia-smi
docker run -it --rm --runtime=nvidia --shm-size=1g -e NVIDIA_VISIBLE_DEVICES=0,1 nvcr.io/nvidia/pytorch
docker run \
--runtime=nvidia \
--rm \
-ti \
-v "${PWD}:/app" \
gcr.io/tensorflow/tensorflow:latest-gpu \
python /app/benchmark.py cpu 10000
xhost +si:localuser:root
docker run --runtime=nvidia -ti --rm -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix nvcr.io/nvidia/pytorch
docker build --network=host -t spot .
npm install -g heroku
heroku login
heroku container:login
heroku create
heroku container:push spot
heroku container:release spot
heroku open
#docker tag registry.heroku.com//
docker tag nlesc/spot registry.heroku.com/nlesc-spot/dev
#docker push registry.heroku.com//
docker push registry.heroku.com/nlesc-spot/dev
python3 -m http.server --directory ./ 8080
yay -S pyenv
pyenv install --list
pyenv install 3.7.2
pyenv global 3.7.2
pip install --upgrade pip
python3 -m venv .venv
. .venv/bin/activate.fish # fish shell
. .venv/bin/activate # bash
pip install --upgrade pip
pip install -U pipenv
cd my_project
pipenv install
https://code.visualstudio.com/docs/python/environments
%reset
%reset_selective variable_name
pip install $(pip list --outdated | awk 'NR>2 { print $1 }') --upgrade
conda create -n nso python=3.7 pandas
conda env export -c conda-forge -n nso --override-channels | grep -v "^prefix: " > environment.yml
conda env list
conda env create -f environment.yml
conda deactivate
conda env remove -n nso
npm i -g npm-check-updates && ncu -u && npm i
xdg-mime default org.gnome.Nautilus.desktop inode/directory
gsettings set org.gnome.desktop.background show-desktop-icons true
gsettings set org.gnome.desktop.background draw-background true
Start xterm with a proper font.
xterm -fa 'Monospace' -fs 15
sudo ufw enable
sudo ufw default deny
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 22
sudo ufw logging on
sudo ufw status
systemctl list-units -t target --all
systemctl get-default
systemctl show -p "Wants" graphical.target
systemctl list-unit-files --state enabled
systemctl list-units --failed
journalctl -u optimus-manager.service