Linux tips and tricks for web-dev
Linux tips and tricks for web-dev's
- show file/folders rights in drxr & 777 formats:
stat -c '%A %a %n' /<your_folder>/ - monitor changing file:
tail -f -n 10 var/log/dev.log - download big file with cURL:
curl --location 'https://<your_url>' \ --header 'Authorization: Token <token>' -o file.name - curl response with the following redirects:
curl -iL --max-redirs 1 http://example.com - monitor folder recursively for changes:
inotifywait -m -e create,delete -r /<your_folder>
and invoking it by running the command glowh
Adding ssh key
https://dev.to/emmanuelnk/using-sudo-without-password-prompt-as-non-root-docker-user-52bg
auto adding the key - keychain 2.8.5 ~ http://www.funtoo.org
sudo apt-get install keychain
add this bottom line to .bashrc
eval `keychain --eval --agents ssh id_rsa`
if you need more keys to be added to the agent use this in your .profile or .bashrc
eval `keychain --agents ssh --eval id_rsa1 folder/id_rsa2`
ssh-agent -k
keychain --agents ssh ~/.ssh/id_rsa
access rights for the key and keys folder:
ssh directory permissions should be 700 (drwx- - - - - -).
The public key (. pub file) should be 644 (-rw-r--r- -).
The private key (id_rsa) on the client host, and the authorized_keys file on the server, should be 600 (-rw- - - - - - -).
How to create a user without a password:
adduser --disabled-password --shell /bin/bash --gecos "User" $username
You'll be able to:
su $username
The --disabled-password option will not set a password, meaning no password is legal, but login is still possible (for example with SSH RSA keys).
To create a user without a password, use passwd -d $username after the user is created to make the password empty. Note not all systems allow users with empty password to log in.
Comments