Category Archives: Linux

Clock messed up when dual booting

The problem:

  • Linux store the time on the hardware clock as UTC by default
  • Windows store the time on the hardware clock as the local time by default

Since both operating systems access the hardware clock you may encounter problems when you dual boot between them.

A comment for the geeks:

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.

Changing Windows to use UTC

If you dual boot Windows and Linux/MAC and the clock is messed up after each boot, you should either :

  1. run regedit
  2. navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
  3. add key RealTimeIsUniversal as DWORD and set it’s value to 1.
  4. disable Windows time service:
sc config w32time start= disabled

You can download a REG script that performs the first 3 steps from hereย but you will have to perform the last step (disable the service) manually.

Changing Linux to use local time

Pre-Ubuntu 15.04 systems (e.g. Ubuntu 14.04 LTS):

  1. edit /etc/default/rcS
  2. add or change the following section
# Set UTC=yes if your hardware clock is set to UTC (GMT) UTC=no

Ubuntu 15.04 systems and above (e.g. Ubuntu 16.04 LTS):

  1. open a terminal and execute the following command
timedatectl set-local-rtc 1

References:

Advertisements

Grub – Remember last choice

A neat feature of grub2 is that you can set it up so that it remembers your last choice of the last boot.

1 – Edit the grub configuration file

sudo gedit /etc/default/grub

2 – add the following lines:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

3 – update grub file

sudo update-grub

 

Mint 19 Setup Tutorial ๐Ÿ…

Basic installation

1 – Preparation and installation

  1. Download rufus
  2. Download latest stable cinnamon version ISO
  3. Use Rufus to create a bootable USB
  4. Boot the system with the USB. You can try to press F10 while booting in order to activate the boot menu. If it does not work you will have to enter the BIOS (you should google for the keyboard shortcut according to the manufacturer).

When you boot from the USB you will most probably be asked whether you want to ue BIOS mode or UEFI mode. If you already have Windows installed in BIOS mode then you should select BIOS mode. In any other case you should select UEFI mode. Continue reading Mint 19 Setup Tutorial ๐Ÿ…

Restart/shutdown linux with magic (REISUB)

To restart your system, press alt + Printscreen/SysRq. Then, while holding those keys, slowly type the keysย  R E I S U B (one key at a time, requires QUERTY keyboards). You can find a list of all SysRq keys here which includes key presses for other keyboard layouts.

To define the mode of SysRq you should edit the file: /etc/sysctl.d/10-magic-sysrq.conf . That file includes details of various levels of SysRq.

Here is an example of it’s contents:

# 0 - disable sysrq completely
# 1 - enable all functions of sysrq
# >1 - enable certain functions by adding up the following values:
# 2 - enable control of console logging level
# 4 - enable control of keyboard (SAK, unraw)
# 8 - enable debugging dumps of processes etc.
# 16 - enable sync command
# 32 - enable remount read-only
# 64 - enable signalling of processes (term, kill, oom-kill)
# 128 - allow reboot/poweroff
# 256 - allow nicing of all RT tasks

A recommended value is 64ย because it permits you to use oom kill which is very useful.

Here is a short explanation for reboot (not all keys will work, as it depends on the value you have defined inย  /etc/sysctl.d/10-magic-sysrq.conf file) :

  • R: Switch the keyboard from raw mode to XLATE mode
  • E: Send the SIGTERM signal to all processes except init
  • I: Send the SIGKILL signal to all processes except init
  • S: Sync all mounted filesystems
  • U: Remount all mounted filesystems in read-only mode
  • B: Immediately reboot the system, without unmounting partitions or syncing

Here is a short explanation for shutdown:

  • R: Switch the keyboard from raw mode to XLATE mode
  • E: Send the SIGTERM signal to all processes except init
  • I: Send the SIGKILL signal to all processes except init
  • S: Sync all mounted filesystems
  • U: Remount all mounted filesystems in read-only mode
  • O: Immediately shutdown the system, without unmounting partitions or syncing

Here is a cool mnemonic:

  • R – Reboot
  • E – Even
  • I – If
  • S – System
  • U – Utterly
  • B – Broken

References:

http://blog.kember.net/articles/reisub-the-gentle-linux-restart/

https://en.wikipedia.org/wiki/Magic_SysRq_key

 

qdpm/softaculous – Internal Server Error

Whoaaa, that was a nasty bug ๐Ÿ˜ฎ

Use: Debian 8.8 & Apache 2.4 & php 7.0:

  1. Install qdpm via softaculous (or manually, it doesn’t matter)
  2. Navigate to admin page.

and … BOOM: Internal Server Error.

Messages totally misleading. Directory permissions are okay as is the default .htaccess file. Bug is much deeper.

Continue reading qdpm/softaculous – Internal Server Error