LANRecently, I acquired a Raspberry and configured a small server at home with Ubuntu server. I also purchased a domain name, contracted a fixed IP with my provider, opened a ssh port and started being able to access my home server from anywhere.

But I noticed I was not able to access my server using the domain name when I was connected to my local network. For instance from a tablet, a cell phone or another computer connected through Wifi in my local network. I think this is so because the local network router assigns an IP address to the server which is different from the fixed IP address associated with the domain name.

This could be easily solved by assigning domain names to local IPs in the router configuration, but it turned out that my Internet provider blocks this in the routers they install. The reason is to avoid people changing their DNS (Domain Name Server) and creating issues for them to solve. So I had to think of a way to create an alternative DNS within my local network.

A possible way of doing it is to define the DNS assignment in each device connected to the LAN. This is not practical, and for some type of devices it is not trivial (for instance for Android devices).

Looking at the alternatives, I read that what it has to be done is to have a DHCP server at a  another device different from the router, and do the domain name assignments there. In my case the obvious candidate was the server installed in the Raspberry. I saw there were two packages that provide a DHCP server, isc-dhcp-server and dnsmasq. There is also bind, which is more complete, but it is more complex to configure, so I tried to avoid using it.

unisonUnison is a tool to synchronize files and directories between different systems or within the same system. It can also be done between different platforms, for instance between a Linux computer and another computer with a different operating system, since it is a multi-platform program which is available for the best known operating systems.

An important point to understand is that it is not a backup tool. For instance if a file is deleted in one of the two replicas, it will be also deleted in the other one, since the diea is to maintain the two copies synchronized. If there are conflicts, for instance if a file has been modified in different ways in each of the replicas, unison will allow to reconcile the conflict, choosing one of the two versions over the other one.

It may have different applications, In my case, I use it to keep the computer that I have at home (and on the move, since it is a laptop) synchronized with the computer that I have in my office, which is a desktop computer. In this way, when I have to work at home I have to simply synchronize the laptop, and when I finish working at home I have to synchronize again so that my office computer is updated with the work I did at home. In principle, more than one computer could be kept synchronized, choosing in this case a reference computer and synchronizing the other computers against this one. I have used this system to keep a tablet and the laptop synchronized with the office computer.

SwapSince a couple of years ago, Linux distributions use a swap file (to exchange with Ram memory when it is exhausted or to hibernate the system) instead of a swap partition. If, like I do, instead of clean installing version upgrading is used, it is possible that the system still uses the swap partition. In may case I use Ubuntu and both for the desktop and the laptop computers the first installation was done more than 3 years ago, and afterwards I upgraded the system several times. In this article it is shown how to convert a Swap partition to a a Swap file.

We first disable the swap:

sudo swapoff -a

Next, we create the swap file. The recommended size can be found in the table shown in this link:

https://help.ubuntu.com/community/SwapFaq

The following command will create the swapfile:

sudo fallocate -l 3G /swapfile

This creates a swap file of 3Gb, which has to be adjusted for each system. This creates the file in the root of the system (/) but it can be changed if not enough space is available at this partition.

Next, we restrict the file permisions:

sudo chmod 600 /swapfile

Only "root" will be able to write and read this file. We now dedicate this file to swap:

sudo mkswap /swapfile

Last, we have to assure that the swap file is mounted each time the system starts:

Conky is a program that shows information at the computer desktop, like weather or system information. With version 1.11.6, which is the version that comes with Ubuntu 20.10, the configuration script has changed its format to lua. This makes all conky with the old configuration unusable.

The change in format is good, because the syntax of the  old format was quite inconsistent. The new format is more structured and clear. For instance these were the first lines of my configuration with the old format:

gap_x -620

gap_y -300

minimum_size 268 680

maximum_width 268

own_window yes

own_window_transparent yes

own_window_hints undecorated,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0

border_outer_margin 0

Now the format looks as follows:

conky.config = {

  gap_x = -1920,

 gap_y = -300,

 minimum_width = 268,

minimum_height = 680,
 
  own_window = true,

own_window_transparent = true,

own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below',

border_inner_margin = 0,

border_outer_margin = 0

};

To change to the new format, fortunately no manual configuration has to be done. There is small program that does the work. First we need to install a couple of things. It is good to make sure that both conky and conky-all are installed:

sudo apt install conky conky-all

rsyncSince many years ago, I use "rsync" to make snapshots of my system and keep backups which are separated from the main system. This, coupled with the synchronization of my different devices (desktop, laptop and tablet) with "unison", which I will explain in another future article, allows me to have all my information updated and be covered of the danger of data lost in case of faulty hardware. In this brief article I will explain my configuration for these snapshot backups. For a more detailed explanation of this system, and possibly a better configuration than mine, please consult this article:

http://www.mikerubel.org/computers/rsync_snapshots/

It is better to follow the above article in order to have all the details of the system and a more robust guide than this article. Here I simply explain how it works for me. It works so well for me and since so many years that I often forget that I have this working in the background.

What does this system get me and what is needed? The system allows me to have copies (snapshots) of the volumes with directories and files that I want with the frequency that I want. For instance, in my case I keep copies of all my data (the whole hard disk) of 1, 2, 3 and 4 hours ago, of 1, 2, 3 and 4 days ago, of 1, 2, 3 and 4 weeks ago, and 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 , 11 and 12 days ago. In other words, I can see exactly what I had in my disk in any of these past moments, or instance 7 months ago. This also is helpful to undo any non-wanted elimination of files or directories. If they existed one hour ago, I have to simply go to the snapshot of one hour ago and recover the erased data.

My daughter asked me recently to convert an audio file that a classmate of hers had created with an Ipad. It was a recording of a class. I looked around for converters and was pointed to Audacity, but it didn't work (it asked me to upload it as raw data, but once uploaded there was no reproducible audio). Other solutions such as "sox" where failing saying that it could not decode the source.

Reading further I seem to have understood that there is still no codec for Linux. I also looked to some free solutions in Windows and I found some, tried one and was also failing.

Then I found out that there is an open code program for the Mac that can be compiled in Ubuntu and that manages to convert the CAF file into a WAV file. THe WAV file can the be converted further to a more compressed format such as ogg or mp3 or anything else. The source for this is:

http://ubuntuforums.org/archive/index.php/t-786095-p-8.html

I just copy from that post, it has worked for me:

Install first the required tools to do the compilation

1. Install some build dependencies:

sudo apt-get install build-essential checkinstall subversion

2. Get the source files with subversion:

svn co http://svn.macosforge.org/repository/alac/trunk alacconvert

3. Get a patch and apply it:

wget https://aur.archlinux.org/packages/al/alacconvert/alacconvert.tar.gz
tar xzvf alacconvert.tar.gz
cd alacconvert/convert-utility
patch -Np0 -i ../move-lflags.patch

4. Compile and install:

The following steps have allowed me to configure the UPF digital card and the card reader.

1) Install some programs that are needed for electronic certification:

sudo apt-get install pcscd pinentry-qt4 opensc  pcsc-tools

2) Follow the steps explained in:

http://www.catcert.cat/descarrega/manuals_guies/Usos_del_certificat_digi...

Note: The library mentioned in the document (with .so extension) can be found in /usr/lib.

3) Edit the file /etc/opensc/opensc.conf and uncomment the line starting with "provider_library".

4) Verify that your system sees the reader and the card: Plug the reader and put the card, it has to be put with the face up on the main face of the reader. Go now to Firefox to the menu Edit -> Preferences -> Advanced -> Security devices (same menu that you used to configure in step 3) and look under the new module that you have added in step 3 and in the first line you should see "UPF".

5) Restart the computer

6) Everything should work now, navigate to:

https://sede.seg-social.gob.es/Sede_1/ServiciosenLinea/Ciudadanos/231443

where you can download your Social Security record. Click over "Acceso al servicio" and keep accepting the certificates, I was able to download my Social Security record.

(UPDATE on November 26, 2011: the weather.com site has changed and  I have updated my scripts so that they still work)

Conky is a free, light-weight system monitor for X, that displays any information on your desktop. Yesterday, after a question I got in an Ubuntu forum, I decided to install it in my Ubuntu 10.10 desktop and laptop computer. It was not easy and I had to go to different forums posts and links, so I decided to write this post on what I did.

My conky setup involves two different sections and occupies quite a bit of the desktop. In the the two monitor setup of my desktop this is not a problem, but in the laptop it has the problem that Conky, despite sitting always below any windows, sits over desktop iconcs, so any icon that you have in the desktop area where conky sits will be hidden by it. I don't use desktop icons too much and the icons can still be accessed by hovering over the conky window with the mouse, but be aware of this if you want to install it.

In my desktop computer I'm using two monitors and I have configured Conky to show in the upper right corner, and it shows in the second screen. In the laptop it's also defined to show up in the upper right corner. I also installed conkyForecast which is a python script to access weather information for conky fed from www.weather.com, an online weather service.

This is how nice it looks in the laptop, with the "comet" background that can be found in /usr/share/backgrounds/cosmos/comet.jpg:

Desktop

The first thing to do is to install conky itself:

sudo apt-get install conky

We will wait to configure conky until we have installed everything for the weather forecast.

Since about a year ago I've lost my open IP in the University network and they forced me to move behind a VPN, with a lot of issues on how to maintain my workflow. But one of the most annoying things of this is that even the most basic things like using ssh or sftp may have new issues that are very hard to debug and for which I don't have any support whatsoever by the IT support staff.

The most recent one that I noticed is that sftp stalls for large files (sometimes after transmitting 10MB, some other times at other places). It took me a while to identify that this was due to the VPN, and then more time to find out what to do while trying different things until I found the solution in this link:

http://serverfault.com/questions/120505/problems-with-scp-stalling-durin...

Basically the problem is that the TCP variable tcp_sack ("tcp selective acknowledgements") has to be disabled in my server behind the VPN. This is done for one session with:

sysctl -w net.ipv4.tcp_sack=0

To disable it permanently edit /etc/sysctl.conf and add the following:

net.ipv4.tcp_sack=0

It seems that talk has been started around the unification of packaging systems for various Linux distributions. There are currently different systems. Maybe the main ones are the Debian system (files with  .deb extension being used among others by Debian, Ubuntu or Mint) and the RPM system (with .rpm extension, being used by RedHat, Fedora, OpenSuse and others), but there are more, for instance the  Pacman system used by Arch Linux.

This creates a big duplication of efforts for packages which at the programming level are in most of the cases developed in an unified way and not separately for each distribution. This also generates an added difficulty for new users since they have to face different styles and formats depending on the distribution they want to try or use.

Therefore the unification around a single packaging system would be a big thing, both for the developers as well as for the users and for Linux in general. There will be always obviously the possibility to continue with alternative packaging systems if any distribution prefers to have its own system, since the disadvantage of unifying the packaging systems is that one of the variety aspects that make Linux attractive would be lost. Now, the conflict arises between the advantages of standardization against the disadvantages of the loss of variation.

It seems also that the Ubuntu Software Center interface is also liked by people of other distributions and they would be thinking of adopting it as the interface of the unified packaging system. Here the problem is the Contributor License Agreement that Canonical (sponsoring firm for Ubuntu) asks all contributors to packages developed by Canonical to sign. This would be an obstacle for this interface to become the common interface, and Canonical would have to detach this package from this license agreement so that it could be considered as a the common interface.

Powered by Drupal

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer