Background Cover

Adding background images to your designs is quite simple. All you need to do is assign CSS background-image to the body of your design. In addition, you can also assign a background color, just in case the background image is not rendered.

body {
    background-image: url("path/to/the/background/image.gif");
    background-color: #cccccc;
}

The code above may have worked in the past, but with 4k and 5k monitors becoming popular nowadays, you need to make sure your background images are big enough to cover the large monitors as well.

To make your background image cover all monitor sizes, you need to use “background-cover.”

body { 
    background-size: cover;
}

Here’s the entire code.

body {
    background-image: url("path/to/the/background/image.gif");
    background-color: #cccccc;
    background-size: cover;
}

Netbeans IDE

I’m currently testing NetBeans IDE for PHP development. You can download Netbeans IDE directly from NetBean’s website. Netbeans IDE is a free and open source IDE or integrated development environment. IDE’s are essentially glorified editors with a bunch tools to make development easier. Tools can vary from built-in functions, code completion, debugger, version control to FTP access. Netbeans has plugins for multiple programming languages such Java, Javascript, PHP, HTML, Ruby in Rails, etc. Java 7 or newer is a prerequisite to make NetBeans work on your computer. You can download Java from here.

Roundcube Install Errors

I ran into several issues with the Roundcube installation on Ubuntu. Roundcube is a browser-based IMAP client that you can install on your server. It’s available from the Ubuntu repository to install. You run this command from the Terminal to install.

Roundcube Install

sudo apt-get install roundcube roundcube-mysql

However, I ran into some issues. The two Roundcube configuration files are main.inc.php and debian.db.php. Both are located in the /etc/roundcube directory. If you have problems receiving or sending mails, it’s worth to take a look at your IMAP and SMTP settings on your /etc/roundcube/main.inc.php file.

Edit the /etc/roundcube/main.inc.php file. Use your own server settings.

sudo nano /etc/roundcube/main.inc.php

IMAP and SMTP Settings

// IMAP server
$rcmail_config['default_host'] = array("ssl://imap.yourmailserver.com");
 
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 993;
 
// SMTP server
$rcmail_config['smtp_server'] = 'ssl://smtp.yourmailserver.com';
 
// SMTP port
$rcmail_config['smtp_port'] = 465;
 
// SMTP username (if required) use %u as the username
$rcmail_config['smtp_user'] = '%u';
 
// SMTP password (if required) use %p as the password
$rcmail_config['smtp_pass'] = '%p';

Use %u and %p if you have multiple accounts.

Database Settings

Make sure your database credentials are correct.

$dbuser='your_username';
$dbpass='your_password';
$basepath='';
$dbname='roundcube';
$dbserver='';
$dbport='';
$dbtype='mysql';

Finally, reboot the Apache server for good measure.

sudo service apache2 restart

Laracasts Black Friday Sale

If you’re a PHP developer, Laravel is all the rage. If you’re new to Laravel and you want to learn how to code, I recommend that you check out Laracasts, a video tutorial website about Laravel. You’ll find a number of free lessons, as well as some paid content.

Since it’s Thanksgiving Day, Laracasts currently has a fire sale. Well, a Black Friday sale to be exact. Laracasts is offering 40% off any type of subscription. You can apply it to a yearly subscription. What a bargain!

Better act soon. The offer will expire November 28 at 11:59pm EST.

Laracasts Black Friday Sale – 40% off any subscription

Linode Linux Package Mirrors

One way to speed up the Linux package updates is to use a package mirror made available by Linode. They are hosted in all six of their data centers. Just pick a data center where your data is Linode server is located by doing the following.

Edit your sources list

sudo nano /etc/apt/sources.list

Search and replace

# Replace this address 
http://us.archive.ubuntu.com/ubuntu/ 
 
# with the new address 
http://fremont.mirrors.linode.com/ubuntu/
 
# you can also use this - returns round robin of all locations
http://mirrors.linode.com/ubuntu/

The next time you run a Linux update, it will be significantly faster.

sudo apt-get update
sudo apt-get upgrade

WordPress Permalinks on Nginx

You’ve abandoned Apache for a faster, newer and sleeker Nginx. Installation was a breeze. WordPress is just humming along until you start clicking links within WordPress. You realized the permalinks are broken, which is a biggie. So, here’s how you fix WordPress permalinks on Nginx.

WordPress on root directory

# Edit nginx config
sudo nano /etc/nginx/sites-available/default
# Add the following lines to the file.
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?args;
}

WordPress in a subdirectory under root

location /wordpress/ {
try_files $uri $uri/ /wordpress/index.php?args;
}

Restart Nginx

# must restart nginx for the changes to take effect
sudo nano service nginx restart

Install MariaDB on Ubuntu

MariaDB is a drop-in replacement for MySQL database. On most cases, you can just uninstall MySQL and install MariaDB and you are good to go. To keep up the two databases compatible, the MariaDB team are doing monthly merges with the MySQL code base making sure new features and fixes are kept up.

Uninstall MySQL

sudo apt-get purge mysql*
sudo apt-get autoremove

Install MariaDB

sudo apt-get install mariadb-server mariadb-client -y

Verify if MariaDB is running

sudo service mysql status

Delete A Symbolic Link

In the Unix world, a symbolic is special type of file that references to another file or directory. Symbolic links are also known to others as symlink or softlink. To create a symbolic link, the ln -s command is used to reference a file to another like below.

sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin

To delete a symbolic link

sudo rm /var/www/phpmyadmin
# or
sudo unlink /var/www/phpmyadmin

Install Nginx on Ubuntu Server

nginx (pronounced engine x) is an HTTP and reverse proxy server written by Igor Sysoev. nginx is gaining traction over the years due to its exceptional speed. The latest Netcraft web survey indicate that 14.42 percent of the Internet of websites runs on Nginx.

If you looking to replace your Apache web server or just want to play around with nginx, here are the really simple instructions on how to install nginx on any Ubuntu Server.

# run update
sudo apt-get update
sudo apt-get upgrade
# install nginx
sudo apt-get install nginx
# start nginx
sudo service nginx start

Open your browser and point it to the IP address of your Ubuntu Server.

You’ll see this if your installation was successful.

nginx-page