Boot order of systemd services

In the last months I discovered the world of SystemD through two installation and configuration of ArchLinux on two different PCs, and a new product of my company that use SystemD.
At the beginning it seems very strange and difficult, but after some trys I found it very powerful!

Particurarly I discovered the simple way to manage the boot order of the system services to control some action before other (like create a dynamic folder for all the system sockets, before start the services that create that sockets).

To control your service, look for a file called “mySpecialService.service” into folder /lib/systemd/system or /etc/systemd/system.
Open that file using nano, vi or other editor and into that file search for the After parameter into [Unit] session.

Into that parameter you can insert the name of the services required to start before your service, separated by space.

Description=/etc/mySpecialService Compatibility
ConditionFileIsExecutable=/etc/mySpecialService otherService.service

You can do the same with the services that requires your action before start.

After changed these files, run the ENABLE command to configure the system with your new settings:

$ sudo systemctl enable mySpecialService.service

that is the same operation that you done with the older “update-rc.d” on SysVinit systems.

Have a good SystemD configuration! 😉


SMB simple configuration

I write here just a simple guide to enable the SAMBA file sharing on a linux.

First, into /etc/samba/smb.conf
define name of the sharing and path of the folder that you want to share

path = /opt/folder2share
browsable = yes
writable = yes
read only = no
create mask = 0777 # Permissions of file inside

If you want to restrict the write permissions, just change them into that file.

Then, add a local user to access via samba using:

sudo smbpasswd -a user
New SMB password:
Retype new SMB password:

After, just restart the smb process and use it!

command YES

A funny trick discovered today, to automatic answer “yes” or “no” to a package installation using dpkg that require a human interaction during the installation.


# yes Y | dpkg -i mypersonalpackage.deb

You can also set yes N to always answer “NO”, or just yes if is allowed the lowercase answer into the installation.

Good installation! 😉

save locat GIT on remote server

There are many guides about git on remote server, remote repo and so on.
Here I just want to describe a simple procedure if you don’t have enough time to correctly setup the remote repo BEFORE cloning on your local pc, but you should fast start to develop and after many commit you can take a breath and think about remote backup of your local work.

First step:
on the remote server:
$ cd ~/myrepo
$ git init
$ git config receive.denyCurrentBranch ignore

and, on you local pc:
$ cd ~/myrepo
$ git remote add master ssh://<user>@<remoteIP>:/home/<user>/myrepo.git/
$ git push --set-upstream master master

Then, on you remote server you should see your modified files and your commits on git log command.
If not, on the server side, do a
$ git reset --hard
and you’ll find files and commits.

Good versioning!

Skype multiple account

On the last years, the Skype version for Linux seems unchanged, without features or relevant upgrades (and with many bugs…thank you MS..).
For that, a stable procedure to call a secondary instance of your Skype for Linux program is:

$ skype --secondary &

It launch a secondary session, while the first is running.
If you use the notification icons, you can see the two icons of the two instances, and each instance has the status configuration indipendent from the other.


Backup Outlook email folder tree on Thunderbird profile

Hi everybody,

in this period I’m changing job and then I was faced with a big problem: how can I save all Outlook messages and folders?
(I think that can be useful hold with me a backup of work communications and messages for a couple of years.)

So, I looked for some guides to backup all the data but Outlook (my version is 2010) permits to save in *.pst format only, a MS format recognized just from few software and mainly from MS software.
But after many searches on Google I discover these steps to save all messages and structure on Thunderbird:

1. Install Thunderbird version 31 or previous
It is necessary because later versions don’t support the Import of data from Outlook.

2. Import data from Outlook
It could be done by Thunderbird menu Tools->Import->Mail, then select Outlook; and wait that process finish.

3. Install add-on ImportExportTools
ImportExportTools is a useful add-on of Thunderbird to import or export data and profile to/from Thunderbird.
You can found it here

4. Export profile
Using the ImportExportTools menu, you can export the user profile, that means all the structures, folders and messages present in Thunderbird.
Once saved the profile you can move that profile where you want: it is just a special folder tree with special files readable by Thunderbird.

5. Import profile into Thunderbird
To open a saved profile, just open a Thunderbird with ImportExportTools addon installed, and select Tools->ImportExportTools->Import profile, inserting a name for the profile to recognize it after.

6. Open your profile into Thunderbird
If you don’t see your messages recovered, close Thunderbird and reopen by command line, using the command
$ thunderbird -p that opens the window profile selection: here you can select the profile with the name gived and then you should see the recovered messages.


Linux installation data

Sometimes, it could be useful to remember the data of installation of your Linux system, even just to be proud of the long years of life of your Linux distribution without big problems.

A simple way to know that date is with the command:

$ sudo dumpe2fs /dev/sda1 | grep 'Filesystem created'

that shows the date of creation of filesystem, in the indicated partition.

If you are not sure about your the root partition, check it using the disk free command:

$ df -h

the root partition is the one mounted on “/“.

Enjoy! 😉