Posts Tagged ‘simplicity’

Reinstall all Debian packages with a copy of apt deb package list from another working Debian Linux installation

Wednesday, July 29th, 2020

Reinstall-all-Debian-packages-with-copy-of-apt-packages-list-from-another-working-Debian-Linux-installation

Few days ago, in the hurry in the small hours of the night, I've done something extremely stupid. Wanting to move out a .tar.gz binary copy of qmail installation to /var/lib/qmail with all the dependent qmail items instead of extracting to admin user /root directory (/root), I've extracted it to the main Operating system root / directrory.
Not noticing this, I've quickly executed rm -rf var with the idea to delete all directory tree under /root/var just 3 seconds later, I've realized I'm issuing the rm -rf var with the wrong location WITH a root user !!!! Being scared on what I've done, I've quickly pressed CTRL+C to immedately cancel the deletion operation of my /var.

wrong-system-var-rm-linux-dont-do-that-ever-or-your-system-will-end-up-irreversably-damaged

But as you can guess, since the machine has an Slid State Drive drive and SSD memory drive are much more faster in I/O operations than the classical ATA / SATA disks. I was not quick enough to cancel the operation and I've noticed already some part of my /var have been R.I.P-pped in the heaven of directories.

This was ofcourse upsetting so for a while I rethinked the situation to get some ideas on what I can do to recover my system ASAP!!! and I had the idea of course to try to reinstall All my installed .deb debian packages to restore system closest to the normal, before my stupid mistake.

Guess my unpleasent suprise when I have realized dpkg and respectively apt-get apt and aptitude package management tools cannot anymore handle packages as Debian Linux's package dependency database has been damaged due to missing dpkg directory 

 

/var/lib/dpkg 

 

Oh man that was unpleasent, especially since I've installed plenty of stuff that is custom on my Mate based desktop and, generally reinstalling it updating the sytem to the latest Debian security updates etc. will be time consuming and painful process I wanted to omit.

So of course the logical thing to do here was to try to somehow recover somehow a database copy of /var/lib/dpkg  if that was possible, that of course led me to the idea to lookup for a way to recover my /var/lib/dpkg from backup but since I did not maintained any backup copy of my OS anywhere that was not really possible, so anyways I wondered whether dpkg does not keep some kind of database backups somewhere in case if something goes wrong with its database.
This led me to this nice Ubuntu thred which has pointed me to the part of my root rm -rf dpkg db disaster recovery solution.
Luckily .deb package management creators has thought about situation similar to mine and to give the user a restore point for /var/lib/dpkg damaged database

/var/lib/dpkg is periodically backed up in /var/backups

A typical /var/lib/dpkg on Ubuntu and Debian Linux looks like so:
 

hipo@jeremiah:/var/backups$ ls -l /var/lib/dpkg
total 12572
drwxr-xr-x 2 root root    4096 Jul 26 03:22 alternatives
-rw-r–r– 1 root root      11 Oct 14  2017 arch
-rw-r–r– 1 root root 2199402 Jul 25 20:04 available
-rw-r–r– 1 root root 2199402 Oct 19  2017 available-old
-rw-r–r– 1 root root       8 Sep  6  2012 cmethopt
-rw-r–r– 1 root root    1337 Jul 26 01:39 diversions
-rw-r–r– 1 root root    1223 Jul 26 01:39 diversions-old
drwxr-xr-x 2 root root  679936 Jul 28 14:17 info
-rw-r—– 1 root root       0 Jul 28 14:17 lock
-rw-r—– 1 root root       0 Jul 26 03:00 lock-frontend
drwxr-xr-x 2 root root    4096 Sep 17  2012 parts
-rw-r–r– 1 root root    1011 Jul 25 23:59 statoverride
-rw-r–r– 1 root root     965 Jul 25 23:59 statoverride-old
-rw-r–r– 1 root root 3873710 Jul 28 14:17 status
-rw-r–r– 1 root root 3873712 Jul 28 14:17 status-old
drwxr-xr-x 2 root root    4096 Jul 26 03:22 triggers
drwxr-xr-x 2 root root    4096 Jul 28 14:17 updates

Before proceeding with this radical stuff to move out /var/lib/dpkg/info from another machine to /var mistakenyl removed oned. I have tried to recover with the well known:

  • extundelete
  • foremost
  • recover
  • ext4magic
  • ext3grep
  • gddrescue
  • ddrescue
  • myrescue
  • testdisk
  • photorec

Linux file deletion recovery tools from a USB stick loaded with a Number of LiveCD distributions, i.e. tested recovery with:

  • Debian LiveCD
  • Ubuntu LiveCD
  • KNOPPIX
  • SystemRescueCD
  • Trinity Rescue Kit
  • Ultimate Boot CD


but unfortunately none of them couldn't recover the deleted files … 

The reason why the standard file recovery tools could not recover ?

My assumptions is after I've done by rm -rf var; from sysroot,  issued the sync (- if you haven't used it check out man sync) command – that synchronizes cached writes to persistent storage and did a restart from the poweroff PC button, this should have worked, as I've recovered like that in the past) in a normal Sys V System with a normal old fashioned blocks filesystem as EXT2 . or any other of the filesystems without a journal, however as the machine run a EXT4 filesystem with a journald and journald, this did not work perhaps because something was not updated properly in /lib/systemd/systemd-journal, that led to the situation all recently deleted files were totally unrecoverable.

1. First step was to restore the directory skele of /var/lib/dpkg

# mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates}

 

2. Recover missing /var/lib/dpkg/status  file

The main file that gives information to dpkg of the existing packages and their statuses on a Debian based systems is /var/lib/dpkg/status

# cp /var/backups/dpkg.status.0 /var/lib/dpkg/status

 

3. Reinstall dpkg package manager to make package management working again

Say a warm prayer to the Merciful God ! and do:

# apt-get download dpkg
# dpkg -i dpkg*.deb

 

4. Reinstall base-files .deb package which provides basis of a Debian system

Hopefully everything will be okay and your dpkg / apt pair will be in normal working state, next step is to:

# apt-get download base-files
# dpkg -i base-files*.deb

 

5. Do a package sanity and consistency check and try to update OS package list

Check whether packages have been installed only partially on your system or that have missing, wrong or obsolete control  data  or  files.  dpkg  should suggest what to do with them to get them fixed.

# dpkg –audit

Then resynchronize (fetch) the package index files from their sources described in /etc/apt/sources.list

# apt-get update


Do apt db constistency check:

#  apt-get check


check is a diagnostic tool; it updates the package cache and checks for broken dependencies.
 

Take a deep breath ! …

Do :

ls -l /var/lib/dpkg
and compare with the above list. If some -old file is not present don't worry it will be there tomorrow.

Next time don't forget to do a regular backup with simple rsync backup script or something like Bacula / Amanda / Time Vault or Clonezilla.
 

6. Copy dpkg database from another Linux system that has a working dpkg / apt Database

Well this was however not the end of the story … There were still many things missing from my /var/ and luckily I had another Debian 10 Buster install on another properly working machine with a similar set of .deb packages installed. Therefore to make most of my programs still working again I have copied over /var from the other similar set of package installed machine to my messed up machine with the missing deleted /var.

To do so …
On Functioning Debian 10 Machine (Working Host in a local network with IP 192.168.0.50), I've archived content of /var:

linux:~# tar -czvf var_backup_debian10.tar.gz /var

Then sftped from Working Host towards the /var deleted broken one in my case this machine's hostname is jericho and luckily still had SSHD and SFTP running processes loaded in memory:

jericho:~# sftp root@192.168.0.50
sftp> get var_backup_debian10.tar.gz

Now Before extracting the archive it is a good idea to make backup of old /var remains somewhere for example somewhere in /root 
just in case if we need to have a copy of the dpkg backup dir /var/backups

jericho:~# cp -rpfv /var /root/var_backup_damaged

 
jericho:~# tar -zxvf /root/var_backup_debian10.tar.gz 
jericho:/# mv /root/var/ /

Then to make my /var/lib/dpkg contain the list of packages from my my broken Linux install I have ovewritten /var/lib/dpkg with the files earlier backupped before  .tar.gz was extracted.

jericho:~# cp -rpfv /var /root/var_backup_damaged/lib/dpkg/ /var/lib/

 

7. Reinstall All Debian  Packages completely scripts

 

I then tried to reinstall each and every package first using aptitude with aptitude this is done with

# aptitude reinstall '~i'

However as this failed, tried using a simple shell loop like below:

for i in $(dpkg -l |awk '{ print $2 }'); do echo apt-get install –reinstall –yes $i; done

Alternatively, all .deb package reninstall is also possible with dpkg –get-selections and with awk with below cmds:

dpkg –get-selections | grep -v deinstall | awk '{print $1}' > list.log;
awk '$1=$1' ORS=' ' list.log > newlist.log
;
apt-get install –reinstall $(cat newlist.log)

It can also be run as one liner for simplicity:

dpkg –get-selections | grep -v deinstall | awk '{print $1}' > list.log; awk '$1=$1' ORS=' ' list.log > newlist.log; apt-get install –reinstall $(cat newlist.log)

This produced a lot of warning messages, reporting "package has no files currently installed" (virtually for all installed packages), indicating a severe packages problem below is sample output produced after each and every package reinstall … :

dpkg: warning: files list file for package 'iproute' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'brscan-skey' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libapache2-mod-php7.4' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libexpat1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libexpat1:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5.6-readline' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-headers-4.19.0-5-amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgraphite2-3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgraphite2-3:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbonoboui2-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxcb-dri3-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxcb-dri3-0:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblcms2-2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblcms2-2:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpixman-1-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpixman-1-0:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gksu' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblogging-stdlog0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mesa-vdpau-drivers:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mesa-vdpau-drivers:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libzvbi0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libzvbi0:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcdparanoia0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcdparanoia0:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python-gconf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'php5.6-cli' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpaper1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'mixer.app' missing; assuming package has no files currently installed

After some attempts I found a way to be able to work around the warning message, for each package by simply reinstalling the package reporting the issue with

apt –reinstall $package_name


Though reinstallation started well and many packages got reinstalled, unfortunately some packages such as apache2-mod-php5.6 and other php related ones  started failing during reinstall ending up in unfixable states right after installation of binaries from packages was successfully placed in its expected locations on disk. The failures occured during the package setup stage ( dpkg –configure $packagename) …

The logical thing to do is a recovery attempt with something like the usual well known by any Debian admin:

apt-get install –fix-missing

As well as Manual requesting to reconfigure (issue re-setup) of all installed packages also did not produced a positive result

dpkg –configure -a

But many packages were still failing due to dpkg inability to execute some post installation scripts from respective .deb files.
To work around that and continue installing the rest of packages I had to manually delete all files related to the failing package located under directory 

/var/lib/dpkg/info#

For example to omit the post installation failure of libapache2-mod-php5.6 and have a succesful install of the package next time I tried reinstall, I had to delete all /var/lib/dpkg/info/libapache2-mod-php5.6.postrm, /var/lib/dpkg/info/libapache2-mod-php5.6.postinst scripts and even sometimes everything like libapache2-mod-php5.6* that were present in /var/lib/dpkg/info dir.

The problem with this solution, however was the package reporting to install properly, but the post install script hooks were still not in placed and important things as setting permissions of binaries after install or applying some configuration changes right after install was missing leading to programs failing to  fully behave properly or even breaking up even though showing as finely installed …

The final solution to this problem was radical.
I've used /var/lib/dpkg database (directory) from ther other working Linux machine with dpkg DB OK found in var_backup_debian10.tar.gz (linux:~# host with a working dpkg database) and then based on the dpkg package list correct database responding on jericho:~# to reinstall each and every package on the system using Debian System Reinstaller script taken from the internet.
Debian System Reinstaller works but to reinstall many packages, I've been prompted again and again whether to overwrite configuration or keep the present one of packages.
To Omit the annoying [Y / N ] text prompts I had made a slight modification to the script so it finally looked like this:
 

#!/bin/bash
# Debian System Reinstaller
# Copyright (C) 2015 Albert Huang
# Copyright (C) 2018 Andreas Fendt

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# —
# This script assumes you are using a Debian based system
# (Debian, Mint, Ubuntu, #!), and have sudo installed. If you don't
# have sudo installed, replace "sudo" with "su -c" instead.

pkgs=`dpkg –get-selections | grep -w 'install$' | cut -f 1 |  egrep -v '(dpkg|apt)'`

for pkg in $pkgs; do
    echo -e "\033[1m   * Reinstalling:\033[0m $pkg"    

    apt-get –reinstall -o Dpkg::Options::="–force-confdef" -o Dpkg::Options::="–force-confold" -y install $pkg || {
        echo "ERROR: Reinstallation failed. See reinstall.log for details."
        exit 1
    }
done

 

 debian-all-packages-reinstall.sh working modified version of Albert Huang and Andreas Fendt script  can be also downloaded here.

Note ! Omitting the text confirmation prompts to install newest config or keep maintainer configuration is handled by the argument:

 

-o Dpkg::Options::="–force-confold


I however still got few NCurses Console selection prompts during the reinstall of about 3200+ .deb packages, so even with this mod the reinstall was not completely automatic.

Note !  During the reinstall few of the packages from the list failed due to being some old unsupported packages this was ejabberd, ircd-hybrid and a 2 / 3 more.
This failure was easily solved by completely purging those packages with the usual

# dpkg –purge $packagename

and reruninng  debian-all-packages-reinstall.sh on each of the failing packages.

Note ! The failing packages were just old ones left over from Debian 8 and Debian 9 before the apt-get dist-upgrade towards 10 Duster.
Eventually I got a success by God's grance, after few hours of pains and trials, ending up in a working state package database and a complete set of freshly reinstalled packages.

The only thing I had to do finally is 2 hours of tampering why GNOME did not automatically booted after the system reboot due to failing gdm
until I fixed that I've temprary used ligthdm (x-display-manager), to do I've

dpkg –reconfigure gdm3

lightdm-x-display-manager-screenshot-gdm3-reconfige

 to work around this I had to also reinstall few libraries, reinstall the xorg-server, reinstall gdm and reinstall the meta package for GNOME, using below set of commands:
 

apt-get install –reinstall libglw1-mesa libglx-mesa0
apt-get install –reinstall libglu1-mesa-dev
apt install –reinstallgsettings-desktop-schemas
apt-get install –reinstall xserver-xorg-video-intel
apt-get install –reinstall xserver-xorg
apt-get install –reinstall xserver-xorg-core
apt-get install –reinstall task-desktop
apt-get install –reinstall task-gnome-desktop

 

As some packages did not ended re-instaled on system because on the original host from where /var/lib/dpkg db was copied did not have it I had to eventually manually trigger reinstall for those too:

 

apt-get install –reinstall –yes vlc
apt-get install –reinstall –yes thunderbird
apt-get install –reinstall –yes audacity
apt-get install –reinstall –yes gajim
apt-get install –reinstall –yes slack remmina
apt-get install –yes k3b
pt-get install –yes gbgoffice
pt-get install –reinstall –yes skypeforlinux
apt-get install –reinstall –yes vlc
apt-get install –reinstall –yes libcurl3-gnutls libcurl3-nss
apt-get install –yes virtualbox-5.2
apt-get install –reinstall –yes vlc
apt-get install –reinstall –yes alsa-tools-gui
apt-get install –reinstall –yes gftp
apt install ./teamviewer_15.3.2682_amd64.deb –yes

 

Note that some of above packages requires a properly configured third party repositories, other people might have other packages that are missing from the dpkg list and needs to be reinstalled so just decide according to your own case of left aside working system present binaries that doesn't belong to any dpkg installed package.

After a bit of struggle everything is back to normal Thanks God! 🙂 !
 

 

12 Lessons Steve Jobs Taught Guy Kawasaki – SEO Summit Guy Kawasaki speech

Monday, July 30th, 2012

I'm not a big fan of Steve Jobs, neither I like the cult that is nowdays to his personality. After his recent death the cult to Jobs and his works has bloomed once again. From philosophical point of view I don't like Jobs ideas that there is no good and bad but only success matters. However I should admit as a SEO and as a business enterpreneur his achievements are significant. Hence I decided to share with you a video of SEO Summit ex-employee Guy Kawasaki, who "worked for jobs twice and survived". Jobs is famous for not being loved too much by his employees. Also it is not a secret historically he screw up, Steve Wozniak and a number of other people who were either employeed or worked in any way with him.

The points his ex-employee KAWASAKI shares on this SEO Summit presentation are quite interesting and are things, beginning business enterpreneurs like me could learn tremendously from. One key point that is hardly underlined in the presentation is the importance of simplicity.

* Simplicity in everything is essential for the success. It was quite curious to me Steve Jobs presentations were consisting often with a slides of just one word. Obviously this means Jobs was a simplicity freak.

Some of other concepts of Jobs was:
 

Either it works or it doesn't work.

You see again his trend to be simplifying things. In business we all know the SMART (Keep it Simple And Stupid). It seems Jobs SMART was only SAS (Simple and Stupid) 🙂 ….

Some other things Kawasaki learned from Jobs was:
 

Never believe Experts

– If someone tells you he is an expert in something he is definitely not ….

Another belief (understanding) of Jobs and probably many other succesful enterpreneurs is that DESIGN COUNTS. Design is one of the most crucial points in any product, so one has to be extra-careful here. A fail in design is a fail in product line ….

There is plenty of other interesting stuff in the video but the key point is SIMPLICITY. Enjoy Kawasaki Speech …

12 Lessons Steve Jobs Taught Guy Kawasaki

 

Flight from Sofia Minsk via Moscow Sheremetevo airport a few impressions from Russia and Belarus

Sunday, April 17th, 2016

Sofia-Sheremetevo-Minsk-my-impressions-on-Russian-and-Belarusian-airport-what-it-is-like-in-Eurasian-Union

Thanks God, today we had a safe flight  for one more time with my wife Svetlana from Sofia  airport Vrazhdebna ( Terminal 2 )  to Minsk Belarus National Airport.
We travel 2 times to Belarus from Bulgaria (European Union) and though in Summer time tickets are more cheap and more regular and more convenient direct flights are available from Bulgaria to Minsk (Varna -> Minsk and Burgas -> Minsk) because of tourism the only way to travel quickly by plane to Minsk from Bulgaria is either via Moscow or via Istanbul as in the late days the political situation in Turkey is so ignited and the problem with these refugees and crazy bomb hihhadists is escalating we decided to not fly through Istanbul Ataturk airport even though the bit lower ticket prices.

The trip started from Sofia airport, there we had to go through the regular Metal Detector scan and removal of all metal things and going through the scan "gateway" doors. It seems after the last terrorist acts in Brussels Belgium and the risk for many other Islamic ones the security in airports was raised even further.

The distrust to the regular flight traveller like me has reached a crazy levels, these times besies the regular Metal detector, we were asked to give our hands and with a small device called "Trivka", were checked whether our skin has recently been exposed to explosive materials and stuff like this …

For both flights Sofia -> Moscow Sheremetevo and Sheremevo -> Minsk we flied with Aeroflot. This is not the first time we fly with Aeroflot and I think it will definitely not to be the last time. The airplanes we flight with were a new airplanes (SU) Sukhoi airplane and I enjoyed the flight.

My impression was the Russian pilots are "driving" / flying the plane very much like they drive an ordinary military airplane and that's quite fun as the airplane lift off and landing is done very rapidly exactly like being done with a military aircraft. Of course that could be my own gut feeling but it feels that way just to compare the aviators of other Westerner airplanes such as Boeng 737 / 777 does speed up before lift off much more easily so the flight out doesn't boost up so much adrenaline 🙂

The food in Sofia -> Moscow plane was quite decent too we were served the so common and valued in Russia, Belarus and Eurasian Union (EAC) juice called RICH before the meail toghether with some option for a beef meal or a chicken meal. The meal itself was worm and served in a board inside holding 2 cardboard boxes one containing the beef together with some spaghetti with steamed vegetables and the other one containing a tiny soared corny with a few pieces of beef (or pork) meet with two pieces of some healthy "black" rye bread pieces one of which was with some healthy sesame seeds accompanied by a small package of butter and some other souce. For a dessert  a delicious waffle like made of drought mashed fruits.

To be honest my first impression seeing that strange meal combination was not very positive, not to say that I honestly wanted to puke but after tasting it I would say I really liked it. Aeroflot offers also a vegetarianian menu but this has to be pre-ordered in advance and as I didn't ordered it earlier but for next time if it is a fasting period before Easter or Christmas I would definitely pre-order a vegeraranian meal.

What I truly liked about Aeroflot's Sukhoi SuperJet 100-95 with which we flight is the the simplistic design, no extras inside the plane no annoying monitors that show you all the time the altitude and reporting over which country you're flying and generally no useless and often unwanted information.
However we were reported by the pilot a couple of times some information such as that we're flying over Brest and Minsk, but of course the English of the pilot was hard to understand. Well the radio from the pilot on the airplane is definitely something that didn't impressed me as in any other western airplane the radio connection from pilot is much more clearly heard but I guess this can be solved quickly.
The toilets in the airplane was also normal ones as in any other Western built Boeng, here is time to say it was always intesting for me the wiping of the toilet once the wipe off button is pressed a small hole is opened letting some air directly from outside to pull off what is inside the toilet and that quickly cleans it up 🙂

Entering the airplane was done through an attachable cordon (air tunnel) and not like with my earlier flights in which we were driven to the airplane by an ordinary bus.  

moscow-sheremetevo-terminal-2

Sheremetevo is really huge airport and what impressed me is the fact Sheremetevo's airport letters were written in pure cyrillic, something surely unique to see for any person coming from the west.

First impression from Moscow Sheremetevo if compared to Shiphol airport in Holland or Heatrow port in London is Sheremetevo is much more calm and quiet, the airport looks feels relaxing and cozy even though its outlook is a bit old fashioned. The marketing and advertisement ads all around the place and complexity of Sheremetevo is much less if compared to any other huge International airport and some things are made in a typical Russian manner, even the number of products being sold in the airport are much less than in any western airport, though there is plenty of caffeterias and restaurants to have lunch / dinner.

Moscow-Shermeetevo-free-duty-shops-and-terminal-D-red-cooridor-signatures

The simplicity on Sheremetevo airport is really a great thing as even the monitors showing up information for the flights are displaying the information in a very understanable and simply way even though possessing generally an old fashioned DOS like outlook if compared to the modern European Union / United States airports.
While waiting on Terminal D for the onboarding to flight Moscow -> Minsk, I had an amazing view of the airports airplanes, moving all around.
This is the first time I saw so many airplanes gathered on one place even though I've flight via Sheremetevo previous times this is the first time I'm starting to understand how big is really Sheremetevo.

One unfortunate fact about the flught was that our luggage was not transferred directly to Minsk Belarus but sent from Sofia to Sheremetevo and then we had to wait for some time to pick it up right after we've been checked by the border control kiosk.
There by the border police Russian lady I had to answer her few questions and she filled me a small list called "Migration card" blank for the Transfer visa.
Oh yes, I almost forgot in order to fly through Russian to another country inside the Eurasian Union such as Belarus, you need to have a Russian Transfer Visa which is being applied for from Russian embassy in Bulgaria.
The Russian Transit flight  VISA costs 60 EUR (if it is to be made from 4 to 10 days) and for a 3 days creation of VISA it costs 95 EURO.

Sheremetevo_airport_Saint_Nicolas_Eastern_Orthodox-Chapel

One very great thing about Sheremetevo which I liked so much as I'm an Eastern Orthodox Christian is the existence of the Eastern Orthodox Chapel in honour of Saint Nicolas the Myrh-Bearer who is in our Christian faith considered to be a protector of all travelers. Thus if like me you happen to be a Christian and you're flying via Moscow it is very nice to drop by for a few minutes in St. Nicolas chapel to light up a candle and pray to the saint with a beseach for a safe flight.

 

Sheremetevo-airport-Saint_Nicolas_Chapel-iconostas-icons-of-the-Savior-Jesus-Christ-and-Virgin_Mary
Here in Minsk the airport is also very cozy and warm (especially the old terminal), so one have a relaxing feeling once in Minsk.
Minsk airport is also very well organized and well maintained so to be honest it looks to me personally more beautiful than Sheremetevo.

Minsk-National-airport-logo

To transfer to the 2nd airplane that flight from Moscow Sheremetevo to Minsk we needed to make transfer from Terminal F (where we arrived) to Terminal D which is the terminal that runs the local Eurasian Union flights from Russia to Belarus (note that Russian, Belarus doesn't have a flight border so anyone flying from Russia to Belarus could fly freely and once you reach Belarus, you're not being checked at all from any border control and that's pretty cozy because we didn't have to be checked for a second time once we reached Minsk.

minsk-inside-airport-shops-and-infrastructure

My impression from Minsk National airport is that it is a nice mixture of communistic remains architecture and modern architecture.
There are plenty of private  busses (marshrutki) that goes every 15 minutes from Minsk airport which is 43 km from city center as well as an ordinary state bus that gues to the train station and city center.
The train station in Minsk is also on a very much Western level and for some things it is even better as it has a cheap shop, where you can buy food at same prices as in any other supermarket chain in Belarus. 
We travelled to train station and there what striked me is the touch screen interface allowing you to see various info about Minsk infrastructure the trains timing and even there was a video call to Train Station Staff to find out more about anything you can't find out yourself.

 

Remote Desktop client – Remmina, Connect Remote to MS Windows VNC hosts from Linux

Friday, May 31st, 2013

remmina remote connet to windows linux vnc client logo

If you're system administrator, who use Linux as Desktop. You surely want to check out Remmina – The GTK+ Remote Desktop Client.

As far as I tested among all VNC Linux clients I know Remmina is definitely the one of choice in terms of Interface simplicity / stability and remote connection level of responsibility.

Before finding out about Remmina existence, I tried xtightvncviewer, xvnc4viewer, gvncviewer, gtkvncviewer. xtightvncviewer, xvncviewer and gvncviewer are more for console geeks and hence either they lack GUI interface or user interface looks terrible.

GTKVncViewer's interface is also not bad but still not со nice as Remmina's.

gtkvncviewer Debian GNU Linux Wheezy screenshot Linux VNC simple client

As you see in above shot, gtkvncviewer lacks any configuration. The only thing it can do is connect to remote host and you have option to configure nothing related how remote connection will respond, what type of Resolution to use etc.

I know of of no other Linux VNC Clients that has configurability and GUI interface of Remmina.

 

As of time of writting Remmina is at stable version 1.0 and supports following Remote connection protocols:

  • VNC
  • VNC
  • RDP
  • RDPF
  • RDPS
  • SFTP
  • SSH

Remmina is available across mostly all Linux mainstream distributions:

To install Remmina on Debian / Ubuntu and deb derivatives:

debian:~# apt-get –yes install remmina
….

On Redhats (Fedora, CentOS, RHEL – RPM based Linuxes) install via:

[root@centos ~]# yum –yes install remmina

Below are few screenshots of Remmina:

Remmina Linux remote vnc connect best software gui frontend screenshot

Linux VNC best VNC connect tool Remmina preferences screenshot

One of best Remmina feature is it supports Tabbing just like in Firefox. You can open a number of Remote VNC connects to different Windows hosts and manage them all by switching from tab to tab.

Remmina best vnc linux desktop client screenshot with tabs / What is best VNC client for Linux

Install Microsoft Office 2007 on Debian Linux 7.0 Wheezy

Monday, May 27th, 2013

Install Microsoft Office 2007 on Debian GNU / Linux Wheezy / Debian and Microsoft Office logo

Here is few steps I followed to install succesfully Microsoft.Office.Enterprise.2007.bg-BG.SP2.Integrated on my recently installed Debian stable Wheezy Linux.

1. Install Wine and Winetricks

linux:~# apt-get install --yes winetricks wine
....

2. Download Microsoft XML support – msxml3.msi

Download URL for MS XML from CNET is here

For simplicity I've mirrored msxml3.msi .
linux:~$ cd ~/.cache/winetricks/msxml3/
linux:~/.cache/winetricks/msxml3$ wget -q https://www.pc-freak.net/files/msxml3.msi
linux:~/cache/winetricks/msxml3$ winetricks msxml3

3. Insert Microsoft Office 2007 CD or  ISO

To Mount it you need to go in root shell:

To mount CD;

linux:~# mount -t iso9660 -o unhide /dev/cdrom /media/cdrom

To mount MS Office 2007 from ISO file:

linux:~# mkdir /mnt/ISO
linux:~# mount -t iso9660 -o loop Microsoft.Office.Enterprise.2007.bg-BG.SP2.Integrated.iso /mnt/ISO/

4. Launch MS Office installation with WINE emulator

linux:~# wine /mnt/ISO/Microsoft.Office.Enterprise.2007.bg-BG.SP2.Integrated/setup.exe

microsoft office 2007 on debian linux installation in progress

Follow normal installations steps Install and Enjoy.

To start Microsoft Office further follow menus:

Applications -> Wine -> Programs -> Microsoft Office
 

Tricks of the supermarket trade or how supermarket lie to you to buy more than you need (My few memories on government food stores in communism times)

Friday, June 22nd, 2012

I've personally always hated super markets from the very early days I entered one. Here in Bulgaria we've been somehow partly lucky not to have supermarket due to the different philosophy of the communistic regime in which we lived until 1991. The philosophy of then governing communist back then was to distribute food in local middle size or small stores owned by the government. The food has to be approved by governmental body and heavily checked if it matches the governmental set standards. The variety of food we were offered in the stores was very little. Most of the small stores (which were owned by the government) only contained basic products like;;;

bread, youghurt, milk, meat, butter, lemonade, beer and few more,

This was done probably intentionally and was a result probably of our long years Orthodox Christian faith which (has saved us and preserved over the centuries). Orthodox Christianity has always teached for simplicity. Even though the communist party rejected the faith and even did severe persecution against the Bulgarian Orthodox Church. The people on the top elite who were planning the communism had been a descent of an orthodox christian raised up living and therefore the philosophy of simplicity was inherited (even genetically) so the way the COM party behaved based on its leaders and the governing decisions about the nations belonging to communism (Russia, (Yugoslavia) – Serbia Koso , Bulgaria, Greece, Egypt etc.) were in a material expression in conjunction with the Christian tradition of simplicity (i say material because Orthodox Christian Church even visiting back then in the countries was usually prohibited and the Com. party did their best to ruin up the believe in Christ in people).

In communism the local suburb grocery stores, were the only "points" of distribution of food. Since buying and owning a car took at least few years of waiting and big money for it. Not more than 10 to 20% of families owned car and owning a car was considered to be granted mostly to people belonging to the then governing communistic elite or the Communist Party.

The public transportation was encouraged because according to communism so called "geometry" which was a main drive for how the systems in communistic countries should work it was estimated public transportation is cheaper and more environmental friendly than if a car is given to anyone, also public transportation (trains, bus-es) etc. did a good thing in the aim of the party to exersice higher control and surveilance over the population.

Because of that existence of big super-market was scarce and the culture to go and buy from a shop with your own family car was not existing.

The equivalent of nowdays mall shops (big retail stores) was usually located on the city center and the size of this shop was much smaller and the variety of products one can find there was only few. Hence the customer didn't have so much options to choose between, neither had to spend too much of time on choosing, the com party wanted the people to work more and buy less, so spending time in stores was not encouraged.

With the entrance of democracy and the moving up of large super-market food and good retails shops like Metro was among the first ones which entered the "freed" market. It was really a bizarre experience for us the ex U.S.S.R belonging people to enter such a large sized stores and to face such a big variety of choice.

Before that in communism we never saw such stores even on the TV, since the TV was governed by communistic party and only information which was useful for the establishment and protection of the regime was projected on the only available National TV channel.

Sorry to distract a bit from the major topic of this post, but I thought this is necessery to explain before continuing because it is important to understand that unintentinonally the communist gave us an advantage to have a different view on things than Western free world, a view which is in many things contrary and more correct (in terms of hard logic) than to Western Europe.

My first encounter with a super-market was only about 8 or 10 years ago and I believe many people who lived in the province of Bulgaria and other ex-communist countries did for a first time experience super-markets approximate 10y. ago.
Though all looked so nice inside the shop and the shop emploees were so nice I always felt something very cold dead inside this big stores. Ptonsnlu my intuition (spirit) if you want has always pointed me out that there is something very wrong with this super markets.

With the increase of products on the market for us people who lived up to our 8 to 12 years (young age) in communism it was a great shock, since we were raised in a society based on some communist false ideology and suddenly the markets were opened and the products variety to choose between become extremely high.
All previously said to be good and true in communism time was said to be anti-freedom and many people did their best to destroy as much as possible mostly everything somehow connected with previous communistic time.
My homeland Bulgaria as a result of this become a very hard to live place and we were forced to adapt in fast paces and learn things on how we have to live like democrats for a very little short of time.
One severe "damage" most of the growing people in Bulgaria in communism had was the hardness and inability to make choices.
For many people between the age of 25 to 35 it is very hard to make choices even for small things.
This was a direct consequence of a long years (45 years) of communist propaganda, and few generations who lived in a non-freedom respecting regime which conditioned and prepared a specific plan and place for every individual living in the country.

Seeing communism as the ultimate evil and manipulation to make us dependent we didn't know that in the free democratic world the manipulation and conditioning in society was heavy too.

"The Programming" of western society through institutions, stores and order in society was a fact and in a sense the only difference between the Democratic world and communistic world was one of the worlds seemed to have a larger frame in which the individual can work and live, whether the communistic regime seem to be more restrictive.
One main thing used to condition people choices and buying behavior and make them over-consume to make the democratic economy constantly growth was big super-markets. Though they were privately owned and not like in communist country, the only drive behind each shop was PROFIT, PROFIT and agian PROFIT.

Higher profits would mean higher consumptions, higher consumptions means higher production and more work places opened as well as more expenses for working individuals would mean bigger necessity to work more and earn more, because though the sallaries incomes were high in the free world. The individual necessities there were even increasing too.

Since the about 1950s 1960s the super-markets started entering the "free" democrat countries world. As a result the small shops which were prior a main food and beverage distribution source started closing, because they couldn't be a concurrence to the big "brothers" super-markets which were able to buy higher quantities of goods in lesser price and therefore sell many of the goods in much lower prices than the little grocery stores.

The result with the years was a huge shift in people buying behavior from local groce and open markets to buy everything from the big super-markets. The big store chains had to be in a fight for customers all the time, so businesses involved started customer wars and tried their best to "steal" customers from each other. In this financial wars a main thing that most super-market chains and malls did was constant optimization of efficiency of both buying and reselling to the end customer. This is a 3 step business process actually.

1;;; They buy from the commodity producer
2;;; They prepare the food for the store (packaging, cleaning up whatever)
3;;; They put it in a certain way in the store and organize the store in a way to always sell more and more

As a result a huge number of tricks were employed by each and every super-market aiming to deceive the customer to ever buy more
The deception of the client in store is very tricky and smart organized so it cannot really be called a lie but its rather a tricky smartness.

Since the super-markets entered in my country too and the tiny grocery stores are mostly closing unable to compete with the large super-market 'money making machines'. Even I am sometimes forced to buy stuff from super markets. Since here in Bulgaria the culture of purchasing from super-markets is not so strong yet. In order to be able to consume the little grocery stores. Many large super-markets started investing in making the little groceries their retail shops with their brand or (sometimes a new make up brand).
By doing so the little grocery stores loose their authoritarity and independance and become dependant on the big super-market on the type of products they will sell, this obviously means this strategy of the big super-market in the long run will lead the little grocery stores we still have to ruin up. This is obvious because if the small grocery stores start selling the exact same products (brands) of the big super-markets, there will be nothing left to make the little grocery unique. Neither the variety of products choice inside or pricing will be any different from super-market. This will mean the tiny grocer will be no different from the big super-markets in terms of product and prices and therefore. The clients which now are loyal to small grocery stores like me will then have not such big motivation to buy from small super-markets, since everything inside is somehow similar (not to say) the same as with big supermarket the only difference would be the lesser variety which is obviously a good reason why the customer would definitely prefer to buy from the large supermarket …

On the videos you're about to see below, they explain some of the probably thousands of tricks nowdays existing the super-market chains employs to trick us to exponentiolly consume their goods.

Old Tricks of the SuperMarket Trade

As you can see the video is presenting a reality of the tricks which was used in the 1960 and now technology and knowledge in the field has largely increased and since they there are surely many new trick 'developments' which are working for the masses of customers daily.
There is even a whole science centered on buying behaviour already existent called buyology!

Here is a short introduction to buyology to give you an idea what its purpose is:

Short introduction video on buyology – The Science of buying part 1 of 2

Short introduction video on buyology – The Science of buying part 2 of 2


Seeing all this is very precious information, since being informed one can escape the bad "tricks and traps" pawn in the markets.

All the information about the communistic regime and the 'shopping system' there was mentioned priorly because I wanted to explain a bit of the difference of then and now to point you to my opinion that the Western buying model and expectation to sell more based on the tricks are probably not working very well here in the ex-communistic countries, especially with the older generations and the one like me which somehow grow a small part of their youth in communism.

The reason is we have a different 'social programming' than westerners. Also the different spirituality (The orthodox Christian faith) plays another role. Also there is a difference in the type of buying behaviour. In Bulgaria there is no culture to buy once or twice per week. People have culture to buy daily, though this is starting to change slowly these days.

For a bit more of videos and a bit of my thougths on my research on Super Market Psychology check my previous post containing educational videos on how the supermarkets cheat you to buy more

The topic is actually very huge and I'm sure what I'm saying is just the 'tip of the iceberg'. As I'm a firm opponent of big industries and large business I'm firmly against the buying from big stores any goods. The reason is that simply by doing so one makes the already RICH people even more RICHER. By increasing the richness of a certain small group of people daily, we as society are un-consciously somehow involuntarily letting them increase the financial control that is already there in some degree to the society.
As democracy's main drive is money this means that by helping the large business-es marge and become even BIGGER, we're doing something against ourselves and our interests as society.
I don't think that any ordinary citizen in the free world want to live in a fully controlled one World State (one world country), similar to the ex-communism I lived through, so I think people concerned about our freedoms should oppose the big businesses according to the society level they're in. Even if we're not in position to change things with money, we as society are in a position to change ourselves and our understanding of world, our desires and our behaviour. If we change our value system in a way, where money are not a top priority and the highest value the outcome will be positive in both spiritual terms and overall world state.

The modern day however wants us to falsely believe that we're divided, helpless and money dependent. This is a big delusion which we're constanty repeated. Just like with the super-market this big super-market company owners were able to convince us through time that super-market is better than the grocery stores, because of the less money spending advantage. Even if in the past there were possibility to spend less via supermarket nowdays spending less by using the supermarket instead of the small groce-store is a BIG LIE. Even if one spends less in super-market on certain products, the amount of related products he is cheated* to buy in store highly exceed the simply money one would spend on even higher priced products in the small groce.
The outcome results from the super-market is also a big waste, as I lived in the west I've seen most of the households are buying more than they need, spending more than they need, cooking more food and more frequently than necessery and throughing large portions of food in the garbage (e.g. a huge amount of food waster).

If it was possible that people were aware they are buying all this non-sense food because of deception, they would have bought less, the super-markets would bought less and distribute less and the food (waster) remaining could be distributed to poor-er countries to help the starving kids and suffering people in Africa.
Helping the suffering and starving, we would have helped each other as it is a nowdays well known that even on molecular level the whole world is connected, therefore helping our poorer brothers and sisters is actually helping ourselves ***

How to install OpenNTPD NTP server to synchronize system clock on FreeBSD for better security

Sunday, February 12th, 2012

FreeBSD, OpenBSD, NetBSD and Linux ntpd alternative server to synchronize server system time

Lately I've been researching on ntpd and wrote a two articles on how to install ntpd on CentOS, Fedora and how to install ntpd on FreeBSD and during my research on ntpd, I've come across OpenNTPD and decided to give it a go on my FreeBSD home router.
OpenBSD project is well known for it is high security standards and historically has passed the test of time for being a extraordinary secure UNIX like free operating system.
OpenBSD is developed in parallel with FreeBSD, however the development model of the two free operating systems are way different.

As a part of the OpenBSD to be independant in its basis of software from other free operating systems like GNU / Linux and FreeBSD. They develop the all around free software realm known OpenSSH. Along with OpenSSH, one interesting project developed for the main purpose of OpenBSD is OpenNTPD.

Here is how openntpd.org describes OpenNTPD:

"a FREE, easy to use implementation of the Network Time Protocol. It provides the ability to sync the local clock to remote NTP servers and can act as NTP server itself, redistributing the local clock."

OpenNTPD's accent just like OpenBSD's accent is security and hence for FreeBSD installs which targets security openntpd might be a good choice. Besides that the so popular classical ntpd has been well known for being historically "insecure", remote exploits for it has been released already at numerous times.

Another reason for someone to choose run openntpd instead of ntpd is its great simplicity. openntpd configuration is super simple.

Here are the steps I followed to have openntpd time server synchronize clock on my system using other public accessible openntpd servers on the internet.

1. Install openntpd through pkg_add -vr openntpd or via ports tree

a) For binar install with pkg_add issue:

freebsd# pkg_add -vr openntpd
...

b) if you prefer to compile it from source

freebsd# cd /usr/ports/net/openntpd
freebsd# make install clean
...

2. Enable OpenNTPD to start on system boot:

freebsd# echo 'openntpd_enable="YES"' >> /etc/rc.conf

3. Create openntpd ntpd.conf configuration file

There is a default sample ntpd.conf configuration which can be straight use as a conf basis:

freebsd# cp -rpf /usr/local/share/examples/openntpd/ntpd.conf /usr/local/etc/ntpd.conf

Default ntpd.conf works just fine without any modifications, if however there is a requirement the openntpd server to listen and accept time synchronization requests from only certain hosts add to conf something like:

listen on 192.168.1.2
listen on 192.168.1.3
listen on 2607:f0d0:3001:0009:0000:0000:0000:0001
listen on 127.0.0.1

This configuration will enable only 192.168.1.2 and 192.168.1.3 IPv4 addresses as well as the IPv6 2607:f0d0:3001:0009:0000:0000:0000:0001 IP to communicate with openntpd.

4. Start OpenNTPD service

freebsd# /usr/local/etc/rc.d/openntpd

5. Verify if openntpd is up and running

freebsd# ps axuww|grep -i ntp
root 31695 0.0 0.1 3188 1060 ?? Ss 11:26PM 0:00.00 ntpd: [priv] (ntpd)
_ntp 31696 0.0 0.1 3188 1140 ?? S 11:26PM 0:00.00 ntpd: ntp engine (ntpd)
_ntp 31697 0.0 0.1 3188 1088 ?? S 11:26PM 0:00.00 ntpd: dns engine (ntpd)
root 31700 0.0 0.1 3336 1192 p2 S+ 11:26PM 0:00.00 grep -i ntp

Its also good idea to check if openntpd has succesfully established connection with its peer remote openntpd time servers. This is necessery to make sure pf / ipfw firewall rules are not preventing connection to remote 123 UDP port:

freebsd# sockstat -4 -p 123
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
_ntp ntpd 31696 4 udp4 83.228.93.76:54555 212.70.148.15:123
_ntp ntpd 31696 6 udp4 83.228.93.76:56666 195.69.120.36:123
_ntp ntpd 31696 8 udp4 83.228.93.76:49976 217.75.140.188:123

By default openntpd is also listening to IPv6 if IPv6 support is enabled in freebsd kernel.

6. Resolve openntpd firewall filtering issues

If there is a pf firewall blocking UDP requests to in/out port 123 within /etc/pf.conf rule like:

block in log on $EXT_NIC proto udp all

Before the blocking rule you will have to add pf rules:

# Ipv4 Open outgoing port TCP 123 (NTP)
pass out on $EXT_NIC proto tcp to any port ntp
# Ipv6 Open outgoing port TCP 123 (NTP)
pass out on $EXT_NIC inet6 proto tcp to any port ntp
# Ipv4 Open outgoing port UDP 123 (NTP)
pass out on $EXT_NIC proto udp to any port ntp
# Ipv6 Open outgoing port UDP 123 (NTP)
pass out on $EXT_NIC inet6 proto udp to any port ntp

where $EXT_NIC is defined to be equal to the external lan NIC interface, for example:
EXT_NIC="ml0"

Afterwards to load the new pf.conf rules firewall has to be flushed and reloaded:

freebsd# /sbin/pfctl -f /etc/pf.conf -d
...
freebsd# /sbin/pfctl -f /etc/pf.conf -e
...

In conclusion openntpd should be more secure than regular ntpd and in many cases is probably a better choice.
Anyhow bear in mind on FreeBSD openntpd is not part of the freebsd world and therefore security updates will not be issued directly by the freebsd dev team, but you will have to regularly update with the latest version provided from the bsd ports to make sure openntpd is 100% secure.

For anyone looking for more precise system clock synchronization and not so focused on security ntpd might be still a better choice. The OpenNTPD's official page states it is designed to reach reasonable time accuracy, but is not after the last microseconds.
 

Installing Linux on old hardware PC. Few thoughs on Puppy and Xubuntu Linux

Tuesday, January 24th, 2012

I needed a G/Linux distribution that will work fine on an old PC with hardware configuration:

guest@xubuntu-desktop:~$ grep -i cpu /proc/cpuinfo; free -m; df -h
cpu family : 6
cpu MHz : 797.613cpuid level : 2
total used free shared buffers cachedMem: 497 470 26 0 35 259-/+ buffers/cache: 176 321Swap: 1454 10 1444File System Size Used Free % Mounted on
/dev/sda1 37G 4,3G 31G 13% /

I've read a lot on the internet and come to the conclusion I have basicly two popular Linux distros as option to install on archaic x86 hardware:

1. Puppy Linux
2. Xubuntu Linux

I first give Puppy Linux a try. It worked quite nice, but the interface was too old school and the desktop felt like a bit out-dated.
Besides that many of the Puppy Linux shipped programs were not a mainstream programs available across most of the other Linux distributions.

Many of the programs shipped with Puppy are great, but more suitable for a computer geek than for a Windows accustomed GUI user.
Puppy Linux Screenshot

My opinion on Puppy (from what I've seen) is that its great distro for old school hardcore Linux users.
Anyways its not suitable for absolutely "uniniated" users who encounter Linux for a first time.

Secondly I installed Xubuntu. Most of the archaic hardware on the PC was detected during install time (a pleasently surprise).
Xubunto works fast and Xfce menus opens "light fast" as on the old 800Mhz pc with 512 mem of ram. Generally the GUI worked quick and responsive.
To conclude I liked Xubuntu a lot and I strongly recommend it to anyone who want to quickly roll on Linux on an old PC.
Xubuntu GNU / Linux theme

What impressed me most is the minimalistic look & feel and simplicity.

I'm sure Debian will be working great on old hardware as well, however configuring it will be hell a lot of work. Thus I think Xubuntu is a good choice for people who want save some time in obscure configurations and easily have a neat Linux ready for desktop use.