bash


HOWTO: Make Terminator Terminal Act Like Guake Terminal in Ubuntu 11.10 8

Updated instructions for Fedora 23 can be found here http://bytefreaks.net/gnulinux/bash/howto-make-terminator-terminal-act-like-guake-terminal-in-fedora-23

For Ubuntu 16.04LTS here http://bytefreaks.net/gnulinux/howto-make-terminator-terminal-act-like-guake-terminal-in-ubuntu-16-04-lts-the-easy-ways

Installation:

We had to install the beta version so that it supports a new feature that is not currently available in the Ubuntu repositories:

sudo add-apt-repository ppa:gnome-terminator/ppa
sudo apt-get update
sudo apt-get install terminator

After that, create the following file: ~/.config/terminator/config  and add the following text in it:

[global_config]
  enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
  always_on_top = True
  tab_position = bottom
  sticky = True
[keybindings]
  hide_window = F12
[profiles]
  [[default]]
    background_darkness = 0.75
    background_type = transparent
    foreground_color = "#ffffff"
[layouts]
  [[default]]
    [[[child0]]]
      position = 0:24
      type = Window
      order = 0
      parent = ""
      size = 1679, 298
    [[[child1]]]
      position = 839
      type = HPaned
      order = 0
      parent = child0
    [[[terminal3]]]
      profile = default
      type = Terminal
      order = 1
      parent = child1
    [[[terminal2]]]
      profile = default
      type = Terminal
      order = 0
      parent = child1
  [[original]]
    [[[child1]]]
      type = Terminal
      parent = window0
      profile = default
    [[[window0]]]
      type = Window
      order = 0
      parent = ""
[plugins]

This will configure terminator to accept the F12 button as a hide/show command wherever you are and will initially create a session with two terminals when you start terminator, as in the screenshot below:


Ubuntu Linux: How to install Apache2 – MySQL – PHP (LAMP) phpMyAdmin and fix a few installation errors

We won’t give out pretty much any comments/descriptions for this post because we want to keep it small 🙂

First, install a bunch of stuff:

sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5 libapache2-mod-php5 php5-mysql

Later, restart your apache so that it loads all modules (php, etc)

sudo /etc/init.d/apache2 restart

and if you get the following error:
“Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” resolve it by adding the line:

ServerName localhost

to the file /etc/apache2/httpd.conf and then try restarting again. (You need root access to edit, if you are not familiar with command line text editors line nano, try sudo gedit /etc/apache2/httpd.conf, gedit is usually available with all gnome installations).

After that, to install phpMyAdmin and make it available at http://localhost/phpmyadmin:

sudo apt-get install phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www

(The default MySQL login username ‘root’ and the password is the one you entered during installation in the last step).

Happy developing, hope we helped 🙂


Bash: grep: A couple of usefull applications

(How) to delete all empty lines from a file:

cat someFile | grep -v '^$'

(How) to get all numbers that have no sign in front of them (all positive numbers, from a file where on each line there is one number only):

cat someFile | grep ^[0-9]

(How) to extract all negative numbers (from a file where on each line there is one number only):
You can of course replace the minus ‘-‘ character with any other you want to use as a starting character for a line.

cat someFile | grep ^-