Category Archives: Operating systems

Posts related to Windows, Android and Debian based Linux.

How to restart Cinnamon

Let’sfind ways to restart cinnamon. Some methods are disabled by default and may require preparation before they are available to your linux box:

Method 1:

  • Requires a somewhat responsive GUI
  • Super easy

Steps:

  1. Press alt+F2, then r and then press enter

Continue reading How to restart Cinnamon

Advertisements

How to upgrade a specific app via apt

Let’s say you want to upgrade firefox via command prompt to version 90 and let’s assume the version you want to upgrade to has been added to the repositories.

You can upgrade firefox via the commands:

sudo apt-get update
suto apt-get install firefox

Indeed, the install parameter will upgrade firefox.

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

 

Junctions in Windows 7

To create a junction you can use the following command from a terminal:

mklink /J C:\...\linkname C:\...\OriginalFolder

To add a GUI, you can install the shell extension from:

http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html

You perform the following steps:

  1. install the x64 prerequisites package
  2. install the link extension
  3. restart explorer (you will be prompted after installation)

Then, instead of copy and paste, you use pick and drop to create junctions and links:

  1. Right click on the original file/folder  and select Pick link source
  2. Right click on the destination folder and select Drop Here  Symbolic link

 

 

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

SCP

Examples

Copy the file “foobar.txt” from a remote host to the local host

$ scp your_username@remotehost.edu:foobar.txt /some/local/directory

Copy the file “foobar.txt” from the local host to a remote host

$ scp foobar.txt your_username@remotehost.edu:/some/remote/directory

Copy the directory “foo” from the local host to a remote host’s directory “bar”

Continue reading SCP

Upgrade to gcc 6.3+ in Ubuntu

To upgrade gcc to gcc6 use the following commands:

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-6 -y

 

To set the new gcc as default use the following:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

Once you have executed the previous command, g++ may not be available.

So you can execute the following to create a link:

sudo ln -s /usr/bin/g++-5 /usr/bin/g++