Tag Archives: UBUNTU

Install Sublime editor in ubuntu

Type the following commands in the terminal, for Sublime Text 2 :

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
 

For Sublime Text 3 :

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

Leave a comment

Filed under Development, UBUNTU

STOP loading previous pages when chrome browser started in ubuntu

While Google gets to work fixing the Chrome battery drain issue affecting Windows users, an easy interim solution may help preserve laptop battery life in the meantime.
The fix? Closing the browser when it’s not needed.

Captain Obvious

Historically, closing an application in Windows is straightforward: you click or tap on the ‘x’ window control button.
Depending on your settings, this isn’t always the case with Chrome; closing doesn’t always mean it fully exits. The browser often continues to run in the background on Windows (and Linux) – something you might never notice.

The Reason Why: You

Whether this happens or not depends on the sort of applications and extensions you have installed in Chrome. Some of these will “ask” the browser to stay awake so that they can continue to function; e.g., to deliver notifications of new e-mail messages or keep an active IRC chat alive.
Google makes it easy to tell when background apps are active: just look for the Google Chrome icon in the system tray (bottom right corner of your desktop screen). Click on this emblem to view a list of active tasks and a access a proper ‘Exit’ option.
If want to stop Chrome from running in the background entirely (i.e., so that it always exits when closed), regardless of extension, you can. You just need to tell it to.

How to Stop Chrome Running in the Background

On Windows or Linux click on the Chrome icon in the task bar/system tray, find the ‘Let Chrome run…’ option and click/tap it to disable/toggle the checkmark off.
It’s that simple. 
The behaviour can also be changed through the browser’s main settings page:
  • Click on the Chrome menu (or press Alt+E)
  • Select Settings
  • Click on the link titled ‘Show advanced settings
  • Under the section headed ‘System‘ untick the box next to “Continue running background apps when Google Chrome is closed”
To reenable the feature simply repeat the steps above but reversing the final step.

Leave a comment

Filed under COMPUTER, UBUNTU

Create a link in UBUNTU to a app or module or extension — how to install fpdf in ubuntu

1. Please login as “root” or admin privilege as root equivalent in terminal and give the following command

# sudo apt-get install php-fpdf

2. Internet connection should be there, after successful installation there will be a file in the following location

# ls -l /usr/share/php/fpdf

3. Please create a symbolic link and direct the link to make available on your webserver ( the default location of apache web server is ” /var/www/ ” ) using the following command

# ln -s /usr/share/php/fpdf  /var/www/fpdf

4. Reload your webserver

#/etc/init.d/apache2 restart

(or)

#/etc/init.d/apache2 force-reload

(or)

#service apache2 restart

5. Make sure PHP commands on web page associated with the conversion to PDF function like this

<?php

require(‘fpdf/fpdf.php’);

?>

6. Finish.

For further reference ,

How to install PHP-FPDF in Ubuntu

Leave a comment

Filed under Development, PHP, UBUNTU, YII

Top 10 Paint Applications in UBUNTU

Update 1: Three more applications were added to the list, Tux Paint, Pinta and GrafX2.

Update 2: If you are interested in full-fledged, powerful image manipulation tools, have a look at GIMPKrita (on Steam too) and PaintSupreme. For photo albums and collections have a look at digiKamFotoxx or Shutter.

Kolourpaint
Kolourpaint is a feature-rich painting program for KDE with a typical user-friendly interface, supporting many image formats (including PNG, JPG, TGA, PNM, GIF, BMP, XPM or TIFF). It allows zooming in/out, copy/paste, printing, cropping, rotating, applying various effects (balance, emboss, soften & sharpen). I think it is a perfect application for making simple paintings or sketches.

sudo apt-get install kolourpaint4

MyPaint
MyPaint offers many features and also an interface which is somewhat unusual among painting applications. There is the actual workspace and a separate window with predefined brushes to select from. It features usual functions, including undo/redo, zooming in/out, many brush types, several effects. Two noteworthy things to mention here are the existence of layers and also the brush editor, which allows you to create your own brushes.

sudo apt-get install mypaint

mtPaint
This application is full-fledged, and comes by default with a black background. It offers application-specific settings (like showing/hiding toolbars, splitting window), and also various effects, channels, or layers. Although it’s pretty good and has many options, I doubt it’s a good match for kids.

sudo apt-get install mtpaint

Gnome-paint
This is a very simple drawing application for the GNOME desktop with a typical interface and few options. It offers basic functions and two sidebars: one to choose the tool to use and the other one to choose the color. The feature to insert text is not yet implemented.

sudo apt-get install gnome-paint

Gpaint
Gpaint is yet another simple painting program from GNU, built with GTK, which offers standard functions and quite a few effects, like sharpen, emboss, oil paint or solarize. There is no undo function.

sudo apt-get install gpaint

Tkpaint
Tkpaint is written in Tcl/Tk and offers predefined shapes, various line types, text inserting support and several other tools. It can open GIF, PPM or BMP formats and will save the output image as Encapsulated PostScript or Tcl script.

sudo apt-get install tkpaint

XPaint
XPaint is rather a nice painting application, including a C script editor, toolbox, brush selector, font selector, color and pattern editor, and even a magnifier.

sudo apt-get install xpaint

Addition: Tux Paint
Tux Paint is especially designed for kids, and it provides bulleted buttons for the usual painting tools and brushes. The very nice thing about Tux Paint is that it provides various sounds when the paint tools are used or selected.

sudo apt-get install tuxpaint

Pinta
Pinta is yet another powerful application for GNOME, featuring zoom in/out, fullscreen mode, rotate, resize, brightness/contrast and hue/saturation settings, brushes and the typical painting tools. Except for those, Pinta also offers various effects and layers.

sudo apt-get install pinta

GrafX2
Finally, there is GrafX2, which is a bitmap painting program for X, specialized in 256-color drawing. It is not suitable for children since it is a per-pixel drawing program and the interface may be a bit hard to get a handle on at first.

grafx2

sudo apt-get install grafx2

Rassam-paint
Rassam-paint is a simple painting program written using GTK2 with basic tools such as pencil, brush or flood fill, shapes (line, rectangle, ellipse) and support for all the popular formats out there (PNG, JPG, TIFF, ICO etc).

rassam_paint_03

Install Rassam-paint 1.1 in Ubuntu 14.04, Ubuntu 14.10 and Mint 17

DEB packages are available for both 32-bit and 64-bit systems, as well as pre-compiled binaries. To install Rassam-paint in Ubuntu or Mint you can download the DEB file for your architecture (32-bit or 64-bit) and either double click it or open a terminal and type the command below:

For 64-bit, download the DEB from here and to install it type:

sudo dpkg -i rassam-paint_1.0_amd64.deb

For 32-bit, download the DEB from here and to install it type:

sudo dpkg -i rassam-paint_1.0_i386.deb

The program will be installed as /usr/bin/rassam-paint.

The alternative would be to download the archive which contains the pre-compiled binary, then uncompress it, then run the program. The archive is decompressed in the current directory unless specified otherwise, with no root directory. The unzip package will need to be installed as well (sudo apt-get install unzip).

For 64-bit download the archive from here and type in a terminal:

unzip Rassam-paint_64bit_1.0.zip
./rassam-paint

For 32-bit download the archive from here and type in a terminal:

unzip Rassam-paint_32bit_1.0.zip
./rassam-paint

Leave a comment

Filed under GENERAL INFO, UBUNTU

Setting a CRON Job in UBUNTU

Cron job written so automatic backup doing by the server.

Setting A CRON Job in UBUNTU :

Method 1:

1. Goto Super User by giving the command #su root (here is the super user is root not the same in every system)

2.  man crontab — gives the detials about the crontab, if needed check the document once before proceeding, if the command not existing install Gnome schedule task tool.

Install “Gnome schedule tasks tool”, to install this use the command as

# sudo apt-get install gnome-schedule

3. start the crontab in terminal using the command

#crontab -e (should be super user to execute this command)

for help use the command ( #man 5 crontab ).

+——————————————————————–+

|  -e –> editor                                                 |

|  -l  –> current job display on standard output     |

|  -r  –> current crontab to be removed                |

+——————————————————————–+

4. Before editing or assigning a task check the command which is going to added in crontab executing or not from the current location.

5. Here in this case, the shell file “bakup.sh” is in /usr/bin/server/bakup folder. so the line added at the end is

0 0 * * * user_name sh /usr/bin/server/bakup/bakup.sh

The above command executes on every day at 12 A.M, ie., the db backup taken at every day midnight.

Another example,

0 3 * * 0 root /sbin/shutdown -r +5

The above command restart the server at 3 A.M on every sunday.

+———————————————————————————————————————————————+

| Format is minute(0-59) hour(0-23,0=midnight) day(1-31) month(1-12) weekday(0-6,0 or 7=sunday)  |

| 0 0 * * *        —>  midnight on everyday  |

| 0 0 * * 1-5     —>  midnight every weekday  |

| 0 0 1,15 * *   —>  midnight on 1st and 15th of month  |

| 0 0 1 * 5       —>  midnight on 1st of month and every friday  |

+———————————————————————————————————————————————+

Method 2:

1. Login as root user and execute the following command.

# vim /etc/crontab.

2. At the end of the file add the line of command which is to be executed

0 0 * * * user_name sh /usr/bin/server/bakup/bakup.sh  (Here in our case, the shell file “bakup.sh” is in /usr/bin/server/bakup folder. so the line added at the end)

Manual for cron job settings:

Linux Crontab Format

MIN HOUR DOM MON DOW CMD

Table: Crontab Fields and Allowed Ranges (Linux Crontab Syntax)

Field Description Allowed Value

MIN Minute field 0 to 59

HOUR Hour field 0 to 23

DOM Day of Month 1-31

MON Month field 1-12

DOW Day Of Week 0-6

CMD Command Any command to be executed.

1. Scheduling a Job For a Specific Time

The basic usage of cron is to execute a job in a specific time as shown below. This will execute the Full backup shell script (full-backup) on 10th June 08:30 AM.

Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20.

30 08 10 06 * /home/ramesh/full-backup

30 – 30th Minute

08 – 08 AM

10 – 10th Day

06 – 6th Month (June)

* – Every day of the week

2. Schedule a Job For More Than One Instance (e.g. Twice a Day)

The following script take a incremental backup twice a day every day.

This example executes the specified incremental backup shell script (incremental-backup) at 11:00 and 16:00 on every day. The comma separated value in a field specifies that the command needs to be executed in all the mentioned time.

00 11,16 * * * /home/ramesh/bin/incremental-backup

00 – 0th Minute (Top of the hour)

11,16 – 11 AM and 4 PM

* – Every day

* – Every month

* – Every day of the week

3. Schedule a Job for Specific Range of Time (e.g. Only on Weekdays)

If you wanted a job to be scheduled for every hour with in a specific range of time then use the following.

Cron Job everyday during working hours

This example checks the status of the database everyday (including weekends) during the working hours 9 a.m – 6 p.m

00 09-18 * * * /home/ramesh/bin/check-db-status

00 – 0th Minute (Top of the hour)

09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm

* – Every day

* – Every month

* – Every day of the week

Cron Job every weekday during working hours

This example checks the status of the database every weekday (i.e excluding Sat and Sun) during the working hours 9 a.m – 6 p.m.

00 09-18 * * 1-5 /home/ramesh/bin/check-db-status

00 – 0th Minute (Top of the hour)

09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm

* – Every day

* – Every month

1-5 -Mon, Tue, Wed, Thu and Fri (Every Weekday)

4. How to View Crontab Entries?

View Current Logged-In User’s Crontab entries

To view your crontab entries type crontab -l from your unix account as shown below.

ramesh@dev-db$ crontab -l

@yearly /home/ramesh/annual-maintenance

*/10 * * * * /home/ramesh/check-disk-space

[Note: This displays crontab of the current logged in user]

View Root Crontab entries

Login as root user (su – root) and do crontab -l as shown below.

root@dev-db# crontab -l

no crontab for root

Crontab HowTo: View Other Linux User’s Crontabs entries

To view crontab entries of other Linux users, login to root and use -u {username} -l as shown below.

root@dev-db# crontab -u sathiya -l

@monthly /home/sathiya/monthly-backup

00 09-18 * * * /home/sathiya/check-db-status

5. How to Edit Crontab Entries?

Edit Current Logged-In User’s Crontab entries

To edit a crontab entries, use crontab -e as shown below. By default this will edit the current logged-in users crontab.

ramesh@dev-db$ crontab -e

@yearly /home/ramesh/centos/bin/annual-maintenance

*/10 * * * * /home/ramesh/debian/bin/check-disk-space

~

“/tmp/crontab.XXXXyjWkHw” 2L, 83C

[Note: This will open the crontab file in Vim editor for editing.

Please note cron created a temporary /tmp/crontab.XX… ]

When you save the above temporary file with :wq, it will save the crontab and display the following message indicating the crontab is successfully modified.

~

“crontab.XXXXyjWkHw” 2L, 83C written

crontab: installing new crontab

Edit Root Crontab entries

Login as root user (su – root) and do crontab -e as shown below.

root@dev-db# crontab -e

Edit Other Linux User’s Crontab File entries

To edit crontab entries of other Linux users, login to root and use -u {username} -e as shown below.

root@dev-db# crontab -u sathiya -e

@monthly /home/sathiya/fedora/bin/monthly-backup

00 09-18 * * * /home/sathiya/ubuntu/bin/check-db-status

~

~

~

“/tmp/crontab.XXXXyjWkHw” 2L, 83C

6. Schedule a Job for Every Minute Using Cron.

Ideally you may not have a requirement to schedule a job every minute. But understanding this example will will help you understand the other examples mentioned below in this article.

* * * * * CMD

The * means all the possible unit — i.e every minute of every hour through out the year. More than using this * directly, you will find it very useful in the following cases.

When you specify */5 in minute field means every 5 minutes.

When you specify 0-10/2 in minute field mean every 2 minutes in the first 10 minute.

Thus the above convention can be used for all the other 4 fields.

7. Schedule a Background Cron Job For Every 10 Minutes.

Use the following, if you want to check the disk space every 10 minutes.

*/10 * * * * /home/ramesh/check-disk-space

It executes the specified command check-disk-space every 10 minutes through out the year. But you may have a requirement of executing the command only during office hours or vice versa. The above examples shows how to do those things.

Instead of specifying values in the 5 fields, we can specify it using a single keyword as mentioned below.

There are special cases in which instead of the above 5 fields you can use @ followed by a keyword — such as reboot, midnight, yearly, hourly.

Table: Cron special keywords and its meaning

Keyword Equivalent

@yearly 0 0 1 1 *

@daily 0 0 * * *

@hourly 0 * * * *

@reboot Run at startup.

8. Schedule a Job For First Minute of Every Year using @yearly

If you want a job to be executed on the first minute of every year, then you can use the @yearly cron keyword as shown below.

This will execute the system annual maintenance using annual-maintenance shell script at 00:00 on Jan 1st for every year.

@yearly /home/ramesh/red-hat/bin/annual-maintenance

9. Schedule a Cron Job Beginning of Every Month using @monthly

It is as similar as the @yearly as above. But executes the command monthly once using @monthly cron keyword.

This will execute the shell script tape-backup at 00:00 on 1st of every month.

@monthly /home/ramesh/suse/bin/tape-backup

10. Schedule a Background Job Every Day using @daily

Using the @daily cron keyword, this will do a daily log file cleanup using cleanup-logs shell scriptat 00:00 on every day.

@daily /home/ramesh/arch-linux/bin/cleanup-logs “day started”

11. How to Execute a Linux Command After Every Reboot using @reboot?

Using the @reboot cron keyword, this will execute the specified command once after the machine got booted every time.

@reboot CMD

12. How to Disable/Redirect the Crontab Mail Output using MAIL keyword?

By default crontab sends the job output to the user who scheduled the job. If you want to redirect the output to a specific user, add or update the MAIL variable in the crontab as shown below.

ramesh@dev-db$ crontab -l

MAIL=”ramesh”

@yearly /home/ramesh/annual-maintenance

*/10 * * * * /home/ramesh/check-disk-space

[Note: Crontab of the current logged in user with MAIL variable]

If you wanted the mail not to be sent to anywhere, i.e to stop the crontab output to be emailed, add or update the MAIL variable in the crontab as shown below.

MAIL=””

13. How to Execute a Linux Cron Jobs Every Second Using Crontab.

You cannot schedule a every-second cronjob. Because in cron the minimum unit you can specify is minute. In a typical scenario, there is no reason for most of us to run any job every second in the system.

14. Specify PATH Variable in the Crontab

All the above examples we specified absolute path of the Linux command or the shell-script that needs to be executed.

For example, instead of specifying /home/ramesh/tape-backup, if you want to just specify tape-backup, then add the path /home/ramesh to the PATH variable in the crontab as shown below.

ramesh@dev-db$ crontab -l

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/home/ramesh

@yearly annual-maintenance

*/10 * * * * check-disk-space

[Note: Crontab of the current logged in user with PATH variable]

15. Installing Crontab From a Cron File

Instead of directly editing the crontab file, you can also add all the entries to a cron-file first. Once you have all thoese entries in the file, you can upload or install them to the cron as shown below.

ramesh@dev-db$ crontab -l

no crontab for ramesh

$ cat cron-file.txt

@yearly /home/ramesh/annual-maintenance

*/10 * * * * /home/ramesh/check-disk-space

ramesh@dev-db$ crontab cron-file.txt

ramesh@dev-db$ crontab -l

@yearly /home/ramesh/annual-maintenance

*/10 * * * * /home/ramesh/check-disk-space

Note: This will install the cron-file.txt to your crontab, which will also remove your old cron entries. So, please be careful while uploading cron entries from a cron-file.txt.

Leave a comment

Filed under COMPUTER, GENERAL INFO, UBUNTU

HHVM – An Open Source PHP Virtual Machine Developed By Facebook

HHVM, stands for HipHop Virtual Machine, is an open source virtual machine developed by Facebook development team. It is designed for executing massive amount of codes written in Hack and PHP languages. HHVM gives superior performance, and improves the efficiency of PHP execution, and increases the productivity for the developers. The developers says that compared with the regular Zend PHP 5.2 engine + APC, HHVM has realized over a 9x increase in web request throughput and over a 5x reduction in memory consumption for Facebook. This is how Facebook handling millions of active users everyday. According to this blog, the wordpress sites running with HHVM delivers better overall performance, approximately 63%, than the websites which are running using traditional LAMP stack (Apache, MySQL, and PHP). Sounds awesome? Indeed!

HHVM will work on all modern operating systems such as GNU/Linux, Windows, and Mac OS.

HHVM has many features including the following:

  • The Hack Language;
  • JIT Compilation;
  • HNI;
  • FastCGI support;
  • Increasing PHP5 Parity;
  • hphpd debugger;
  • … and more.

Well, let us see how to install it on a Linux system.

Installing HHVM On Ubuntu 14.04

Run the following commands to add HHVM repository, and install hhvm package.

wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
echo deb http://dl.hhvm.com/ubuntu trusty main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm

For other distribution’s installation instructions, please refer the official page given in the bottom this article.

After the installation has finished, you may get the following result.

In my Ubuntu 14.04 server, I got the following result.

[...]

* HHVM is installed.
* 
* Running PHP web scripts with HHVM is done by having your webserver talk to HHVM
* over FastCGI. Install nginx or Apache, and then:
* $ sudo /usr/share/hhvm/install_fastcgi.sh
* $ sudo /etc/init.d/hhvm restart
* (if using nginx)  $ sudo /etc/init.d/nginx restart
* (if using apache) $ sudo /etc/init.d/apache restart
* 
* Detailed FastCGI directions are online at:
* https://github.com/facebook/hhvm/wiki/FastCGI
* 
* If you're using HHVM to run web scripts, you probably want it to start at boot:
* $ sudo update-rc.d hhvm defaults
* 
* Running command-line scripts with HHVM requires no special setup:
* $ hhvm whatever.php
* 
* You can use HHVM for /usr/bin/php even if you have php-cli installed:
* $ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60
********************************************************************
Setting up libpaper-utils (1.1.24+nmu2ubuntu3) ...
Processing triggers for libc-bin (2.19-0ubuntu6.1) ...

As you see in the above result, HHVM gives us the script to install and configure FastCGI for our webserver.

For example, If you use apache web server, then run the following commands:

sudo /usr/share/hhvm/install_fastcgi.sh
sudo /etc/init.d/hhvm restart
sudo /etc/init.d/apache restart

For nginx web server, run the following commands:

sudo /usr/share/hhvm/install_fastcgi.sh
sudo /etc/init.d/hhvm restart
sudo /etc/init.d/nginx restart

If you want to start hhvm service automatically on ever reboot, run the following command:

sudo update-rc.d hhvm defaults

Now, check whether HHVM is installed properly by running the following command.

hhvm -a

Oops! You might get the following error.

hhvm: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory

To fix this error, install the missing dependency package “libgmp10″ by entering the following command:

sudo apt-get install libgmp10

Then, restart the hhvm service:

sudo service hhvm restart

You should be able to see something like this:

hhvm -a
Welcome to HipHop Debugger!
Type "help" or "?" for a complete list of commands.

Note: no server specified, debugging local scripts only.
If you want to connect to a server, launch with "-h" or use:
  [m]achine [c]onnect <servername>

hphpd> 

Type quit to return back to your Terminal session.

The following command shows you how to use hhvm.

 hhvm --help

Sample output:

Usage:

   hhvm [-m <mode>] [<options>] [<arg1>] [<arg2>] ...

Options:
  --help                                display this message
  --version                             display version number
  --php                                 emulate the standard php command line
  --compiler-id                         display the git hash for the compiler
  --repo-schema                         display the repository schema id
  -m [ --mode ] arg (=run)              run | debug (d) | server (s) | daemon |
                                        replay | translate (t)
  -a [ --interactive ]                  Shortcut for --mode debug
  -c [ --config ] arg                   load specified config file
  -v [ --config-value ] arg             individual configuration string in a 
                                        format of name=value, where name can be
                                        any valid configuration for a config 
                                        file
  -d [ --define ] arg                   define an ini setting in the same 
                                        format ( foo[=bar] ) as provided in a 
                                        .ini file
  --no-config                           don't use the default php.ini
  -p [ --port ] arg (=-1)               start an HTTP server at specified port
  --port-fd arg (=-1)                   use specified fd instead of creating a 
                                        socket
  --ssl-port-fd arg (=-1)               use specified fd for SSL instead of 
                                        creating a socket
  --admin-port arg (=-1)                start admin listener at specified port
  --debug-config arg                    load specified debugger config file
  -h [ --debug-host ] [=arg(=localhost)]
                                        connect to debugger server at specified
                                        address
  --debug-port arg (=-1)                connect to debugger server at specified
                                        port
  --debug-extension arg                 PHP file that extends command 'arg'
  --debug-cmd arg                       executes this debugger command and 
                                        returns its output in stdout
  --debug-sandbox arg (=default)        initial sandbox to attach to when 
                                        debugger is started
  -u [ --user ] arg                     run server under this user account
  -f [ --file ] arg                     execute specified file
  -l [ --lint ] arg                     lint specified file
  -w [ --show ] arg                     output specified file and do nothing 
                                        else
  --temp-file                           file specified is temporary and removed
                                        after execution
  --count arg (=1)                      how many times to repeat execution
  --no-safe-access-check arg (=0)       whether to ignore safe file access 
                                        check
  --arg arg                             arguments
  --extra-header arg                    extra-header to add to log lines
  --build-id arg                        unique identifier of compiled server 
                                        code
  --instance-id arg                     unique identifier of server instance
  --xhprof-flags arg (=0)               Set XHProf flags

Testing PHP scripts using HHVM

Let us create a sample php scrip called “unixmen.php”.

vi unixmen.php

Add the following lines:

<?php

echo "HHVM is working\n";

Save and close the file.

Run the following command to test the script.

hhvm unixmen.php

Sample output:

HHVM is working

Configuring HHVM in the FastCGI mode with Apache Web server

As of version 3.0, HHVM no longer supports the built-in webserver, You should use your own webserver (nginx or apache) talking to HHVM over fastcgi.

First install apache web server in Ubuntu server as shown below.

sudo apt-get install apache2 -y

To check whether the apache is working, open up your web browser, and navigate to the URL http://ip-address. You may see the following like screen.

Apache2 Ubuntu Default Page: It works - Mozilla Firefox_001

Now, enter the following commands to configure HHVM in the FastCGI mode with apache web server.

sudo /usr/share/hhvm/install_fastcgi.sh
sudo /etc/init.d/hhvm restart

HHVM will be automatically configured for apache server, so you don’t have to do anything. You may notice that the php.ini, and server.ini files have been created automatically under the directory /etc/hhvm/.

sudo cat /etc/hhvm/php.ini

Sample output:

; php options

; hhvm specific 
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
sudo cat /etc/hhvm/server.ini

Sample output:

; php options

pid = /var/run/hhvm/pid

; hhvm specific 

hhvm.server.port = 9000
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc

Configuring HHVM in the FastCGI mode with nginx Web server

Install nginx package:

sudo apt-get install nginx

To check whether the nginx server is working, open up your web browser, and navigate to the URL http://ip-address. You may see the following like screen.

Welcome to nginx! - Mozilla Firefox_002

Now, enter the following commands to configure HHVM in the FastCGI mode with nginx web server.

sudo /usr/share/hhvm/install_fastcgi.sh
sudo /etc/init.d/hhvm restart

HHVM will be automatically configured for nginx. You may see the hhvm.conf will be created automatically.

Let us check the contents of hhvm.conf file.

sudo cat /etc/nginx/hhvm.conf

Sample output:

location ~ \.(hh|php)$ {
    fastcgi_keep_conn on;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

If you have used php-fpm before, the above lines will look familiar to you.

Also, check /etc/nginx/sites-available/default file to verify whether this hhvm.conf has been included.

sudo cat /etc/nginx/sites-available/default

Sample output:

Scroll down to the server derivative. You should the file hhvm.conf has been included already.

[...]
server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;
    include hhvm.conf;
[...]

That’s it. Cheers!

Source & Reference link:

Leave a comment

Filed under COMPUTER, Development, GENERAL INFO, PHP, UBUNTU

Upgrade To Firefox 30 On Ubuntu via Official Repository

Users wanting to upgrade can to via the terminal or Synaptic.

From Terminal.

sudo apt-get update
sudo apt-get install firefox

firefox_from_terminal

Using Synaptic

Launch Synaptic

Refresh package for latest updates.

Search for Firefox

Right click on firefox and Select Mark for upgrade.

Mark_Firefox_for_upgrade

Apply changes.

apply changes

wait for download and upgrade.

firefox_upgrade_2

You’re done.

Leave a comment

Filed under GENERAL INFO, UBUNTU

How To Upgrade Ubuntu 14.04 Trusty To Ubuntu 14.10 Utopic

Do you want to upgrade to Ubuntu 14.10 from Ubuntu 14.04/13.10/13,04/12,10/12.04, or older version on your system? Just follow the simple steps given below. Please note that you can’t directly upgrade from 13.10 to 14.04. First, you should upgrade from 13.10 to 14.04, and then upgrade from 14.04 to 14.10. Clear? Good. Now, Let us start the upgrade process.

Though, the steps provided below are compatible for Ubuntu 14.10, It might work for other Ubuntu derivatives such as Lubuntu 14.10, Kubuntu 14.10, and Xubuntu 14.10 as well.

Important: Before upgrading, don’t forget to backup your important data to any external device like USB hdd or CD/DVD.

Desktop Upgrade

Before going to upgrade, we need to update the system. Open up the Terminal and enter the following commands.

sudo apt-get update && sudo apt-get dist-upgrade

The above command will download and install the available latest packages.

Reboot your system to finish installing updates.

Now, enter the following command to upgrade to new available version.

sudo update-manager -d

Software Updater will show up and search for the new release.

After a few seconds, you will see a screen like below that saying: “However, Ubuntu 14.10 is available now (you have 14.04)”. Click on the button Upgrade to start upgrading to Ubuntu 14.10.

Software Updater_001

The Software Updater will ask you to confirm still you want to upgrade. Click Start Upgrade to begin installing Ubuntu 14.10.

Release Notes_002

Please Note: This is a beta release. Do not install it on production systems. The final stable version will be released in a couple of hours.

Now, the Software Updater will prepare to start setting up new software channels.

Distribution Upgrade_003

After a few minutes, the software updater will notify you the details the number of packages are going to be removed, and number of packages are going to be installed. Click Start upgrade to continue. Make sure you have good and stable Internet connection.

Untitled window_004

Now, the updater will start to getting new packages. It will take a while depending upon your Internet connection speed.

Distribution Upgrade_005

Distribution Upgrade_001

After a while, you’ll be asked to remove unnecessary applications. Finally, click Restart to complete the upgrade.

Congratulations! Now, you have successfully upgraded to Ubuntu 14.10.

Details_002

That’s it.. Start using the new Ubuntu version.

Server Upgrade

To upgrade from Ubuntu 14.04 server to Ubuntu 14.10 server, do the following steps.

Install the update-manager-core package if it is not already installed:

sudo apt-get install update-manager-core

Edit the file /etc/update-manager/release-upgrades,

sudo nano /etc/update-manager/release-upgrades

and set Prompt=normal or Prompt=lts as shown below.

# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
#  never  - Never check for a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the release that immediately succeeds the currently-running
#           release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that this option should not be
#           used if the currently-running release is not itself an LTS
#           release, since in that case the upgrader won't be able to
#           determine if a newer release is available.
Prompt=normal

Now, it is time to upgrade your server system to latest version using the following command:

sudo do-release-upgrade -d

Follow the on-screen instructions. You’re done!!.

Cheers!!

Leave a comment

Filed under COMPUTER, GENERAL INFO, UBUNTU

Install Skype On Ubuntu 14.10/14.04/12.04

Skype is a popular free voice over IP and instant messenger that can be used to text, video and voice calls over Internet. We can send Instant messages, Video messages,a and share files and videos to our friends and families from anywhere in the world. Also, we can call to landline and other mobile phones with competitive prices. Skype supports Windows, Mac, Linux, and many mobile devices such as Blackberry, Android, iOS, Windows phones, Tablets, and Smartphones as well.

Install Skype On Ubuntu 14.10/14.04/12.04

Prior to version Skype 4.3, it was available as binary file, so that users can only download the binary file from it’s official and install it manually. But, as of version 4.3, Skype is available in the Canonical Partners repository.

To enable the Canonical Partners repository, go to Software & Updates from Unity dash. Navigate to Other Software tab, and enable Canonical Partners repository.

Software & Updates_001

Click Close, and Reload buttons to update the cache.

Then, type the following command before installing skype

sudo apt-get update

Then, type the following command to install Skype.

sudo apt-get install skype

That’s it. Open Skype, and log in to your Skype account and stat chatting.

Skype™ 4.3 for Linux_002

Cheers!!

Leave a comment

Filed under COMPUTER, GENERAL INFO, UBUNTU

Fix Windows 8 (Dual Boot) NTFS Partition Mount Failure In Ubuntu

Below is error message viewed when you try mounting NTFS partitions:

no_no

Error mounting /dev/sda3 at /media/elliot/Data: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda3" "/media/elliot/Data"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sda3': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.

Reasons

After series of searches, reasons for this were

1. Windows didn’t shutdown properly or has been hibernated.

2. Fast start up has been enabled in Windows 8 (this is by default)

Solutions

1. Reboot Windows and then boot into Ubuntu.

2. Disable fast start up in Windows 8, by navigating to Control Panel –> Hardware and Sound –> Power Options –> System Setting –> Select What the power buttons does and un-check the Turn on fast startup.

You should be able to access you NTFS partitions now.

Leave a comment

Filed under COMPUTER, GENERAL INFO, UBUNTU, WINDOWS