- You can configure nano settings with .nanorc file
- Add alias commands to .bash_aliases
- Make some ALIAS. ls --color=auto for ls
- Alias O for ls -latr listing all files in order, newest at bottom.
- SCP files with scp filename username@host:/Where in remote
- ssh-keygen -t RSA -b 4096 Generates ssh keys
- ssh-add starts ssh-agent until computer is shutdown.
- Adding id_rsa.pub file content to authorized_keys in server allows ssh without typing password
- in ~/.ssh create config file without file extension and set ssh configs. Like:
Host NAME
HostName nikiahlskog.com
User USERNAME
Identityfile ~/.ssh/id_rsa.pub
Then you can just use ssh name for example. - RSYNC. It copies only changed files. Very handy! use it like: rsync --progress filename user@server:dir handle -a copies folder content
- Crontab. Using crontab -e is dangerous. Because crontab -r empties whole table and there is no undo. Create folder for cronjobs and create file for example cron.tab add your job to the file for example: 0,30 * * * * echo `date +%Y-%m-%H\ %k:%M:%S` cron job done then add this file to crontab with crontab ~/cronjobs/cron.tab see all your cron jobs with crontab -l to remove cronjobs juse handle -e
This page is a random collection of notes addressed to myself. Nothing here is intended as a guide per say, however i have posted them hoping that it may help someone. Blog about Linux and unix related stuff. Everything in this blog can be copied or edited GNU General Public License (version 2 or newer) http://www.gnu.org/licenses/gpl.html
tiistai 20. syyskuuta 2016
Learning Linux at University
I had to learn more about Linux at the university and so far I have learned couple of handy things.
tiistai 5. huhtikuuta 2016
Mount shared folder on Virtualbox. Windows host, linux guest.
To mount / share a folder between host and guest OS first create a folder in windows which you want to share.
For example: C:\myshare
Then assign it from the virtualbox settings-->shared folders-->+ icon: set folder path, tick Auto-Mount
Then boot up your guest os. Create a folder where you want to point the host os folder, for example /~share/. Then launch terminal and type:
sudo mount -t vboxsf myshare ~/share/
For example: C:\myshare
Then assign it from the virtualbox settings-->shared folders-->+ icon: set folder path, tick Auto-Mount
Then boot up your guest os. Create a folder where you want to point the host os folder, for example /~share/. Then launch terminal and type:
sudo mount -t vboxsf myshare ~/share/
Then you should see items inside that folder.
torstai 21. tammikuuta 2016
OpenVpn save Username and Password to a file.
So I have created ShellScript which opens VPN connection but everytime it asks my password and I wanted to automate this. So do the following:
Inside your vpn key folder should be file called config.opvn or something that ends with .ovpn. Open it up and look for auth-user-pass if your file doesn't contain this add it to the bottom. Right after it add one space and filename.txt like this:
auth-user-pass vpnpass.txt
Then inside the same folder where your .ovpn file is add new file called vpnpass.txt and insert your username and password separated with enter. Like this:
myusername
mypassword
Save both files and now your VPN shouldn't ask password or username.
Inside your vpn key folder should be file called config.opvn or something that ends with .ovpn. Open it up and look for auth-user-pass if your file doesn't contain this add it to the bottom. Right after it add one space and filename.txt like this:
auth-user-pass vpnpass.txt
Then inside the same folder where your .ovpn file is add new file called vpnpass.txt and insert your username and password separated with enter. Like this:
myusername
mypassword
Save both files and now your VPN shouldn't ask password or username.
Tilaa:
Blogitekstit (Atom)