How do I enter the Euro symbol? Ubuntu

The easiest way to enter the € Euro Symbol via shortcut is the following:

Go to Settings> Keyboard > Keyboard Shortcuts: View and Customize Shortcuts

Click Customized Shortcuts

Create two shortcuts, one for the Dollar Sign and one for the Euro sign.

Command: xmodmap -e "keycode 13 = 4 dollar 4 dollar"
Shortcut: Ctrl+Alt+D
Command: xmodmap -e "keycode 13 = 4 EuroSign 4 EuroSign"
Shortcut: Ctrl+Alt+E

Now if you want, for example, to change the $ sign

Press Ctrl+Alt+D and then Shift+4

Now if you want, for example, to change the € sign

Press Ctrl+Alt+E and then Shift+4

Enjoy!

Install Google Chrome on Ubuntu 

To install Google Chrome from the terminal, get the DEB file using the wget command:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Installing Google chrome use the below command  from the downloaded DEB file:

sudo apt install ./google-chrome-stable_current_amd64.deb

That’s it. Now you can find Google Chrome in the menu and start it from there.

Find Your Public IP Address in Linux

Many times you might wonder how to find the public IP of your server using the console. Here below few options

curl https://icanhazip.com/
curl ifconfig.me
curl -s http://tnx.nl/ip
curl -s https://checkip.amazonaws.com
curl -s api.infoip.io/ip
wget -O - -q https://icanhazip.com/

Log Analyzer in Linux

For any apache/nginx or other logs. One of my favorite tools is: goaccess

For Debian/Ubuntu installation just installed via apt.

  • $ sudo apt-get install goaccess
  • $ goaccess access.log

Or more information can be viewed when generating an HTML file like below

  • $ goaccess -f FILE.LOG –log-format=’%h %^[%d:%t %^] “%r” %s %b “%R” “%u”‘ –date-format=’%d/%b/%Y’ –date-spec=hr –time-format=’%H:%M:%S’ -a -o RESULT.HTML

How to send email using telnet

  1. Open your terminal.
  2. Now, connect with telnet using the following command:
    telnet smtp.domain.com 25
  3. Type ehlo example.com. Some servers also accept helo in place of ehlo.
    ehlo
  4. Type mail from: username@example.com:
    mail from: username@domain.com
  5. Type rcpt to: user@hotmail.com, user2@yahoo.com (replace with your actual recipient name):
    rcpt to: user@hotmail.com, user@yahoo.com
  6. To write the message – type data, followed by your subject and message. To end the message, put a period on a line by itself and press enter:
    data
    Subject: My Telnet Test Email
    
    Hello,
    
    This is an email sent by using the telnet command.
    
    Your friend,
    Me
    
    .
    
  7. Type quit to exit telnet.

How to create a swap file in linux using dd

Swap file creation
As root use dd to create a swap file the size of your choosing (M = Megabytes, G = Gigabytes). For example, creating a 512 MB swap file:

# dd if=/dev/zero of=/swapfile bs=1M count=512

Set the right permissions

# chmod 600 /swapfile

After creating the correctly sized file, format it to swap:

# mkswap /swapfile

Activate the swap file:

# swapon /swapfile

Edit fstab to add an entry for the swap file:

# vim /etc/fstab

/swapfile swap swap defaults 0 0

Remove swap file

To remove a swap file, the current swap file must be turned off.

As root:

# swapoff -a

Remove swap file:

# rm -f /swapfile

Finally remove the relevant entry from /etc/fstab.

VMware ESXi convert Thick to Thin Provisioned Drives

Before converting the VMDK file power off the VM and remove from inventory.

ssh to the esx server that you store the VM server that needs conversion

Go to /vmfs/volumes/YourStore/YourVMlocation

and run the below command to convert the HDD

vmkfstools -i ThickHDD.vmdk ThinHDD.vmdk -d ‘thin’ -a lsilogic

When is done add the VM again on the ESX server and remove the Thickhdd.vmdk and add the new Thinhdd.vmdk

Power on the VM.

Ubuntu Web Control Panel – Ajenti

Ajenti Control Panel - Dashboard

Login to your server as root and run the below commands

  • aptitude update

Add the Key and Ajenti Repository

  • wget http://repo.ajenti.org/debian/key -O- | apt-key add –
  • echo “deb http://repo.ajenti.org/ng/debian main main ubuntu” >> /etc/apt/sources.list

Install Ajenti via apt-get or aptitude

  • aptitude update
  • aptitude install ajenti -y

Restart The Ajenti service by running the below command

  • service ajenti restart

Access the website with your web browser

  • https://IP-Address.com:8000 or https://your-domain.com:8000

Default Username and password is :

  • Username: root
  • Password: admin

You can now login change the default password & configure you dashboard as you like etc..

Install webmin on ubuntu

Login to your server as root.

  • sudo vim /etc/apt/sources.list

and at the bottom of the file add the bellow line:

  • deb http://download.webmin.com/download/repository sarge contrib

Save the file and run the below command to install the security key:

  • wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add –

Update the sources by typing

  • apt-get update or aptitude update
  • apt-get install webmin or aptitude install webmin

Open a Web browser go to the webmin login page:

  • https://IPofTheServer:10000
  • use your default Username & Password

 

Mailx configuration

Using Centos

# yum install mailx

Go to

# vi /etc/mail.rc

Add the 2 lines below

  • set smtp=your.mail.server.com
  • set from=your@email.sender.com

Using Ubuntu

# apt-get install mailx

Go to

# vi /etc/mail.rc

Add the 2 lines below

  • set smtp=your.mail.server.com
  • set from=your@email.sender.com