This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // remove last commit from Github HEAD^^ also works | |
| git push -f origin HEAD^:master | |
| // remove last commit locally, keep files intact | |
| git reset HEAD^ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ENV NPM_CONFIG_PREFIX=/home/node/.npm-global | |
| # optionally if you want to run npm global bin without specifying path | |
| ENV PATH=$PATH:/home/node/.npm-global/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #doppler | |
| mkdir -p $HOME/bin | |
| curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh | sh -s -- --install-path $HOME/bin | |
| doppler update | |
| #rust | |
| curl https://sh.rustup.rs -sSf | sh | |
| #install pyenv | |
| git clone https://github.com/pyenv-win/pyenv-win.git "$HOME/.pyenv" | |
| pyenv update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #undo last push | |
| git push -f origin HEAD^:master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rfkill list all | |
| sudo rfkill unblock wifi | |
| sudo ifconfig wlan0 up | |
| sudo iwlist wlan0 scan | |
| etc.. | |
| https://www.linuxbabe.com/command-line/ubuntu-server-16-04-wifi-wpa-supplicant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In general, if we want to distribute k crosses among n categories, the number of possible distributions can be found using the formula: | |
| n + k - 1 choose k | |
| which is equivalent to: | |
| (n+k-1)! / (k! * (n-1)!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #connect to container shell | |
| docker exec -it <mycontainer> bash | |
| #running image | |
| docker run -dp 3000:3000 <myimage> | |
| #list all containers, running or stopped | |
| docker ps -a | |
| #remove all containers | |
| sudo docker stop $(sudo docker ps -a -q) && sudo docker rm $(sudo docker ps -a -q) | |
| # docker compose forcinh to rebuild image | |
| sudo docker-compose -f docker-compose.yml up --build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encrypt decrypt combo | |
| echo "sekret123" | gpg --encrypt -r ID --armor | base64 --wrap 0 | base64 -d | gpg --decrypt | |
| # export pub key | |
| gpg --export --armor ID > mypublickey.asc | |
| # gen key | |
| gpg --generate-key | |
| # delete | |
| gpg --delete-secret-key "User Name" | |
| gpg --delete-key "User Name" | |
| #list keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://unix.stackexchange.com/questions/643126/setting-enivorment-variables-permanently-with-a-s | |
| #help . | |
| . /path/to/setup-env.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe" | |
| #You can revert it by running: | |
| npm config delete script-shell |
NewerOlder