Posts Tagged ‘linux’

Articles

Build Boost 1.55 on Linux

In howto on Aug 2, 2016 by theoryl Tagged: , ,

Boost is a very extensive C++ library. To compile + install:

wget http://heanet.dl.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2
tar xz boost_1_55_0.tar.bz2
cd boost_1_55_0
mkdir ../boost
./bootstrap.sh --prefix=../boost
./b2 install
Advertisements

Articles

Ubuntu wakes up immediately after suspend

In howto on Jun 18, 2016 by theoryl Tagged: , , ,

Sometimes when you try to suspend the Ubuntu operating system, it wakes up immediately. This is often because certain devices are in “awake” state. To fix it, first you need to find out which device it is. Do:

acpitool -w

You might see output like the following:

   Device	S-state	  Status   Sysfs node
  ---------------------------------------
  1. P0P1	  S4	*disabled
  2. GLAN	  S4	*disabled
  3. XHC	  S4	*enabled

To disable ‘XHC’, do:

echo 'XHC' > /proc/acpi/wakeup

with superuser privilege.

Typical suspects are USB devices. To find out the USB devices in your system, do:

lspci | grep USB

Articles

Block domains on Linux

In howto on Jun 5, 2016 by theoryl Tagged: ,

It’s easy to block specific domains on Linux. Just open /etc/hosts and append the following lines:

127.0.0.1       facebook.com
127.0.0.1       www.facebook.com

(replace facebook.com by the domain name you wish to block)

Articles

Show network connections on Linux

In howto on May 27, 2016 by theoryl Tagged: ,

If you want to monitor the network traffic on Linux, do:

netstat -ctupW 

Articles

Multiple instances of gThumb on Linux Mint 17

In howto on Mar 15, 2016 by theoryl Tagged: , , , ,

gThumb is my favorite image viewer. However, gThumb 3.2.7 (which comes with Linux Mint 17) has a bug where only one instance of gThumb is allowed. See this bug report. The suggested solution is to use gThumb 3.2.8 which can be grabbed from the Ubuntu 14.10 (Utopic Unicorn) repository.

So, download the .deb files from:
https://launchpad.net/ubuntu/utopic/amd64/libexiv2-13/0.24-2ubuntu1
https://launchpad.net/ubuntu/utopic/amd64/gthumb/3:3.3.1.is.3.2.8-0ubuntu1build1
https://launchpad.net/ubuntu/utopic/amd64/gthumb-data/3:3.3.1.is.3.2.8-0ubuntu1build1

Then, install them:

sudo dpkg -i libexiv2-13_0.24-2ubuntu1_amd64.deb gthumb_3.3.1.is.3.2.8-0ubuntu1build1_amd64.deb gthumb-data_3.3.1.is.3.2.8-0ubuntu1build1_all.deb 

Problem solved. =)

Articles

Install nginx on Ubuntu 14.04

In howto on Jan 30, 2016 by theoryl Tagged: , , , ,

This is yet another guide about how to install nginx on Ubuntu 14.04. nginx is an open source web server that has recently gained popularity. It’s particularly well suited for serving static content.

nginx ver 1.4.6 is available from the official Ubuntu repository, so:

sudo apt-get install nginx

is all you have to do. The configuration file nginx.conf is located at /etc/nginx/nginx.conf. The default configuration is good enough so you don’t have to change anything there. To start serving a static site, just modify /etc/nginx/sites-enabled/default to set the ip address, the root directory, and the domain. See Ubunto nginx doc.

After that, reload nginx by doing either

sudo service nginx reload

or

sudo nginx -s reload

Put an index.html file in the root directory. Then, point your browser to the ip address to see it. Voila!

References:
* Ubuntu nginx doc: https://help.ubuntu.com/community/Nginx
* Official nginx doc: https://www.nginx.com/resources/admin-guide/serving-static-content/
* Introduction to Nginx and LEMP on Ubuntu 14.04 by Justin Ellingwood: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-14-04-lts

Articles

Install VirtualBox and Vagrant on Linux Mint 17.3

In howto on Jan 16, 2016 by theoryl Tagged: , , , , , ,

Another day working with virtual machines, another install log. My host machine is Linux Mint 17.3, based on Ubuntu Linux 14.04. The guest machine I’m planning to use is CentOS 6.7.

Firstly I have to install VirtualBox 5.0. Oracle provides pre-built VirtualBox package to Debian/Ubuntu distros, see here. My installation notes:

# Add /etc/apt/sources.list.d/virtualbox.list
sudo vim /etc/apt/sources.list.d/virtualbox.list

# Ubuntu Trusty
#deb http://download.virtualbox.org/virtualbox/debian trusty contrib

# Add the Oracle public key
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

sudo apt-get update
sudo apt-get install virtualbox-5.0

Secondly I have to install Vagrant by HashiCorp. The latest version is available for download as .deb packages.

# Download
wget https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_SHA256SUMS
wget https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_x86_64.deb

# Verify SHA256 checksums
sha256sum -c vagrant_1.8.1_SHA256SUMS

# Install
sudo dpkg -i vagrant_1.8.1_x86_64.deb

Thirdly, install Packer also by HashiCorp. Download the .zip file that contains the binary programs.

# Download
wget https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip
wget https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_SHA256SUMS

# Verify SHA256 checksums
sha256sum -c packer_0.8.6_SHA256SUMS 

# Unzip
unzip packer_0.8.6_linux_amd64.zip

# Add the executables to $PATH
export PATH=$PATH:$PWD

You can also download pre-built Vagrant boxes from Hashicorp Atlas. For instance, here is an official Ubuntu Server 14.04 LTS image: https://atlas.hashicorp.com/ubuntu/boxes/trusty64