User Tools

Site Tools


foss:wikishelf

Free software wikishelf / Wikiothèque sur des logiciels libres

This wikishelf is a collection of guides of Free (libre) software.

General

  • Power management: this section introduce power management on Linux. It includes insight about how the power is managed under Linux and also guide to optimise it (hopefully saving battery and energy consumption). It was first written for Ubuntu, but it is enough generic to be applicable for most Linux systems when using the Gnome desktop environment. I hope to extend it to KDE one day (I would need to have a bigger hard disk to install KDE by then…)

Linux Kernel

This section should described what is the Linux Kernel, and there should be many sub-sections with relevant information.

Sub sections

Storage Administration

Some tricks for Linux efficient and safe storage.

In the following examples, I had 2 HDD of 320GB with exactly the same partionning of 4 partitions of 512MB, 6GB, 64GB and the rest. With this I created a /boot partition on top of RAID1 (note that it is then usefull to install grub on both disks, in my case on sda and sdb), a swap on top of RAID0, a /home using BTRFS and finally the rest was mounted on top of a RAID1 partition + LVM.

Creation of the RAID devices:

sudo mdadm --create /dev/md0 --metadata=1.0 --raid-devices=2 --level=1 --name=boot /dev/sda1 /dev/sdb1
sudo mdadm --create /dev/md1 --metadata=1.2 --raid-devices=2 --level=0 --name=swap /dev/sda2 /dev/sdb2
sudo mdadm --create /dev/md2 --metadata=1.2 --raid-devices=2 --level=0 --name=home /dev/sda3 /dev/sdb3
sudo mdadm --detail --scan >> /etc/mdadm.conf

Note that only the RAID1 device is structured around “chunks” which are not applicable to RAID1. However, mkswap (the swap creation tool) does not allow to optimise for the chunk.

sudo mkfs.ext4 -b 4096 -v -m .02 /dev/md0
sudo mkswap /dev/md1
sudo pvcreate /dev/md2
sudo vgcreate vgroot /dev/md2
sudo lvcreate -l 100%FREE --name lvroot vgroot
sudo mkfs.ext4 -b 4096 -v -m .1 /dev/mapper/vgroot-lvroot
sudo mkfs.btrfs -f -m raid1 -d raid1 -O raid56 /dev/sda4 /dev/sdb4

Now it is just a matter of launching the Ubuntu installation and to not partition but simply to choose which partition should be used for which purpose.

Note that I would have prefer to have the root filesystem under BTRFS instead of RAID1+LVM+ext4 but I had too many boot problems (due most for to the Nvidia video card with poor driver support under Linux, but having BTRFS on top causing some troubles was just too much!) ;-)

Alternatives: put / and /home under BTRFS in different volumes (it is assumed that the partition sda3 and sda4 have been merged, and similarly on sdb).

mkfs.btrfs -f -m raid1 -d raid1 -O raid56 /dev/sda3 /dev/sdb3
mount -t btrfs -o compress,space_cache /dev/sda3 /mnt/
cd /mnt
btrfs subvolume create root-20140814
btrfs subvolume create home-20140814
cd
umount /mnt

Version control

I have played a lot from 2000 until 2004 with CVS at work (though now we use Subversion, but via an Eclipse plug-in so I don't really know it).

However, I discovered recently Bazaar which is used a lot by the Ubuntu devs. Both CVS and Bazaar are version control system (VCS), though the later is decentralised as opposed to the former which is centralised.

And today, I'm using Git at work, and I want to share the knowledge I'm gathering on this VCS system.

Sub sections:

Security

Encryption: public/private key

FIXME

Encryption: GnuPG

FIXME

Encryption: Seahorse

FIXME

Passwords safety

FIXME

Network

Basic network administration

Changing the hostname

Changing the hostname requires to execute the following command lines:

$ sudo /bin/hostname <new-hostname>
$ sudo echo -n <new-hostname> > /etc/hostname
$ sudo vi /etc/hosts

The last line is using the command line editor named vi, you can choose to use the more user-friendly nano or a graphical version like gedit. In the file /etc/hosts, you have to look for a line with the old hostname, and replace it by the new hostname.

You can now restart the network:

$ sudo service networking restart

Samba network service

Sharing directories and printers

Samba is a network service that allow computer to exchange data using the SMB/CIFS protocol. This protocol was designed by Microsoft for its systems, thus Samba allow other OS to communicate with Windows computers. As other OS are using Samba or similar implementation, one can exchange data with almost every computers (including *BSD, Mac OS X, etc.)
It is pretty easy to set-up Samba on GNU/Linux.

Sharing Directories

There are two ways you can share directories. You can either only use the graphical user interface and tools provided by Ubuntu, or you can use a more generic way (works with all Linux flavour and desktop environment) by editing the configuration file:

Sharing Printers

Samba can share printers too. However, for the moment I have no guide for it. Especially because I do not have a printer.

Mounting network share (SMB/CIFS)

» Main article: Guide to Samba manual mount

The previous article was explaining how to share a directory on Linux using Samba so that other network machine can access it. The above guide is about connecting to an external network share and making this connection persistent. A kind of “network hard disk” in the Windows terminology.

SSH

Various guides concerning SSH and its features. Mainly based on the OpenSSH software suite. Those articles have been tested extensively on Linux (esp. Ubuntu), though some have been tested on other POSIX systems like OpenSolaris or Mac OS X.

Zeroconf

  • Zero configuration network (zeroconf) is a specification that want to seamlessly interconnect machines and interoperate services, without user deep knowledge of them. Its goal is that network should just work.

Building and installing Apache Xerces-C++ 2.x from source

The detailed instruction to build Xerces-C++ version 2.7 and 2.8 is given on the Apache web site. Though, the instructions are incomplete and do not cover the actual installation part. Here, is detailed the instructions for a Linux 32bit configuration, adapt them to your platform using the Apache Xerces-C++ instructions.

$ tar zxvf xerces-c-src_2_7_0.tar.gz
$ cd xerces-c-src_2_7_0
$ export XERCESCROOT=`pwd`
$ cd src/xercesc
$ ./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -rpthread -b32 -P/usr/local
$ make
$ sudo XERCESCROOT=$XERCESCROOT make install

The last line is a bit weird, but sudo will “lose” the settings of the XERCESCROOT env variable, and thus the installation will fail. The line just create the XERCESCROOT env variable using the one previously define for the user session. This is a necessary step for a successful installation.

If you do not have sudo, you can execute instead of the last line the following:

$ su
# export XERCESCROOT=`pwd`/../..
# make install
# exit

Virtualization

KVM

I'm using virt-manager to create, launch and maintain 2 VMs on my little HP MicroServer. This MicroServer is running a dual-core AMD Turion CPU with AMD-V instructions but no IO-MMU (or AMD-VI), it was upgraded with 8GB RAM and a second Gigabit NIC with 2 Ethernet ports.

I have the host using one NIC port, and each VM is using a dedicated NIC port using MacVTap. Either because I'm using kernel 3.19 on the host or because I have each VM with a dedicated NIC, but host is able to communicate with the guests using this configuratino.

To make this work, I've done the following configurations.

Host Configuration

The host is running Ubuntu 15.04 and I have the file /etc/network/interfaces with the following configuration (Note: em1 is used by the host and p1p1 and p1p2 are used by the VMs):

auto em1 p1p1 p1p2
iface em1 inet dhcp
iface p1p1 inet manual
iface p1p2 inet manual

This brings up automatically on boot the 3 NICs but only assign an IP to the one used by the host.

VMs Configuration

The VMs configuration in virt-manager are using a NIC based on MacVTap with VEPA and virtio. The guest OSes are using simply dhcp on the network interface (eth0 in my case).

If you feel like editing the XML configuration directly, simply add anew interface in the <devices> section:

    <interface type='direct'>
      <source dev='p1p1' mode='vepa'/>
      <model type='virtio'/>
    </interface>

Ubuntu specific articles

A page dedicated to Ubuntu-related articles is available.

foss/wikishelf.txt · Last modified: 2015/07/14 22:05 by Jean-Christophe Berthon