Thursday, 27 August 2015

Lock any application in Linux

Some times we need to lock some applications for security purposes. In this article we will learn how to lock any application in Linux (It is support for both Debian and Redhat based systems)

Our Objective

     We are using .desktop file to lock any application in Linux. All applications has it's own .desktop file. Commonly, .desktop file is used to define various performance of application, when it run in X based system (Commonly GUI). We can modify application's performance via it's .desktop file. .desktop file is also called as configuration file for an application.

Where .desktop file is located?

  All apllications .desktop file is located in /usr/share/applications directory.

 What we need?

  1. Terminal
  2. Any text editor

How to do?

  • Open your terminal window, then go to /usr/share/applications directory.
     cd /usr/share/applications  
    
  •   I have following applications .desktop files. You can view it by typing ls command

/usr/share/applications









  • For an example, i want to lock firefox applications. So that the application will can ask password (root passord), whenever it launced.
  •  Open firefox.desktop file via any text editor. Where now am using nano text editor
     sudo nano /usr/share/applicatios/firefox.desktop  
       Find Exec=firefox and change it in to Exec=gksudo -k -u root firefox %u. Now save and exit. 
      Now launch firefox, it will ask password to run the application. 

    Thursday, 6 August 2015

    Understanding man pages


    Man pages are stands for manual pages. In Linux, all types of tools have it's own manual page. Manual pages are commonly contains informations and instructions about a command. man pages are very useful for learning commands in Linux.
    Even if we forget the commands, that time also man pages are helpful to remember. To get detailed information about man pages in Linux, then type following commands

    To know respective commands with our needs, then type following command in terminal 
     man -k keyword  
    

    For an example  
     man -k time  
    

    where, -k stands for keyword. the above command lists many commands with numbers. This number is refer to section of man pages command. Each section of man describes different kind of commands. You can get an over view of man pages by typing following command
     man man-pages  
    

    It gives look like following result


    In section 1 commands are described for ordinary users.
    In section 5 documents are document configuration files.
    In section 8 describes management commands.
    When we are using man pages, grep is an very useful utility. grep is the most important command in Linux. It is a filtering utility whcih is allows to search resolves of a command in a specific time. You can also use to find a text in text files. Let we use grep in man pages 
     man -k time | grep 1  
    
     If a commands separates by pipe means the output of the first command is goes to the input of the second command.
    The above command is gives following result
     
    Now we can easily identify the command 'date' to know date of the system.
    So now let as see the man page of date command 
     man date  
    

    For this command we will get following result

     
    The synopsis is very clearly shows how to use the date command.

    Let we see some useful options
    Look at -s which is describes "set time described by STRING". So we need to set the time. Now our dought is what a STRING?
    To get the detail about STRING type /STRING in the same man page. Now you will get look like following information about the STRING 
     
    when we are typing date -s with time. We will get human readable format. Now we are learned how to find a command using man -k.
    There is another way to get information about an command  
     date --help  
    


    Hope you understand!  

    Tuesday, 21 July 2015

    Renaming multiple files in Linux

    Some times we need to rename multiple files. Renaming multiple files takes more time when we are using regular ways. There is a easy way to rename multiple files.

    rename tool is used to rename multiple files. Consider i am having following files


    Now, we need to replace | (pipe) to s character. So that,

    rename syntax is,
    rename 's/\oldname/newname/' *

    (Note: rename syntax is modified by our requirements)
    Now, the pipe can be replaced by s character.


    Thursday, 2 July 2015

    Remote Desktop connection - Ubuntu PC


    In this article, i will show you how to connect a remote Ubuntu PC to your PC. Generally Ubuntu has built in software called "Remmina Remote Desktop" software. 

    Pre requirements

    1. IP address of remote PC

    2. Remote PC might be enabled to allow remote control sharing options

    1. To know the IP address:

       Open terminal by pressing CTRL+ALT+T. then type ifconfig. it will show IP 
     address

    2. Enabling desktop sharing in remote PC

       Open ubuntu dash and search "Desktop sharing" 



    you will get following window. In this window enable both options in the sharing window.



    Procedure

    In your local machine, open dash and search "Remmina remote desktop client" 
    then open the software



    then click on add button as shown in above picture.

    In the protocol section choose VNC - Virtual Network Computing. then in Server section type your remote pc ip address. Choose color depth "High color (16 bit) or High color (32 bit) inorder to get best performance. Choose Quality to Good then finally click connect button. Now you will get the remote pc to control.

    Thanks for reading the article if you have any doughtor detecting problems then feel free to share your comments below.

    Tuesday, 23 June 2015

    Introduction to Server operating systems

     Generally there are two types of operating systems are available. They are
    server OS and Client OS. server OS in the sense it is the capable of creating and maintaining more than 10000 users. All servers are computer on-in network that provides services to other computers on the network.
    Example: Web server, print server, file server & etc.

       On the other hand, client OS is capable only minimum level (upto 20 users). This is for only Windows operating systems. But in Linux we can use Linux's client OS as a server OS by use of server tools.



       Consider you are running a Linux server (Or Windows server too), you might be follow the below instructions in order to get the best performance.
    Example of server OS: REDHAT 7 server 7, Ubuntu server 14.04.1 & Windows 2012

    Characteristics of Server OS

    1. The server OS is should be non user friendly. Because making an non user friendly operating system as a server OS can be protect from accessing third parties in to the server system
    2. The server OS may not have any multimedia features, sound cards & fancy  web browsers. Because this are all unnecessary for a server OS.
    3. The best choice of server interface is CLI. Mostly GUI is not recommended. GUI takes more CPU, power & memory utilizations. 
    4. Another one important  thing is GUI is makes security holes. To be secured CLI is the best way of maintaining server operating system
    5. Run necessary services only. Disable/stop unwanted services. For example, you are maintaining a web server then only run web related services like httpd, Apache and so on. But practically still unwanted services is there on the server. To disabling unwanted services are increases the speed of performance of a server

     

    Friday, 5 June 2015

    Shell script for startup programs

    We are already discussed about creating startup applications via terminal in previous article.



    All the time adding and configuring is takes more time. To reduce the time, at the place we need shell script.
    To do this, open terminal and create a shell via your favorite text editor.

                   $vim startup.sh
                   echo "Welcome to Autostart program!"
                   echo "Type your configuration file name"
                   read confname
                   echo "Enter your script path"
                   read path
                   echo "Enter your program name"
                   read pgname
                   echo "[Desktop Entry]
                   Type=Application
                   Exec=$path
                   Hidden=false
                   X-GNOME-Autostart-enabled=true
                   Name=$pgname" >> ~/.config/autostart/$confname\.desktop


    Now save and quite by using :wq.

    We need to change it as executable. To do this,

                  $chmod +x startup.sh

    Script is ready for using startup applications.Run the script,

                  $sh startup.sh

    //It will ask questions. just fillup. The shell script can be done.

    Explanation:
             echo = is used to print text
             read = It is used to grab information from users
                  = Grabbed information can be displayed
             \        = It is the escaping character in shell script. It is act as a delimiter when we are using standard symbols instead of a script file.
    If you have any problem while doing this script, kindly post your problems as a comments. Thank you for reading!

    Creating startup scripts via terminal

    Every time believing GUI is not helpful. We can also use GUI tool called "Startup Applications" in Ubuntu. If you run minimal server than GUI tool is not possible to help us.



    Now am going to perform startup scripts via terminal
    Consider i want to run terminal on system startup.
    To do this, open terminal and create a shellscript file by using any text editor. In this i am using Vim. You can use any application or script. Now i am creating startup program for gnome-terminal.

         $vim terminal.sh
         gnome-terminal
         :wq

    Now, create .desktop file in ~/.config/autostart/ directory.

         $vim ~/.config/autostart/terminal.desktop
          [Desktop Entry]
          Type=Application
          Exec=/home/buvanesh/terminal.sh
          Hidden=false
          X-GNOME-Autostart-enabled=true
          Name=terminal
          :wq

    where,
          Exe= Executable file/script path
          Hidden is set to be true if you want to run the script in visible else we can hide it by set to be false.
           X-GNOME-Autostart-enabled=true
           You are running a GUI based script, then it should be set to true else we can set to false
     Now restart the machine, you can able to run script on startup time.

    Monday, 1 June 2015

    How to install Deepin OS


    Deepin is the one of best user friendly distribution in Linux. It is look like Apple’s Mac OS environment. Anyway, Deepin is absolute beginners Linux distribution. Basically, Deepin is based on Ubuntu distribution. 

     
    The Deepin OS consist of all necessary softwares included like, Deepin Music, Deepin Movie etc. So we don’t need to install third parties codecs. It’s a Chinese make operating system
    Pre requirements:
    • Deepin ISO
           To get deepin iso,
           http://cdimage.linuxdeepin.com/releases/2014.3 /deepin_2014.3_i386.iso
    • Minimum 4 GB Pen drive
    • Minimum 8 GB hard disk space:
           To make partition on your hard drive. Read my previous article . 8 GB is      minimum. But anyway 15 GB is recommended.
    • Unetboot software
    You can get this software on the following link, 
    http://unetbootin.sourceforge.net
    make sure you are installed the software.


    Making Pen drive bootable:
    Open Unetboot software, then select disk image
     
    And browse & select the iso. start the process.
    Installation Procedure:
    After completing the process restart the machine and press F12. (It may varies on computer manufacture, F12 is common for Acer. F9 for HP machine)

    Select language

      Then click to install button
     
    in this, type username (username might be lowercase)
    After completing all, then select next button

    Select partition and click install
    That’s all.
    If you find any problem when installing the OS, share your thoughts in comment section.


    Making disk partition in Windows

    The disk partitioning is the process of making free space or split a space on a hard drive. Mostly hard disk partitioning is required for whenever we installing new operating system and as well as our requirement.
    To do this,
    Right click on computer icon and select Manage



    In Storage section you will see Disk Management.

     
    In this area, select any drive you want to make partition, then right click and select Shrink Volume, be patient it may requires time to response.

    enter your required space in "Enter the amount of space to shrink in MB" . Then click next, next, next. That’s all about making disk partitioning

    Sunday, 31 May 2015

    The best download manager for Linux

    Linux is already consisting of it's download manager. So we don't need to install any software in Linux. That tool is WGET.
    WGET is the powerful download manager for Linux. It consist more features.



    1. To download a file from internet:

       # wget http://url-of-web-content/somthing.mp3

    2. If any interrupts occure, when downloading the file, Don't worry about that.
    We can resume the download by typing,

      # wget --continue http://url-of-web-content/somthing.mp3
                                     or
      # wget -c http://url-of-web-content/somthing.mp3

    3. Downloading entire website:
     
      # wget \
    -r \
    -nc \
    - \
    --html-extension \
    -k \
    --restrict-file-names=windows \
    --domains examplesite.com \
    --no-parent \
    www.examplesite.com

    To get all information about the above codes, please refer man pages for the wget tool.




    Wednesday, 27 May 2015

    Difference between Linux and Windows


    Linux is not same as Windows. Linux is may be some what difficult when you are coming from Windows. To know the difference between the Linux and Windows makes easy to handle Linux operating system.


    Linux
    Windows
    Linux uses monolithic kernel
    Windows uses micro kernel
    Linux is UNIX based operating system
    Windows is DOS based operating system
    It is open source. So we can modify the Linux operating system as our taste.
    It is not an open source. It’s some of 3rd parties software’s are open source.
    Linux is entirely free operating system
    It is not free operating system. We need to buy the operating system
    Virus infections are very rare. So no need anti-virus software and its updations
    Windows easily affects virus. So it is mandatory to installing anti-virus software
    Very secure operating system
    Secure when we have anti-virus with up to date software. Other else it is insecure
    It is CLI tool is called BASH
    It is CLI tool is called COMMAND.COM
    512 MB RAM is enough for installing Linux
    Needs at least 712 MB of RAM in order to install Windows
    Installing software is very easy.
    Just typing sudo apt-get install pkgname
    Or using GUI based software centre we can search and install easily
    Installing software is easy, when we have the package other else we need to surf internet and get it.
    There are no spyware available in Linux
    There are lot of spywares available in Windows operating system
    There are lot of distributions are available in Linux. Such as Ubuntu, Fedora, Mint and etc
    Distributions are not available because it is not a opensource operating system
    Each and every 6 months new version of Linux in released
    Each and every 3 years new version of Windows is released
    Speed of response are high because of good memory management
    Speed of response is low than Linux. Because it’s poor memory management
    More popular in Servers world and less popular in Desktop world
    More popular in Desktop world and less popular in Servers world


    Tuesday, 26 May 2015

    Introductuion to Linux Operating system


    Linux is Unix like operating system. The name Linux was used because of it is the combination of Linus Torvalds (Creator of Linux kernel). 

     
                Linu + X
    Where,
    Linu from Linus Torvalds
    X is from Unix
    Basically Linux is not another OS. It is a network. Most of the people didn’t like to use Linux as Desktop OS. Because of its complexity. But truly it is not a complex operating system. Reason for the complex thing is, basically Linux was only used by scientists and programmers at the year of 1994. Microsoft is made both GUI and CLI based OS. But in Linux, it’s only CLI way to communicate PC (At the year of 90’s). So the people moves to MS. Nowadays Linux is offers both GUI and CLI. One more delicious thing is, it is very user friendly than MS. Yes!! It is true. After coming up Ubuntu, the ‘user friendly’ thing is acceptable for Linux. We will discuss in feature, why Linux is more user friendly operating system than Windows operating system.
    Where Linux used?
    You may think, “I didn’t use Linux anymore”. If you thing this, then this is a funny. Because still you are using Linux. You may ask “How???”
    Yes!! Each and every time we are surfing internet with the help of Linux. Most of the websites hosting are Linux. Even Google, Facebook, Yahoo etc.. Servers are Linux servers. Not Windows server. Even Android is also uses Linux kernel.
    Linux is used in,
    • As a desktop OS
    • As a server OS
    • As a web server
    • As a file server & etc
      This blog is absolutely for beginners who want to learn Linux & be a expert in Linux operating system!
      Stay with us! we will post how to do guides about Linux operating system