Fix time differences between Ubuntu and Windows


A. To fix the UTC / local time difference between Ubuntu and Windows from Ubuntu by making Ubuntu uses local time.

Before proceeding, note that according to the Ubuntu wiki, "the advantage of having the hardware clock as UTC is that you don't need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets". So this is not recommended and if you can, you should use method B., and fix this from Windows.

For Ubuntu 16.04 and newer, run the following command (thanks to Erwinson Pagtalunan for the update!):
timedatectl set-local-rtc 1

You can then check if Ubuntu uses local time, you can then use the following command:
timedatectl
Which should display the following "RTC in local TZ: yes". A warning will also be displayed. Here's the full command output:
$ timedatectl
      Local time: Lu 2016-04-25 12:18:22 EEST
  Universal time: Lu 2016-04-25 09:18:22 UTC
        RTC time: Lu 2016-04-25 12:18:22
       Time zone: Europe/Bucharest (EEST, +0300)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.

For Ubuntu versions older than 16.04: you must edit the /etc/default/rcS file and replace "UTC=yes" with "UTC=no" (both without the quotes). To do this automatically, simply copy/paste the following command in a terminal:
sudo sed -i 's/UTC=yes/UTC=no/' /etc/default/rcS
And then reboot.


B. To fix this from Windows (it should work with Vista SP2, Windows 7, Server 2008 R2 and Windows 8/8.1), by making it uses UTC instead of local time, download THIS Windows registry file and simply double click it.

Then, to disable the Windows Time service (which still writes local time to RTC regardless of the registry setting above, on shutdown), run Command Prompt as Administrator and paste this command:
sc config w32time start= disabled
And reboot.


How to revert the changes


A. From Ubuntu: reverting this change from Ubuntu is pretty easy.

Ubuntu 16.04 and newer: to revert the changes, simply run the following command:
timedatectl set-local-rtc 0

Ubuntu versions older than 16.04: all you have to do is replace "UTC=no" with "UTC=yes" in the/etc/default/rcS file. To do this automatically, copy/paste the command below in a terminal:
sudo sed -i 's/UTC=no/UTC=yes/' /etc/default/rcS
And then reboot your computer.

B. From Windows: reverting this change is a bit more complicated from Windows. 

Firstly, open the .reg file downloaded when applying the fix for Windows (see download link above) with a text editor and change the "RealTimeIsUniversal" value from "dword:00000001" to "-" (without the quotes). Here's how the file should look like after making this change:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=-
Then save the file and double click it. 

Next, run the following command in Command Prompt (which you need to run as Administrator) to re-enable the Windows Time service:
sc config w32time start= demand
And finally, reboot.


References / more information:
                                                                                                                                       Source: online

Accesing mutlple users to Read/Write and Execute on same File/Folder in linux



Open Terminal:

1. Create a group

sudo addgroup linux-data

2. Add users to group

sudo adduser mahesh linux-data
sudo adduser kumar linux-data 

3. Change group ownership

sudo chgrp -R linux-data /media/mahesh/Linux-drive

4. Assign Read/Write and Execute permission to group

sudo chmod -R g+rwx /media/mahesh/Linux-drive
sudo chmod -R g+s /media/mahesh/Linux-drive 

How to get sudo to prompt you for a password each time in linux


Open Terminal and type:
sudo visudo
Then scroll down to the line that reads:
Defaults        env_reset
And change it to:
Defaults        env_reset,timestamp_timeout=0
You can change 0 to any values (time in minutes). Setting it to 0 will ask for your password every time and -1 will make it never ask. The default is 15 according to man sudo 8, but some manuals say the default is 5. Have a look at the RootSudoTimeout wiki for more information.
Press CTRL + X to finish editing, Y to save changes, and ENTER to exit.

How to change disk checking (fsck) frequency at boot?


Ubuntu checks the root partition at about every 30th boot. If you have a desktop machine/laptop that you switch off every day, this number may be too small. In this case you can safely increase this number to 50 at least.
First, figure out where your root partition is using the df command which produces this result in my case:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda6             30850168   9374588  19908444  33% /
/dev/sda8            129636480  52663092  76973388  41% /media/DATA
So my root partition (‘/‘) is at /dev/sda6.
Then check out your disk checking frequency:
sudo dumpe2fs /dev/sda6 | grep -i "mount count"
Where you need to replace /dev/sda6 with the value that is specific to your root partition. Its output is something like this:
dumpe2fs 1.42.13 (17-May-2015)
Mount count:              12
Maximum mount count:      26
Finally, if I want to increase the frequency to 50:
sudo tune2fs -c 50 /dev/sda6 
To disable file system integrity check for forever. Type following command
sudo tune2fs -c -1 /dev/sda6 
To check after 1 month. Type following command
sudo tune2fs -i 1m /dev/sda6 
List  the  contents  of the filesystem superblock, including the current values of the parameters that can be set via  this  pro‐gram.
sudo tune2fs -l /dev/sda6
Where, again, you might need to replace /dev/sda6.

How To Stop Wi-Fi Stealing And Catch That Person


backdoor-Netis-Netcore-Router
Often we are unable to locate an uninvited user who uses our Wi-Fi. If someone uses our Wi-Fi without our knowledge, that would be termed as Wi-Fi stealing.Whatever be the case, to be on the safer side, we must know who is using my Wi-Fi without my permission and how can we stop them. So, here are the steps

Login to your router

Different routers support different login styles. So, I am listing a few of the logging in style, out of these, one might work for you:
  • 1. Punch in the IP address of your router in your browser address bar directly like 192.168.0.1 or 192.168.1.1
  • 2. If the above address does not work, you can also try routerlogin.com and it will redirect to your router admin panel.
  • 3. Enter the administrator username and password.
  • 4. nce you are inside the admin panel, look for menu options like ‘Connected devices’ or ‘Attached devices’.
  • 5. If you are able to find that menu, you can see the MAC Address, IP Address and Device name of all the devices which are connected to your network. This is how my Attached devices looks like.
  • 6. If you see some extra person’s name or some extra device then they are the one who might be using your Wi-Fi without your permission. Read on to know the steps to stop Wi-Fi stealing.

Mac Filtering

How to stop someone from Wi-Fi stealing?

Once you come to a conclusion that someone else is making use of your Wi-Fi resources, you can simply change the password of your Wi-Fi to a stronger password. You can also switch off your SSID broadcast.
If you want a stricter action, you can set up a filter based on the MAC address of the devices.