If your Ubuntu machine has networking configured but there’s nothing in: /etc/network/interfaces (maybe only loopback interface is configured there) and there’s no file in /etc/network/interfaces.d then maybe the network was configured via Ubuntu’s GUI (Network Manager).
In that case the config file is located in /etc/NetworkManager directory.
Here is a Quick Guide to configure networking in OpenSUSE Linux using manual IPv4.
First let’s see where config files are located.
# ls /etc/sysconfig/network/ifcfg-* /etc/sysconfig/network/ifcfg-eth0 /etc/sysconfig/network/ifcfg-lo linux-t003:/home/ovi #
Edit /etc/sysconfig/network/ifcfg-eth0 file and add:
BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='10.0.1.31/24' MTU='' NAME='82540EM Gigabit Ethernet Controller' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto'
Edit /etc/sysconfig/network/routes file and add:
default 10.0.1.1 - -
Edit /etc/resolv.conf and add:
Then we need to restart network service:
service network restart
Packages required to be able to compile
sudo apt-get install build-essential automake pkg-config checkinstall php5-dev
sudo apt-get install ghostscript libgs-dev libautotrace-dev libpcre3-dev libbz2-dev libdjvulibre-dev libfftw3-dev libgraphviz-dev liblcms2-dev liblqr-1-0-dev libpango1.0-dev libwebp-dev
Directory to use for the sources
1 2 3
sudo chown $USER /usr/local/src ln -s -T /usr/local/src sources cd sources
Compile the latest version of ImageMagick
This quick tutorial shows you how to install MySQL Server and Client on CentOS 6.6 Linux.
First we check if MySQL Server is installed or not:
yum list installed | grep mysql
Then we search for mysql-server on CentOS repositories we added to our machine:
yum search mysql-server
MySQL server is found:
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirrors.ovh.net * epel: epel.mirrors.ovh.net * extras: centos.mirrors.ovh.net * updates: centos.mirrors.ovh.net === N/S Matched: mysql-server === mysql-server.x86_64 : The MySQL server and related files
Now we will install mysql-server:
yum install mysql-server
Let’s install mysql client too (in CentOS mysql package is in fact mysql client):
yum install mysql
At this point MySQL server is installed. Let’s start the server:
service mysqld start
We must add a password for MySQL root user (which is different from system root account):
/usr/bin/mysqladmin -u root password your-new-password
To change MySQL server password if you already configured one run (you need old password):
/usr/bin/mysqladmin -u root -p password your-new-password
To test if password was configured we will connect to our MySQL server using mysql client:
mysql -u root -p
We can also run mysql_secure_installation script which will remove test database and anonymous user created by default.
If you want to configure a static IP on your Ubuntu or Debian from command line, here is what you have to do.
First we will switch login user to root.
Then we will edit /etc/network/interfaces file:
and we will add the following lines:
auto lo iface lo inet loopback auto eth1 iface eth1 inet static address 10.0.0.2 broadcast 10.0.0.255 netmask 255.255.255.0 post-up route add default gw 10.0.0.1 pre-down route del default gw 10.0.0.1 dns-nameservers 10.0.1.1
Last thing to do is to restart network services.
service networking restart
Let’s say we’ve just added a secondary drive to our CentOS Linux machine and we want to add GPT partition table and then create a GPT partition that will fill our disk. In order to do that we will use parted.
First we will install parted package:
yum install parted
Then we will go to parted CLI:
parted -s -a optimal /dev/vdb
There we add GPT partition table (don’t type “(parted)” part, it is the parted CLI prompt):
(parted) mklabel gpt
Then we will create our new partition:
(parted) mkpart primary ext4 1 -1
If we want not to fill entire drive but to make a partition of a let’s say 100G we will run instead:
(parted) mkpart primary ext4 1 300GB
Now we can exit the parted CLI and put a filesystem on our partition:
That’s it. We can just mount the partition.
If you want to disable password authentication and only authenticate with Public/Private keys on a CentOS 6 Linux machine when connecting via ssh here’s what you need to do.
How ssh keys auth works
We have a client an a server. On client we generate a pair of public/private keys. Then we copy the public key to the server in a specific file that will be used by ssh server to recognise the key. Then we configure the sshd server to disable password authentication and only permit public/private key auth.
What is and why use LXC?
LXC is a linux container system that offers an environment as close as possible as of a virtual machine, without emulating any hardware and sharing the same kernel with the host, it is very lightweight and fast.
I prefer to keep the development environment isolated from my main machine. This assures that if everything goes wrong with the development environment, my main machine remains stable, also I can easily backup and test different configurations on the environment. For example I could setup multiple containers with different php versions.
The main objective of this article is to create a container that will behave like an app with a LEMP (Linux, NGINX, MySQL, PHP) stack that I can start and stop just as I would start a WAMP or MAMP app on Windows or OS X. The main machine is Ubuntu 14.04.