Software

How to add a static IP in Ubuntu 18x

First things first, as sudo run ifconfig and get the ethernet adapter name.  Some are eth0, eth1, ect ect.

Then add a file in /etc/netplan and call it 01-netcfg.yaml

(Make it look something like this:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   ens33:
     dhcp4: no
     dhcp6: no
     addresses: [192.168.1.2/24]
     gateway4: 192.168.1.1
     nameservers:
       addresses: [8.8.8.8,8.8.4.4]

Save that file and then type netplan apply.

That will do it!

How to log all ssh commands on a linux box

For BASH shells, edit the system-wide BASH runtime config file:

sudo -e /etc/bash.bashrc

Append to the end of that file:

export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$(whoami) [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'

Set up logging for “local6” with a new file:

sudo -e /etc/rsyslog.d/bash.conf

And the contents…

local6.*    /var/log/commands.log

Restart rsyslog:

sudo service rsyslog restart

Log out. Log in. Voila!

But I forgot about log rotation:

sudo -e /etc/logrotate.d/rsyslog

There is a list of log files to rotate the same way…

/var/log/mail.warn
/var/log/mail.err
[...]
/var/log/message

So add the new bash-commands log file in that list:

/var/log/commands.log

How to log console commands in Ubuntu

If you need to see what and who is typing what in your linux box this is the procedure to make it happen.

Start by editing this.

sudo -e /etc/bash.bashrc

Append to the end of that file:
export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$(whoami) [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'

Set up logging for “local6” with a new file:

sudo -e /etc/rsyslog.d/bash.conf

And the contents…

local6.*    /var/log/commands.log

Restart rsyslog:

sudo service rsyslog restart

Log out. Log in. Voila!

But I forgot about log rotation:

sudo -e /etc/logrotate.d/rsyslog

There is a list of log files to rotate the same way…

/var/log/mail.warn
/var/log/mail.err
[...]
/var/log/message

So add the new bash-commands log file in that list:

/var/log/commands.log

How to fix Windows 7 Not Genuine Error – Fix “This copy of Windows is not genuine” Problem

Steps To Fix ” This copy of Windows is not genuine” Error.

Step.1  Go to Start menu and search for cmd, you will get cmd.exe in search result here do a Right Click on cmd.exe and click on Run as Administrator, and you will get Command Prompt.
Step 2. Once the command prompt is opened now type the following command, SLMGR -REARM , make sure you type the same command without any mistake, and also ensure that command prompt is opened in administrator mode otherwise it will not work.
Step 3. Once you typed the above command in command prompt window then hit Enter button on your keyboard to execute the above command.
Step 4. After you hit enter a confirmation window will appear with the details of command execution as.
Step 5. Now  Restart your computer you will not get that error again like Windows 7 build 7600/7601 This copy of windows is not genuine.

How to Install VirtualBox on Ubuntu

With your favorite text editor add one of these to your /etc/apt/sources.list

nano /etc/apt/sources.list or vi /etc/apt/sources.list

For Ubuntu 16.04 ("Xenial")
deb http://download.virtualbox.org/virtualbox/debian xenial contrib

For Ubuntu 15.10 ("Wily")
deb http://download.virtualbox.org/virtualbox/debian wily contrib

For Ubuntu 14.04 ("Trusty")
deb http://download.virtualbox.org/virtualbox/debian trusty contrib

For Ubuntu 12.04 LTS ("Precise Pangolin")
deb http://download.virtualbox.org/virtualbox/debian precise contrib

For Debian 8 ("Jessie") 
deb http://download.virtualbox.org/virtualbox/debian jessie contrib

For Debian 7 ("Wheezy")
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib

Now add the public keys for Oracle:

$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

 

Now install VirtualBox

$ sudo apt-get update
$ sudo apt-get install virtualbox-5.1

 

Now run VirtualBox

$ virtualbox

How To Get Windows 10 Upgrade For Free

Start by going here:  https://www.microsoft.com/en-us/accessibility/windows10upgrade?tduid=(14c348e893a91089cb2980533c6ee123)(256380)(2459594)(TnL5HPStwNw-0FBZfNm6YPFXNhiu3o52rA)()

Click on the Upgrade now button. Run the executable file to install the upgrade.

Microsoft then displays a series of screens that take you step by step through the set-up process. Follow the screens until Windows 10 is comfortably nestled into your device.