Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

July 29, 2017

vnstat : Recovering from error "Invalid database daily date order"

I use vnstat to keep track of the network traffic statistics in my Fedora system. Through a web interface, it can show some nice charts. Couple of weeks ago when I was trying to see the stats, it was not loading properly. I initially suspected SELinux but executing vnstat from command line proved that there was some problem with vnstat itself. I got the error "Error: enp1s0: Invalid database daily date order: 1494518195 (3) < 1509896072 (4)"
I couldn't find anything helpful to resolve the issue. All I could do was to downgrade vnstat to previous version. As I have configured dnf to retain the cache, the downgrade was bit easy. The downside was that whenever I was updating the system, I had to pass -x vnstat to dnf command so that it will skip updating it.

From the time stamps that appeared in the error message, I thought that the date format was flipped and instead of May-11, Nov-5 was entered in the database creating the problem. The vnstat database is a binary one but vnstat supports exporting and importing the database. Reading the vnstat manual page gave enough information to export and import the data to a new database.

The following steps were taken to export the data from old database, fix it and then import it to new database.

Create a local configuration file for vnstat.
Copy the /etc/vnstat.conf to a local folder and change the DatabaseDir to point to that local folder.

Copy the vnstat database to the local directory. Export the data file using the command

vnstat -i wlp3s0 --exportdb > wlp3s0.db 
 
Update the incorrect time stamps in the exported file.
For example, date -d "2017-05-21" "+%s" will give the time stamp in required format.

Create a new db

vnstat --config ./vnstat.conf  --create -i wlp3s0

Import the modified data

vnstat --config ./vnstat.conf  -i wlp3s0 --importdb wlp3s0.db --force
 
Check the correctness day / month wise data

vnstat --config ./vnstat.conf  -i wlp3s0 -d 
vnstat --config ./vnstat.conf  -i wlp3s0 -m

Stop vnstat and copy the new file to /var/lib/vnstat

sudo systemctl stop vnstat.service
sudo cp ~/vnstat/wlp3s0 /var/lib/vnstat

Update vnstat using sudo dnf upgrade vnstat. I could see that the new version of vnstat was working without problem with the updated db. Started the vnstat using sudo systemctl start vnstat.service and vnstat was back in action.

The downside was that the data for almost two months were not captured by vnstat. My weekly backup was not configured to capture this data. Lesson learned and I quickly set up an automated backup for the dynamic files using anacron. However, I am yet to figure out a way to validate the sanity of the dynamic data.

March 15, 2014

MiniDLNA : a lightweight DLNA/UPnP server for Linux

I used to use XBMC to stream videos from my Fedora system to my Andorid phone and Tablet. Of late I started to think that XBMC was little too much for streaming videos and started to look for alternatives. Few days back I found MiniDLNA, a light weight DLNA server. The installation and configuration in Fedora was pretty simple and it was up and running in no time.
Here are the installation/configuration steps I followed.
Install the MiniDLNA

sudo yum install minidlna

Minor changes are required in /etc/minidlna.conf to configure the server. I had to change the values for the following parameters in the /etc/minidlna.conf

network_interface=em1
port=8200
user=minidlna
media_dir=/xxx/yyy/zzzz # More media directories will need multiple media_dir entries.
friendly_name=MiniDLNA

Open up the port 8200 in firewall and the configuration is done.
Start the miniDLNA server as follows :

sudo systemctl start minidlna.service

Fire up your favorite DLNA/UPnP client from the mobile device (I use UPnPlay) and enjoy the videos.

March 4, 2014

KDE Connect

Updated KDE connect to the latest version (https://play.google.com/store/apps/details?id=org.kde.kdeconnect_tp)
For the new features, the latest desktop client in KDE need to be built from source. The source code is available at : git://anongit.kde.org/kdeconnect-kde

The new version support browsing the device SD card contents from KDE. Loading the folders take a bit of time, but once loaded it browsing through the folders are reasonably fast.

In the previous version I was unable to sync the clipboards if the text was not English. This version does not have that limitation.

A must have application if you use KDE.

January 3, 2014

kde-connect

Successfully connected Android 2.3 to KDE/Fedora. Multimedia remote control from phone work like a charm with Clementine. :)

December 18, 2013

Fedora 20 installation

Fedora 20 was released yesterday and I managed to download the DVD by this morning. Pretty soon I found myself installing it in a virtual machine.

The installation procedure was mostly smooth. Few annoyances from Fedora 19 still lingers. When I was installing Fedora 19 for the first time, I clicked "Installation Destination" expecting to see some mechanisms to partition the disk; couldn't find it there. You have to click "Done" to see that - not very intuitive. The story is no different in Fedora 20. You can partition it either automatically or manually once you get that screen.

The software selection is still a bit of disappointment. There are some pre-configured profiles/environments/settings. It is difficult to customize the software selection from here. I guess I need to try this part once again to see how selecting software from different profiles/environments works. Since I use KDE, went with KDE Plasma Workspaces. I remember selecting Firefox somewhere but it was not installed!

The installation process went through without problems. However it took a while (about 10 to 15mins) in the post-installation setup tasks though - may be because it was running in VirtualBox.

After a reboot, I was able to log in to KDE (4.11.3).  Within few minutes of logging in, package kit told me that updates were available for 177 packages :)

Didn't try the new installation much, but will be testing it bit more in the coming days.














May 4, 2012

One of the reasons why I stick with Fedora



The delta rpm feature of yum reduces the amount of data download for updates.
Total download size: 97 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta | 889 kB 00:24
Processing delta metadata
Download delta size: 4.3 M
...
...
Finishing rebuild of rpms, from deltarpms
<locally rebuilding deltarpms> | 95 MB 00:37
Presto reduced the update size by 96% (from 95 M to 4.3 M).