/etc/sudoers.d/90-cloudimg-ubuntuIt has the following content. With this, the user ubuntu can run sudo without a password.
# User rules for ubuntu ubuntu ALL=(ALL) NOPASSWD:ALL
/etc/sudoers.d/90-cloudimg-ubuntuIt has the following content. With this, the user ubuntu can run sudo without a password.
# User rules for ubuntu ubuntu ALL=(ALL) NOPASSWD:ALL
scp -r shortcut:/remote/server/path/file.tar.gz /target/path/Example:
scp -r shortcut:/home/user/file.tar.gz ~/download
ps -p 1 -o comm=
You will either see init (SysVinit) or systemd.
| Systemd command | SysVinit command |
|---|---|
| systemctl start service_name | service service_name start |
| systemctl stop service_name | service service_name stop |
| systemctl restart service_name | service service_name restart |
| systemctl status service_name | service service_name status |
| systemctl enable service_name | chkconfig service_name on |
| systemctl disable service_name | chkconfig service_name off |
git config --listSet global name and email.
git config --list --local
git config --list --global
git config --list --system
git config --global user.name "Your Name"Check what's going on
git config --global user.email "youremail@yourdomain.com"
git statusCheck changes made to a file
git diff path/to/fileStage changes
# Stage allUntage changes
git add .
# Stage one file
git add path/to/file
# Stage allRevert changes made to path/to/file
git reset
# Stage one file
git reset path/to/file
git checkout path/to/fileRevert all uncommited changes
git checkout .Commit staged files
git commit -m "Put a message here."Check commits that had not been pushed.
git log origin/main..mainCheck history of path/to/file
git log -p -- path/to/file
find my_directory -type d -exec chmod 755 {} \;Change file permission in my_directory.
find my_directory -type f -exec chmod 644 {} \;
Search and replace in Visual Studio Code.
Search for
^(.*)(\n\1)+$Replace with
$1
Search and replace in Visual Studio Code.
Search for
\{\n.*\$oid.*"(.*)"\n.*\}Replace with
new MongoDB\BSON\ObjectId("$1")Search for
\{\n.*numberDouble.*"(.*)"\n.*\}Replace with
$1Search for
\{\n.*numberInt.*"(.*)"\n.*\}Replace with
$1