Αναρτήσεις

Προβολή αναρτήσεων από Μάιος, 2012

Create, configure and run a bash script

Scripting NOTE : The commands given in the scripting section are to be put into the text editor and not in the terminal unless instructed otherwise. Bash is primarily a scripting language, so it would be a crime not to talk about scripting.  Let's dive straight in with a bash script. More precisely the infamous "Hello World" script.  You can create a bash script by opening your favorite  text editor  to edit your script and then saving it (typically the .sh file extension is used for your reference, but is not necessary. In our examples, we will be using the .sh extension). #!/bin/bash echo "Hello, World" The first line of the script just defines which interpreter to use. NOTE: There is no leading whitespace before #!/bin/bash.  That's it, simple as that. To run a bash script you first have to have the correct file permissions. We do this with  chmod  command in terminal (change mode) as follows: chmod a+x /where/i/saved/it/hello_world.sh #...

Deal with different GNU/Linux file types

In this article you will find how to compress/uncompress, install/unistall different linux file types. See the list below! deb tar tar.gz tar.gz2 tar.bz tar.bz2 rar zip iso Have in mind that if you cant use a command you probably need to install it first. To install a command use: sudo apt-get install <command> deb files Install: sudo dkpg -i <file>.deb Unistall: sudo dkpg -r <file>.deb tar, tar.bz, tar.bz2, tar.gz, tar.gz2 files Compress: tar jcvf <file.tar.bz2> <file1> <file2> etc Uncompress: tar zxvf <file>.tar.bz2 rar files Compress: unrar x <αρχείο>.rar  <file1> <file2> etc Uncompress: unrar <αρχείο>.rar (may need to install unrar: sudo apt-get install unrar ) zip files Compress:  unzip -r <file.zip> <file1> <file2> etc Uncompress:  unzip <file.zip> (may need to install unzip:  sudo apt-get install unzip ) iso files How to make a CD  εδώ How to mount  εδ...

Create connection to host without password need

Well, the first step is to create a RSA key. This can be done by executing: ssh-keygen -t rsa The second step is to tranfer this key to host so it can authenticate out connection. You shall transfer only the .pub file into ~/.ssh/authorizedkeys folder by executing: scp ~/.ssh/myrsakey.pub <username>@<hostname>:~/.ssh/authorized_keys Now, you must be able to ssh the host without using your password: ssh <user>@<hostname> Commend below if you find this article usefull! Want to read more: How to create and execute a   script  file