Advanced Search
Search Results
53 total results found
Merge, Rebase, Reset, Clean
merge vs rebase https://www.atlassian.com/git/tutorials/merging-vs-rebasing Make the current Git branch a master branch git checkout better_branch git merge --strategy=ours master # keep the content of this branch, but record a merge git checkout master git...
Basics
Bare basics semantic versioning https://semver.org/ clone git clone <url> clone an arbitrary repository add git add . add all files to stage commit git commit -m "some commit message" commit staged changes with inline commit message checkout -> switch ...
special distro behaviour
Ubuntu Browser graphic issue: https://askubuntu.com/questions/1413703/graphics-issue-with-google-chrome application shortcut in folder /usr/share/applications or ~/.local/share/applications .desktop file example: [Desktop Entry] Name=Visual Studio Code Co...
SSH
ssh public key auth generate key: ssh-keygen copy ssh key to remote: windows: type $env:{userProfile}\.ssh\id_rsa.pub | ssh -p{port} {user@serverAddress} "cat >> .ssh/authorized_keys" linux: ssh-copy-id -i {userHome}/.ssh/id_rsa.pub -p{port} {user@serverA...
Cronjob, tar, autostart, sudo, ln
cronjob execute all listed cronjobs: crontab -l | grep -v '^#' | cut -f 6- -d ' ' | while read CMD; do eval $CMD; done send output to mail address MAILTO="empfänger@adresse.de" https://de.godaddy.com/blog/behalten-sie-ihre-cron-jobs-unter-kontrolle/ ta...
Shell
bash basics default text editor for inline shell call: sudo EDITOR=nano crontab -e add to ~/.bashrc or ~/.zshrc: export EDITOR=nano for default root editor, edit also /root/.bashrc or /root/.zshrc echo "export VISUAL=nano\nexport EDITOR=nano" >> ~/.b...
Network
settings set static ip address sudo nano /etc/network/interfaces: auto ens18 iface ens18 inet static address 192.168.0.2 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 89.207.128.252 89.207.130.252 sudo reboot check local network settin...
Dockerfile
Dockerfile dockerfile manuals: https://takacsmark.com/dockerfile-tutorial-by-example-dockerfile-best-practices-2018/ best practice: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ key instructions FROM - base image ENV vari...
Docker-compose CLI
Basics usedocker-compose -p "nginx-proxy-manager" up -d to: -p with custom stack name -d as deamon (in background) -f from specific docker-compose file docker compose file https://docs.docker.com/compose/compose-file/compose-file-v3/ version: '3.1' s...
disk/file management
disk show disk size check disk space: df -h - human readable show folder size show folder size: sudo du -shc ./* find biggest folders of current directory du -hs * | sort -rh | head -5 file movements rsync Links https://wiki.ubuntuusers.de/rsync/ opti...
Database
MariaDB with PHPmyAdmin code snipped for mariadb with phpmyadmin (use only for development) mariadb: image: mariadb:10.6 restart: always environment: MYSQL_ROOT_PASSWORD: YOUR_ROOT_PASSWORD_HERE MYSQL_USER: YOUR_MYSQL_USER_HERE ...
Permissions, Groups
TODO https://www.pluralsight.com/blog/it-ops/linux-file-permissions groups add primary group (restart is necessary): sudo usermod -g primarygroupname username add group: sudo usermod -a -G secondarygroupname username desc: -g primary group assigned to th...
CLI Editor
nano cli parameters/flags -c, --const - Constantly display the cursor position and line number on the statusbar. Note that this overrides -U. -U, --quickblank - Do quick statusbar blanking. Statusbar messages will disappear after 1 keystroke instead of 25. ...
find, search, grep
find use cases: find ./subfolder -name sample.txt - Search a file with specific name find ./subfolder -name *.txt - Search a file with pattern find ./GFG -name sample.txt -exec rm -i {} \; - find and delete a file with confirmation find ./subfolder -empty - S...
Hooks
git hooks pre-commit-msg This example adds the branch name as prefix to the commit message: create the file ~/.githooks/prepare-commit-msg #!/bin/sh # # Automatically adds branch name every commit message. # NAME=$(git branch | grep '*' | sed 's/* //' | cut -...
GUI / visualize
CLI ui show logs in a graph git log --oneline --graph --color --all --decorate for linux use alias gg="git log --oneline --graph --color --all --decorate" in ~/.bashrc lazygit lazygit on Github GUI
Games
minecraft java edition version: "3.8" services: mc: image: itzg/minecraft-server tty: true stdin_open: true ports: - "25565:25565" environment: EULA: "TRUE" MEMORY: 1G SERVER_NAME: "DRaab Minecraft Server" vol...
user management
create user useradd john set password passwd john create user with root privilages: useradd -ou 0 -g 0 john check if id are set correctly: $ grep john /etc/passwd john:x:0:0::/home/john:/bin/sh add user to root group usermod -a -G root john delete...