How to install and access to your Raspberry Pi (Rasbian Lite version — No GUI)

Teamviewer on rasbian lite (no GUI)

  1. make sure you have TeamViewer account
  2. Download package: $ wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.tar.xz
  3. Extract package: $ tar -xvf teamviewer-host_armhf.tar.xz
  4. Install via dpkg tool: $ dpkg -i teamviewer-host_armhf.deb
  5. Run apt to fix: $ apt install -f (then you will ask to install a lot of dependencies, by issue ‘Y’)
  6. Run this command: $ teamviewer setup -> accept agreement -> login your credential (email) -> go to your
  7. email and add trusted devices -> you should get your TeamViewer ID for your raspberry box
  8. Create password for your device corresponding to your TeamViewer ID you get from the previous step: $ teamviewer –passwd YOUR_PASSWORD

===> Now you should be able to log in to your raspberry pi via teamviewer shown as SSH console.

 

Screen Shot 2017-12-07 at 4.40.20 PM

Sample image: Raspberry Pi from TeamViewer Apps with ‘htop’ running

 

How to install Webmin in Ubuntu

Here are a couple steps to get Webmin up and running on Ubuntu box:

  1. Make sure you log in as root, otherwise issue: sudo -s
  2. Add *.list file name webmin.list: nano /etc/apt/sources.list.d/webmin.list
    #add this lines
    deb http://download.webmin.com/download/repository sarge contrib
    deb http://download.webmin.com/download/repository sarge contrib
  3. Download key file: wget http://www.webmin.com/jcameron-key.asc
  4. Add key: apt-key add jcameron-key.asc
  5. Update package list: apt-get update
  6. Install package Webmin: apt-get install webmin
  7. Finally, you can now access to your Ubuntu box: https://Ubuntu-IP-Address:10000

Cheers!!!

Configure IP Addressing on CentOS

## ## Configure eth0 # # vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0" NM_CONTROLLED="yes" ONBOOT=yes HWADDR=A4:BA:DB:37:F1:04 TYPE=Ethernet BOOTPROTO=static NAME="System eth0" UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 IPADDR=192.168.1.44 NETMASK=255.255.255.0

## Configure Default Gateway # # vi /etc/sysconfig/network

NETWORKING=yes HOSTNAME=centos6 GATEWAY=192.168.1.1

## Restart Network Interface #

/etc/init.d/network restart

## Configure DNS Server # # vi /etc/resolv.conf

nameserver 8.8.8.8 # Replace with your nameserver ip nameserver 192.168.1.1 # Replace with your nameserver ip

### Source: https://gist.github.com/fernandoaleman/2172388#file-linux-static-ip

By vichhaiy Posted in Linux

Understanding DNS Zone…

zone "example.com" in {
type master;
file "/etc/bind/zones/master.example.com";
allow-transfer { key dns-server.example.com; };
allow-query { any; };
also-notify { 172.16.200.23; 172.16.202.23; };
notify yes;
};

Let’s understand each line and its meaning in the above shown zone clause inside our bind installation.

zone "example.com": is the opening of the zone clause and it specifies the zone for which this configuration is applicable.
type master: this statement is used to specify that this server is going to be the master server for the zone example.com, and will be authoritatively modifying the zone content.
file "/etc/bind/zones/master.example.com": This statement denotes the file on our DNS server which contains the zone file and its records(we will see that file in some time).
allow-transfer {key dns-server.example.com}: This line is the most important line that is part of the security feature in bind for secure zone transfer. This line says that zone trasfer is allowed only to servers that have this key named dns-server.example.com. Please note the fact that the name of this key must be same on the slave servers as well.
allow-query {any;}: This line specifies that this zone can be queried by any ip address.
also-notify {172.16.200.23; 172.16.202.23; }: This line says that the bind server should notify these servers whenever a zone modification happens. If you see the statement, it is also-notify, means bind is will already be informing some servers about its zone modification, along with that include these servers as well(i will exaplain this a little later while making the zone file for example.com).
notify yes; is an option used to convey bind to notify slaves about the zone modification.

;zone file for domain example.com
$TTL 300 ; zone default of 5 minutes
$ORIGIN example.com.
@ IN SOA ns1.example.com. admin.example.com. (
2013100702 ; serial number
2h ; refresh
15m ; update retry
5w ; retry
2h ; <minimum></minimum>
)
IN MX 10 mail.example.com.
IN NS ns1.example.com.
IN NS ns2.example.com.
ns1 IN A 172.16.202.55
ns2 IN A 172.16.203.85
www IN A 172.16.200.18
apps IN A 172.16.200.19
ftp IN A 172.16.200.22

Why Linux?

Although Windows is the most popular OS (Operating System) for casual computer users, this does not necessarily make it the "best" OS. Ubuntu, which is a Linux distribution, has many features that make it a good alternative to Windows:

  • It’s free. True, one could download pirated versions of Windows. But that would be illegal.
  • It’s an open source operating system. This means anyone is entitled to download and view the source code to any/all parts of the operating system. Or change it, to suit whatever purpose they want to use it for. If they choose to distribute their modified version, other people can then go on to change that too, allow the software to evolve to serve different needs.
  • It’s community driven. This means that anyone can contribute to the effort, be it with programming, art, sounds, documentation, or answering users’ questions on the Internet. It’s not controlled by a Fortune 500 company with questionable legal practices.
  • It’s more reliable. Linux crashes far less often than Windows, unless you purposely overload the system.
  • It’s free software. Almost all of the software associated with the OS is available for free and can be easily installed with just a couple of clicks.
  • It’s safe. There are very few viruses written for Linux due to its relatively low user base (compared to Windows). There are only 49 viruses in Linux and most are patched in kernel updates (from Spatry’s Cup of Linux).
    • If someone were to write viruses for Linux they would have to be very sophisticated due to the fact that the virus could not be executed unless it were given root permissions.
    • The virus would have to be run as the root user if it was intended to cause any serious damage due to the restrictions that normal users have by default.
    • There are some viruses out there that can cause loss of users data. Just be extra careful when anyone tells you to run a command, and only take advice from trusted people/sources.
  • Did I mention it’s free to download, free to use, and free to upgrade, and will be forever?
By vichhaiy Posted in Linux

How to use “route” command on Linux

Route command is used to show/manipulate the IP routing table. It is primarily used to setup static routes to specific host or networks via an interface.

Let’s start with some very basic…

1. Running route at the command line without any options will display the routing table entries:

#route

2. Learn to add and remove routes from your routing table:
eth0 : Exit interface

gw : GateWay

#route add -net 192.168.0.0/24 dev eth0
#route del -net 192.168.0.0/24 dev eth0

#route add -net 192.168.0.0/24 gw 192.168.10.1
#route del -net 192.168.0.0/24 gw 192.168.10.1

That’s all!

Unix Less Command: 10 Tips for Effective Navigation

I personally prefer to use less command to view files (instead of opening the file to view in an editor). Less is similar to more command, but less allows both forward and backward movements. Moreover, less don’t require to load the whole file before viewing. Try opening a large log file in Vim editor and less — you’ll see the speed difference.

The navigation keys in less command are similar to Vim editor. In this article, let us look at few less command navigation and other operations which will make you a better command line warrior.

1. Less Command – Search Navigation

Once you’ve opened a log file (or any file) using less file-name, use the following keys to search. Please note that the match will be highlighted automatically by default.

Forward Search

  • / – search for a pattern which will take you to the next occurrence.
  • n – for next match in forward
  • N – for previous match in backward

Backward Search

  • ? – search for a pattern which will take you to the previous occurrence.
  • n – for next match in backward direction
  • N – for previous match in forward direction

Tip: If you dont bother about which direction the search is happening, and you want to search file path, or URL, such as “/home/ramesh/”, you can use backward search (?pattern) which will be handy as you don’t want to escape slashes each time.

Search Path In forward: /\/home\/ramesh\/ In backward: ?/home/ramesh/

2. Less Command – Screen Navigation

Use the following screen navigation commands while viewing large log files.

  • CTRL+F – forward one window
  • CTRL+B – backward one window
  • CTRL+D – forward half window
  • CTRL+U – backward half window

3. Less Command – Line navigation

In a smaller chunk of data, where you want to locate particular error, you may want to navigate line by line using these keys:

  • j – navigate forward by one line
  • k – navigate backward by one line

4. Less Command – Other Navigations

The following are other navigation operations that you can use inside the less pager.

  • G – go to the end of file
  • g – go to the start of file
  • q or ZZ – exit the less pager

5. Simulate tail -f inside less pager – Press F

Once you’ve opened a file using less command, any content that is appended to the file after that will not be displayed automatically. However, you can press Fless command will show the status ‘waiting for data‘. This is as similar to ‘tail -f’.

Also, refer to our earlier article about how to view multiple logs files using tail -f.

6. Less Command – Count magic

Similar to Vim editor navigation command, you can give 10j to scroll 10 lines down, or 10k to go up by 10 lines.

  • 10j – 10 lines forward.
  • 10k – 10 lines backward.
  • CTRL+G – show the current file name along with line, byte and percentage statistics.

7. Other useful Less Command Operations

  • v – using the configured editor edit the current file.
  • h – summary of less commands
  • &pattern – display only the matching lines, not all.

8. Open any types of files using less command

As we discussed in our earlier article, you can use less command to Open & view 10 different file types.

9. Less Command – Marked navigation

When you are viewing a large log file using less command, you can mark a particular position and return back to that place again by using that mark.

  • ma – mark the current position with the letter ‘a’,
  • ‘a – go to the marked position ‘a’.

10. Less Command – Multiple file paging

Method 1: You can open multiple files by passing the file names as arguments.

$ less file1 file2

Method 2: While you are viewing file1, use :e to open the file2 as shown below.

$ less file1 :e file2

Navigation across files: When you opened more than two files ( for e.g – less * ), use the following keys to navigate between files.

  • :n – go to the next file.
  • :p – go to the previous file.

Source: http://www.thegeekstuff.com/2010/02/unix-less-command-10-tips-for-effective-navigation/