Linux: GNOME Flashback missing Desktop Icons howto fix – Hack to add desktop icons via gnome-shell in GNOME 3.28 onwards


September 24th, 2018

how-to-fix-workaround-gnome-3.30-missing-desktop-icons-on-linux

I just upgraded my notebook fom Debian Stretch 9.5 Linux to Buster (current Testing Debian release). All went fine except I got a lot of headaches because it seems in Buster the GNOME Flashback 3.30 which I use has removed the support for Show Desktop Icons in Nautilus because of some migration reasons of Nautilus to a newer version 4, (hopefully that would be temporary) from gnome-tweak-tool whose package now contains no binary for gnome-tweak-tool, instead an equivalent tool now is called gnome-tweaks and this tool is no longer working under Gnome Flashback but only with GNOME Classic 3.30 and the regular GNOME 3.30 launcher available from gdm3 (the Gnome Display manager).
 

1. Displaying Missing Desktop icons on GNOME version 3.30


The way to display Desktop icons in GNOME 3.28 onwards at the moment of writting this post and the whole issue with the removed handling of Desktop icons in Nautilus is explained well by Carlos Soriano a gnome shell extension developer in his blog post Desktop icons goes beta.

The good guy C. S. wrote  the his desktop icons gnome shell extension which is on github.com
To use it you have to fetch it and enable it by fetching the repo source code to gnome-shell extensions directory:
 

hipo@linux:~$ cd ~/.local/share/gnome-shell/extensions
hipo@linux:~$ git clone https://gitlab.gnome.org/World/ShellExtensions/desktop-icons
hipo@linux:~$ mkdir 'desktop-icons@csoriano'
hipo@linux:~$ mv desktop-icons/* 'desktop-icons@csoriano'/
hipo@linux:~$ rm -rf desktop-icons/


Now you should use the gnome-tweaks command tool to enable the new added gnome-shell extension.

 

 

hipo@linux:~$ gnome-tweaks


gnome-tweak-on-debian-testing-linux-screenshot

Once enabled your Desktop icons will appear as usual as seen in below shot, the downside this solutions is icons as seen in below screenshot is that pictures doesn't have Thumbnail pictures generated … and icons when kept on with mouse over can move only in a selected square like perimeter (when moved left / right / up down side). That "woody" icon movement sucks a bit but much better than no icons at all.

gnome-3.30-general-desktop-solved-missing-icons-desktop-screenshot-on-debian-linux

 

2. Displaying Missing Desktop icons in GNOME Flashback 3.30

 

I really love GNOME Flashback as it used to be a good replacement for Linux MATE (which is the fork of GNOME2 and not bad but lacks Metacity Window Manager and some of the Eye Candy that GNOME 3 and beside that even MATE had to be slightly hacked to make look more like Classical GNOME 2 – for more on that check my previous article Fixing Mate Adwaita Theme problems on Debian and Ubuntu). 

At the moment when I tried to run gnome-tweaks under a GNOME Flashback session I got the following error:

 

hipo@jericho:~/.local/share/gnome-shell/extensions$ gnome-tweaks 
WARNING : Shell not installed or running
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gtweak/app.py", line 30, in do_activate
    self.win = Window(self, model)
  File "/usr/lib/python3/dist-packages/gtweak/tweakview.py", line 38, in __init__
    self._model.load_tweaks(self)
  File "/usr/lib/python3/dist-packages/gtweak/tweakmodel.py", line 104, in load_tweaks
    mods = __import__("gtweak.tweaks", globals(), locals(), tweak_files, 0)
  File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_general.py", line 14, in <module>
    _shell_not_ubuntu = _shell.mode != 'ubuntu'
AttributeError: 'NoneType' object has no attribute 'mode'

 

In regular GNOME session gnome-tweaks works fine and with the help of an GNOME Shell Extension addon it is possible to add the Missing Desktop icons however the only working fix for GNOME FlashBack 3.30 is to substitute nautilus (the default GNOME file manager) with NEMO (which is The Official file manager for Cinnamon Desktop Environment).
Thanksfully this is done relatively easy and all I had to do is to use a little "hack", e.g. install nemo.

 

root@linux:~# apt-get install –yes -qq nemo

 

And add a new auto-launcher for gnome that launches nemo file manager instead of nautilus.

To add the auto-launcher in GNOME I had to add a file with following content:

 

[Desktop Entry]
Type=Application
Name=Nemo
Comment=Start Nemo desktop at log in
Exec=nemo-desktop
OnlyShowIn=GNOME;
AutostartCondition=GSettings org.nemo.desktop show-desktop-icons
X-GNOME-AutoRestart=true
NoDisplay=true

 

to ~/.config/autostart/

For those who don't know GNOME has this handy way to set an autostart programs by using the specific .desktop extension files that have to be placed under $HOME/.config/autostart (where $HOME = the logged in user home directory).

The one liner to do so is:

 

echo '[Desktop Entry]
Type=Application
Name=Nemo
Comment=Start Nemo desktop at log in
Exec=nemo-desktop
OnlyShowIn=GNOME;
AutostartCondition=GSettings org.nemo.desktop show-desktop-icons
X-GNOME-AutoRestart=true
NoDisplay=true' >> ~/.config/autostart/nemo.desktop

 

Then I had to restart my GNOME FlashBack session (e.g. Log Out and Login with a new session) and the icons appeared.

classic-gnome-flashback-debian-gnu-linux-hipos-desktop-screenshot

The downside of this dirty workaround is that desktop icons even though showing up couldn't be moved (rearranged) freely on any location of desktop (are pretty much static) and the even worser  fact about this hack is you can't actually copy paste easily copy files from your Desktop within another desktop folder … 
 I know that's shitty but at the moment there is no better solution and this is better than nothing at all.

 

P.S. I tried downgrading my Debian Testing to Stable Stretch Linux again with the idea to use the old GNOME 3.22 that the Stable Debian distro provides but, ended up with a lot of mess after experimenting to downgrade using /etc/apt/preferences file records and substitution in /etc/apt/sources.list to include the stable .deb repository and apt dselect and aptitude package management tools. Officially downgrades are not encouraged and supported by Debian, but I hoped I could relatively easily do it by manually fixing the broken dependencies after removing debian packages manually combined with short for bash loops like I did in the past, but it seems this time I broke the system worse, so I could hardly return it back to normal operation in upgrading packages with a lot of manual hacking with apt-get and few one liner scripts. Thus I abandoned as a fix the possiiblity to downgrade Testing Debian to stable, I even considered switching from GNOME desktop environment to something more light as OpenBoxCinnamon / XFCE and gave them one more try but the results weren't nice, I reconsidered again to go back to using the Good Old GNU Step Window Maker as a GNOME alternative which in my opinion is still a great GUI environment for security crackers / sysadmins /hackers (programmers) and eventually perhaps I will switch back to using it, because GNOME is becoming more and more bloated with the years and I can hardly stand it … I mean I did not expected GNOME to be developed in the shitty Mobile Interface  (Unity) way, I have been a loyal user to GNOME for so many years and have lived trhough  all its mess over the years, its painful to see how the good and efficient GNOME 2 went the bad broken road of changing completely concepts and interface in GNOME 3.x
 

3. Closure

GNOME Desktop icons has been with GNOME users already for about 15+ years so IMHO the missing ability to add them easily through gnome tweak tool or Gnome Control Center is a absurd stupidity and killed at least 5 times out of my time to solve and the solution is far from good … I understand that in future the GNOME developers want to make GNOME as modular as possible through GNOME Shell Extensions however if you're removing such an important functionality that's for ages in most mainstream operating systems such as M$ Windows / Mac OS is an insanity. Through my quick research online I found the Missing Desktop Icons is experienced by other people on other Linux distros besides Debian I saw complains by Ubuntu / Fedora and Arch Linux users in forums and mailing lists.
What puzzles me why the reaction of such a major complained are not seriously considered by GNOME developers, especially after all the problems with transition from GNOME 2 -> GNOME 3 which already pushed a lot of GNOME users to move from GNOME to KDE / MATE  (like in Linux Mint whose GUI is based on Linux Mint). Definitely such a general issues would drive further enthusiasts from GNU / Linux and makes a great harm to the Free Software software community.
Hopefully the missing desktop icons hell will be solved in upcoming GNOME releases.

Lenovo ThinkCentre Edge as an External monitor with Debian Linux on Thinkpad T420 / How to use ThinkCentre Edge as external display on Linux


September 22nd, 2018

thinkcentre-use-as-external-monitor-on-debian-gnu-linux-ubuntu

Here is a case I bring my Thinkpad T420 notebook to office place and there was plenty of monitors free but all were quite modern and had support only for Display Port / DVI and HDMI (High Definition Multimedia Interface), e.g. there was no Monitor to support regular VGA port …

 I've conntected my Debian 9 Stretch Linux with a DisplayPort cable to one of the LG monitors but the external monitor video screen did not raised the screen kept  black just like nothing is connected to it.

So i did a quick research online to see whether and how I can make the display port on Lenovo thinkpad t420 work with Linux after consulting few resources online e.g. Hacksr Display Port on Thinkpad T420 and Nvidia Optimus  this post in Ubuntu Forums as well as the official documentation about DisplayPort and Linux on Thinkpad's official documentation ThinkWiki it turned out the T420 Thinkpads have issues with Displayport and Linux and the only solution proposed was to use the second Nvidia Optimus card instead of the integrated display adapter, I however am not sure whether my notebook have this Nvidia at all and did not have time for too much hacking to make it work.

I decided to take a more simple approach and try to use the good old school VGA port protocol with one of the 2 ThinkCentre Edge  m93z stations that were hanging around in the office, in case you never heard of ThinkCentre Edge this is (an integrated computer and monitor in a thin display a kind of cheap PC alternative from Lenovo to iMacs (all in one Macintosh Desktop computer) .

ThinkCentre_Edge_computer-in-monitor-desktop-like-iMac-from_Lenovo

I saw some skeptical looks from colleagues but I with my usual stubborness gave it a try and after a bit of quick research I got it working on Linux ! 🙂
 

If you're wondering whether THINKCENTRE Edge can be used with VGA port as External Display to a Linux powered Laptop the Answer is YES  !!! 🙂


To make it working, 
All you have to do it is configure it as External display from ThinkCentre (OSD) display menu. 

thinkcentre-menus-osd-menu-screenshot

But wait the joy was not so full, even though the ThinkCentre displayed my GNOME FlashBack background picture on its screen it did not show my actual GNOME Menus (Application, Places and Desktop) just like shown in below screenshot ..

Debian-9-1-Stretch-Linux-background-default-picture

I could see fine the ThinkCentre monitor showing normally in xrandr command which is the tool to always check first if you're new on Linux and want to check settings regarding your Notebook display settings / Desktop PC exnternal display settings on Linux , the output of  xrandr is below.
 

hipo@jericho:~$ xrandr

 

Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096 LVDS1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1920x1200 60.0 +   1600x1200 60.0   1680x1050 60.0   1280x1024 76.0 75.0 72.0 60.0   1440x900 75.0 59.9   1152x864 75.0 1024x768 60.0*+ 800x600 60.3 56.2 640x480 59.9 VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 519mm x 324mm 1920x1200 60.0 + 1600x1200 60.0 1680x1050 60.0 1280x1024 76.0 75.0 72.0 60.0 1440x900 75.0 59.9 1152x864 75.0 1024x768 75.1 70.1 60.0* 832x624 74.6 800x600 72.2 75.0 60.3 640x480 72.8 75.0 66.7 60.0 720x400 70.1

I also gave a try to arandr which is a simple GUI interface to xrandr, i.e.:
 

root@jericho:~# apt-get install –yes -qq arandr
root@jericho:~# exit
hipo@jericho:~$  arandr


arandr-debian-gnu-linux-screenshot

Unfortunately trying to turn on / off the VGA monitor shown in above screenshot using arandr and saving did not produced any positive results, as the ThinkCentre Edge used as external monitor kept being showing only my Debian Linux background.

During my attempts to make it working I stumbled upon driconf a configuration applet program for Direct Rendering Infrastructure (DRI).

driconf-screenshot-linux

 

 

I also gave a try to default gnome-control-center Monitor settings tool but I couldn't turn off the notebook display in order to make the ThinkCentre Edge my primary display.

Finally after some more investigation online, I found how to switch on my Notebook display by running below xrandr command
 

xrandr –output LVDS-1 –off


Just in case if you need to re-enable (on) the LVDS-1 use 

 

xrandr -d :0 –output LVDS –auto​

Run custom user script after reboot with a cronjob on Linux


September 21st, 2018

howto-add-custom-script-on-reboot-with-non-administrative-root-user-on-gnu-linux

Perhaps you have a websites on a server on some Linux distro / FreeBSD / AIX / HP-UX / Sun OS that uses Vixie-cron cron jobs to run / respawn dead php / python perl scripts etc.  that do stuff on the server every lets say 30 minutes an hour or even every 12 / 24 hours in the background.
But sometimes due to server or Linux kernel upgrades you need to reboot the server with reboot command or shutdown -r now right in the minutes the scripts were supposed to run and do a database backup / synchronize some data with a remote MySQL with replication configured or do some site maintenance job such as clearing old Messages / Spam / data log file records.

Of course one possible workaround to that is to add the non-root user scripts in question  to /etc/rc.local to run on every server boot, but that fix requires a root access and very often developers did not have that, neither sysadmins are willing to bother  add a user sudo-ed scripts e.g. add  (sudo -u whateveruser "/path/to/script") to /etc/rc.local.

Run custom user  script after reboot the cron way

Happily there is ctually a better cron way to do that by telling crond to execute a cronjob during boot and assuming the non-admin user on the Linux has access to shell and access to using cron jobs by using @reboot cron direcive.

Here is few examples on how to run a re-run cron job on start up:
 

linux:~$ crontab -e


Some editor as nano or vim will open listing all your previous set system jobs to add scripts phpjob.php

@reboot  /user/dir/path/to/phpjob
@reboot  /path/to/shell_script
@reboot  /path/to/linux-command

That's pretty shitty situation but thanksfully remote access of website username with SSH will be enough to set the right cron activity (of course this can't be made for servers that are missing crond service running.

The scripts set in cron job that way will respawn right after the OS system had booted and there will be no need for them to wait the next hour to execute configured data synch.
For more on how to run a tiny script respawn every second using a single cron job check out my previous article How to set a crontab to execute commands on a seconds time interval on GNU / Linux and FreeBSD.

Historically it is interestingly to mention that in times before systemd appeared in modern Linux distributions,
a cool thack to run a script that had to be respawned every second after boot for a privileged user was to use /etc/inittab (no longer available in most all non System V Linux distrubutions in 2018), to do so
if you happen to still administer some old Linux servers CentOS 7 etc. you and you need to add a custom script to run and respawn all the time by including a line in /etc/inittab (again assuming a System V Linux is on remote machine):
 

mysvc:235:respawn:/home/me/bin/my_service_starter_script

Putting a service to respawn in that way via inittab uses init (process) and the kernel and keeps re-running it.

Note: 

If a command fails when it starts, and init is configured to restart it, it will use a lot of system resources: init starts it, it fails, init starts it, it fails, init starts it, it fails, and so on, ad infinitum. To prevent this, init will keep track of how often it restarts a command, and if the frequency grows to high, it will delay for five minutes before restarting again.If the kernel 
Using inittab should always be tested on a testbed before adding to remote server, note that if the script is using a lot of memory and keeps crashing it can easily leave out the kernel without memory and the system is about to get errors like:
 

process respawning too fast 

 

Another useful thing if you have doubts that the script might be crashing is to use something like monit to monitor the script (assuming the script does provide some kind of tcp / udp connection on port) and report you via email / sms about issues with crashing script.
If you hear monit the first time I recommend you read my previous article Monitoring and restart server services (Apache, Mysql, Bind) with Monit to prevent server downtimes.

Prepare (Burn) USB drive on Linux – Install Linux USB drive instead of CD / DVD


September 20th, 2018

prepare-burn-usb-drive-on-linux-install-linux-usb-drive-instead-of-cd

If you have a new Laptop and you planned to install a Linux any distribution OS on it but the laptop is a new hardware model and doesn't have a CD / DVD drive as most of notebook nowadays you might be wondering how to setup USB Linux bootable image, well you can simply use your favorite distro provided ISO (Debian / Ubuntu / Fedora) whatever burn it to a USB flash drive and boot from USB the Linux installer program. of course assuming ou have it configured in your UEFI BIOS.
For the task you need to Burn the respecive distribution ISO to the USB using simple command line.

To do so simply download your Linux distribution latest ISO file and issue with root in physical terminal / gnome-terminal or konsole.
 

cat debian-linux-iso-name.iso > /dev/sdb; sync

 

WARNING DATA DANGEROUS!!!
If you happen to keep any data on the USB flash drive, above command would wipe it out from USB drive so be sure to prepare your existing data a backup somewhere before proceeding.

Also beware to not provide the wrong /dev/sdb device to the command as you might end up wiping out your Hard Drive ( SDD ) drives or other attached external hard drives under /dev/sdb.
Thus in advance be sure to check the exact USB /dev/ name using commands such as:
 

linux:~# fdisk -l

Disk /dev/sdb: 3.8 GiB, 4007657472 bytes, 7827456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x04030201

 

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1        1080 7827455 7826376  3.7G  c W95 FAT32 (LBA)

 

linux:~# dmesg|grep -i sdb


dmesg – output is pretty verbose so I'm skipping completely its output.

 

linux:~# lsusb 
Bus 002 Device 004: ID 04b3:3107 IBM Corp. ThinkPad 800dpi Optical Travel Mouse
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 04f2:b221 Chicony Electronics Co., Ltd integrated camera
Bus 001 Device 014: ID 0951:1607 Kingston Technology DataTraveler 100
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

linux:~# lsblk |grep -i /media
└─sdb1                   8:17   1   3.7G  0 part /media/hipod/KINGSTON


An alternative way is to use the good old dd tool.

 

linux:~# dd if=/your/path/debian-7.5.0-amd64-netinst.iso of=/dev/sdb bs=4M
sync


Its even possible to create the bootable Linux image to USB with a simple cp command instead of catting like:

 

linux:~# cp Fedora-Workstation-Live-x86_64-28-1.1.iso /dev/sdX
sync

 

Finally unmount the USB drive (if it was mounted during the command operations):

linux:~# umount /media/hipod/KINGSTON

For Windows users to burn the ISO files you can use anything starting from Nero / CDBurnerXP or if you prefer free software use
Win32DiskImager or use Rufus to create it.

Enjoy booting and installing your Linux via USB 🙂

Create user and password on Linux non interactive and add it to sudo a tiny Dev Ops script


September 20th, 2018

Bash-Final-the-Bourne-again-shell-logo
A common task for SysAdmins who managed a multitude of servers remotely via Secure Shell was to add a user and assign password by using a script, this was sometimes necessery to set-up some system users and create access for university users on 10 / 20 testing Linux servers.

Nowadays this task of adding user to a list of remote servers and granting the new user superuser permissions through /etc/sudoers is practiced heavily by the so called Dev Ops (Just another Buziness Word for Senior System Admiistrators with good scripting skills and a little bit of development experience – same game different name.

The Dev Ops System Integration Engineers use this useful add non-interactive user via SSH in Cloud environments in order to prepare superuser (root permissioned through /etc/sudoers) user, that is later be used for lets say deployment on a few hundred of servers of lets say LAMP (Linux + Apache + MySQL + PHP) or LEMP (Linux NGINX MySQL PHP) or Software Load Balancer HAProxy  balacing for MySQL clusters / Nginx Application servers / JIRAs etc, through a Playbook script with some deployment automation tool such as Ansible.

Well enough talk here is the few lines of code which does create a user locally:
 

linux:~# apt-get install –yes sudo
linux:~# useradd devops –home /home/devops -s /bin/bash
linux:~# mkdir /home/devops
linux:~# chown -R devops:devops /home/devops
linux:~# echo 'username:testpass' | chpasswd


Though this lines could be invoked easily by passing it as arguments via ssh it is often unhandy to run them on remote host, because some of the remote hosts against executed, might have already the user existent with granted permissions for sudo

Thus a much better way to do things is use below script and first upload it to remote servers by running the scp command in a loop:

while read line; do
scp  root@$i:/root/
ssh "
create_user_noninteractive_and_add_to_sudoers.sh"
done < servers_list.txt


Where servers_list.txt contains a list of remote IPs:

#!/bin/bash
# Create new user/group and add nopasswd login to sudoers
# Author: Georgi Georgiev
# has to be run sa root – sudo devops
# hipo@pc-freak.net

 

u_id='devops';
g_id='devops';
pass='testpass';
sudoers_f='/etc/sudoers';

check_install_sudo ()  {
if [ $(dpkg –get-selections | cut -f1|grep -E ‘^sudo’) ]; then
apt-get install –yes sudo
else
        printf "Nothing to do sudo installed";
fi
}

check_install_user () {

if [ “$(sed -n “/$u_id/p” /etc/passwd|wc -l)” -eq 0 ]; then
apt-get install –yes sudo
apt-get install –yes sudo
useradd $u_id –home /home/$u_id
mkdir /home/$u_id
chown -R $u_id:$g_id /home/$u_id
echo "$u_id:$pass" | chpasswd
cp -rpf /etc/bash.bashrc /home/$u_id
if [ “$(sed -n “/$u_id/p” $sudoers_f|wc -l)” -eq “0” ]; then
echo "$u_id ALL=(ALL) NOPASSWD: ALL" >> $sudoers_f
else
        echo "$u_id existing. Exiting ..";
        exit 1;
fi

else
        echo "Will do nothing because $u_id exists";
fi

}

check_install_sudo;
check_install_user;


By the way this task was the simplest task given by a Company where I applied for a Dev Ops System Engineer, so I hope this will help someone else too.

P.S. If you prefer Shell scripts (even though much harder, time consuming etc.) as a mean of automation as an alternative to Ansible / Chef I suggest you check out and perhaps try to do the task with http://fuckingshellscripts.org 🙂

Install Slack and Mattermost clients for Start Up Business communication on Linux


September 19th, 2018

install-slack-and-mattermost-clients-for-start-up-business-communication-on-Linux
Many businesses nowadays are lookig for alternatives to the Microsoft dominated market of communication – Skype / Skype for Business Chat Audio and Video desktop client.
The two are the defacto standard for most of Corporate Businesses and is heavily used across most largest Corporations (companies) such as IBM / Xeror / DXC / CSC / Oracle / SAP / Microsoft / Amazon / Adobe … the list goes on and on.

However even though Skype is so easy to use across Microsoft Domain connected Computers the many start-up companies of today often try to avoid its use. The reason, well Skype is totally Proprietary non-transparent and by using it you probably get spied by Microsoft the CIA and God knows how many other Country Agencies. Besides that Skype has a bad history often had problems with Audio (Linux microphone and Video settings) in Free Software (Linux, FreeBSD etc.) realm and even though nowdays situation is improving and Skype Video / Audio runs fine on GNU / Linuxes its Skype for Business has no working release by Microsoft and has left-up Free Software users and Staring Business companies platform of the size of 20 to 1000 people  that choose Linux as a main Desktop / Work had to look for other ways to communicate internally within company and with clients.

Jabber XMPP communication protocol has been one alternative for a long time and historically many compainies that were running out of Skype use for their work often were using Small internally company hosted jabber servers, however as Jabber's  communication clients such as Gajim development is lagging behind seriously over the last 7 years and it prooved so buggy many businesses were looking for ways to avoid it.

Slack_Technologies_-corporate-communication-alternative-to-skype-Logo.png


Slack is multi platform just like Skype and has versions for Linux / Windows for macOS but its power comes mostly because most of its users use it via Skype Web Client (while Skype is a Desktop app and heavily used in Web Browser.

slack-web-communication-client-in-webbrowser-screenshot

Slack reminds in a what of things to the good old IRC chats and has channels in a similar fashion, it support Audio conversations but unfortunately at the moment didn't support Video.

The emergency of New Age of Computing and the quick adoption of Clouds as an aim to cut business costs put Jabber totally out of the game and in the niche and in August 2013 on the scene raised Slack (Team Messaging) which is an acronymi of (Searchable Log of All Conversations and Knowledge) – a cloud-based set of proprietary team collaboration tools and services, founded by Stewart Butterfield for the purpose of online Game (now defunct) called Glitch.

asana-for-slack-integration-2018-2-linux
The problem with Slack is that it is a freemium product, whose main paid features are the ability to search more than 10,000 archived messages (the ordinary free version allows the user to make up to 10000 searches in chat history), the paid Slack versions adds also unlimited apps and integrations and theoretically unlimited number of users (though this is seriously doubtful).

slack-10000-messages-per-user-limitation-shot

One very handy feature of Slack is its integration with "The World's Leading Software Development Platform" – GitHub .

To solve the problem with the little amount of Slack Chat history in Users conversations many Start-Up Business Companies do use Slack as a communication media with Clients and does often use as a communication Media another very popular Cloud messaging Open Source Software called Mattermost deploys to Cloud infrastruture but is at IT control of your company or your hired support and not third party vendor supports, making it a great communication tool for small and mid-sized companies who want to save money of purchasing a special server and hiring an admin or paying for one to support it all the time but instead directly use their Cloud account and deploy it there.

Mattermost is capable to Reach anyone, anywhere on any device. From the airport to data center, safely connect teams with EMM apps, hybrid cloud deployment and enterprise-grade flexibility to meet the unique needs of enterprise.

It is capable to Integrate with existing applications and build new workflows and empower your teams especially operations and DevOps – to perform faster and effectively. Mattermost


To install Slack on Linux:

Go and Download slack from Slack Linux download (the DEB / RPM 64 bit package)

As of time of writting this article latest Slack Desktop packages are: slack-desktop-3.3.1-amd64.deb and slack-3.3.1-0.1.fc21.x86_64.rpm

Depending on the type of Linux distribution install it with dpkg or rpm

1. Installing Slack Desktop client on Debian / Ubuntu Linux

On Debian / Ubuntu / Mint install Slack with:

 

root@ubuntu:~# dpkg -i slack-desktop-*.deb


For Ubuntu users there is also unofficial third-party Slack app ScoudCloud

it integrates well with Ubuntu Unity desktop (which I personally dislike 🙂 ) and gives you some extra goodies such as showing in an Unity manner unread message count, notification, bubbles, unity quicklists for fast-switching between Slack channels etc.

2. Installing Slack Desktop client on Redhat / Fedora / CentOS Linux

On Redhat / Fedora / CentOS install it with:

 

[root@fedora ~]:# rpm -ivh slack-*.rpm

 


3. Installing Mattermost Desktop client on Linux

mattermost-open-source-communication-in-the-cloud

Download Mattermost Linux package from download URL here

As of time of writting the DEB versions are mattermost-desktop-4.1.2-linux-amd64.deb mattermost-desktop-4.1.2-linux-i386.deb and there is no official RPM package for Fedora / CentOS users however I guess the .deb package can easily be converted to .rpm with alien tool.

To install Mattermost on Debian (in moment of writting September 2018):

 

root@debian:~# wget https://releases.mattermost.com/desktop/4.1.2/mattermost-desktop-4.1.2-linux-amd64.deb

 

root@debian:~# dpkg -i mattermost-desktop-4.1.2-linux-amd64.deb


mattermost-linux-client-2-screenshot

Mattermost supports file attachment (send) / Video previews (you can play sent Web videos directly within the Mattermost client) and on experimental level even supports Video and Audio Calls.

mattermost-linux-client-screenshot-1

mattermost-markdown-help-linux-screenshot

One nice feature of Mattermost for those who love coding is using tags to format messages

There is plenty of features of Mattermost among the best ones are integrations Private Cloud open source integrations (Jira, Jenkins, Bots, clients), supports Webhooks, Restful APIS, CLI and Public Cloud connections via Zapier – a connect and uatomate workflows e.g. gives you ability to move info between web apps automatically.

Install Jenkins software development automation server on GNU / Linux


September 18th, 2018

jenkins-automate-installation-on-logo-title

As I have gone through a hiring procedures for Dev Ops system administration (Senior System Engineer) positions in the largest IT company in Belarus EPAM (A Global provider for software engineering and IT consulting.one of the Dev Ops test tasks to do was to automate installation of Jenkins software development automation server on a Virtual Machine running Linust Guest of choice (VMWare / VirtualBox) with Ansible / Docker or Pure Shell Script as I love simplicity I choose to do it via Bash Shell script.

As Dev Ops position is more and more transforming into a programmer job into the New Age of non-sense Cloud Computing (I hate Clouds guys – I share Richard Stallman opinion that "Clouds are clouding your minds" !!! ) … the need for environments such as Jenkins allowing multiple pseudo "sys admins" (mostly copy / paste new age coders) to write and build there programs in Go Language / Python / Perl / Bash with a single environment for Continuous Integration (CI) that could deploy and keep software versionings in GitHub / Mercurial / SVN is exponentionally raising.

Old School Computer Geeks would definitely be amazed (reasonably) on why on earth would someone need a Web Based Java Crazy environment that Jenkins is to build a multiple language code and submit it to a source repository system
But as the people like to hype and make easy things harder adding more and more layers of complexity, the product is the new buziness hype terms Continuous Integration / Continuous Integration raise exponentially together with the softwares to do stuff.
As IT people are becoming more and more lazy and illitetelarete things like Jenkins is the next web development CI environment that is about to die in the coming 5 to 10 years.

Jenkins doesn't really cut the need for writting scrpits to make your application (Makefiles), for the Business Corporate world it is heavily used nowadays, because it is used to building projects using Web UI, running tests, doing static code analysis, and deploying.

What makes Jenkins in terms of IT architecture design solution is that every project that it builds is build via its Java Virtuam Machine Processor backend (the server itself runs in the background of the OS runs it through Java VM as a WAR file (Web Application Resource) with the help of Few Ruby and other scripted files.
Besides that JNS has in the moment of writting more than 1400 years spanning across platforms, UI, administration, source code management, and, most frequently, build management.

Jenkins is either used as a standalone server or as a servlet in Java app servers such as Tomcat.

This is the short script I came up with in bash that when executed installs Jenkins on the remote VM host server that ran Debian 9 Linux, the install_jenkins.sh script is downloadable here.

#!/bin/bash
# Install jenkins and test whether it runs prints password on prompt or send via email
# if email variable is set Jenkins password will be set to your email of choice using mail command
# NOTE: bsd-mailx package should be installed in order for email sent to work and local machine should be running a properly configured
# relay SMTP
# Author: Georgi Georgiev 
# hipo@pc-freak.net
email='hipo@mail.com';

add_repos_install_jenkins () {
apt-get install –yes -qq apt-transport-https git curl

wget -q -O – https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add –

if [ “$(sed -n ‘/jenkins/p’ /etc/apt/sources.list|wc -l)” -eq 0 ]; then
echo 'deb https://pkg.jenkins.io/debian binary/' >> /etc/apt/sources.list
fi

apt-get update -qq && apt-get install –yes -qq jenkins
}

check_j_install () {
if [[ “$(dpkg –get-selections | cut -f1|grep -i jenkins)” ]]; then echo 'succesfully installed'; 

else printf 'Problem in installing please check'; 
exit 1; 

fi

}

check_j_running_s_pass () {
if [[ $(ps -e -o command|grep -i jenkins) ]]; then 
echo 'Jenkins process working.'; 
echo ‘… do more here if necessery with some more commands’; 
else 
echo 'not working log to file' >> jenkins.log 
exit 1; 
fi

JENKINS_PASSWORD=`cat cat /var/lib/jenkins/secrets/initialAdminPassword`;
echo "Jenkins Admin password is $JENKINS_PASSWORD" | tee -a "jenkins_credentials.log";
if [ ! -z $email ]; then
echo $JENKINS_PASSWORD | mail -s "NEW Jenkins password" $email


fi

}

main () {
        add_repos_install_jenkins;
        check_j_install;
        check_j_running_s_pass;

}

main;

To run the script on the remote VM server started for the purpose I created a passwordless ssh key authentication with
 

ssh-keygen -t rsa


and 

 

ssh-copy-id -i ~/.ssh/id_dsa.pub root@remote-vm-host.com

 


command … for more check out my previous article "How to execute command to Multiple Servers / Establishing passwordless SSH key authentication on 50+ servers"

Once the passwordless authentication was established to remote Private Virtual Server I've used scp command to upload my install_jenkins.sh script with:

 

# scp -v install_jenkins.sh root@remote-vm-host.com:/root/install_jenkins.sh

Sending file modes: C0644 726 install_jenkins.sh
Sink: C0644 726 install_jenkins.sh
install_jenkins.sh              


Next to run the install_jenkins.sh on remote host I used remote SSH run command capability, the syntax goes like this:

 

 

 

ssh [USER-NAME]@[REMOTE-HOST] [command or script]


In that case the command I used was:

 

ssh root@remote-vm-host.com "chmod +x; /root/jenkins.sh"

 


Next I launched Firefox browser and accessed http://localhost:8080 on the VM host and used the long password generated from the script by command:

 

 

 

JENKINS_PASSWORD=`cat cat /var/lib/jenkins/secrets/initialAdminPassword`;


echo $JENKINS_PASSWORD

In the process of Initial Jenkins setup I selected the GitHub plugins necessery for me to connect Jenkins with GitHub WebHooks (for that perhaps I will write another article when I have time).

jenkins-plugin-installer-screenshot-linux-large

Jenkins Getting Started Initial Screen

jenkins-selecting-plugins-to-use-getting-started

Jenkins Selecting Plugins Screen

Once successfully set-up Jenkins Initial Project creation / Configuration ( Control Panel ) screen looks like so

jenkins-main-screen-successfully-deployed-on-gnu-linux

There was also a task to create a simple print Jenkins and Shell environment variables with a sample Jenkins Free Style Project.
Following 
the New Item menu and setting it to Execute Shell commands as a Build Parameters, the parameters set for the Jenkins Free Style Project to Print the Environment Varibles were like so:

 

 

 

 

 

 

#!/bin/sh

echo “Jenskins Environment Variables”

echo "BUILD_NUMBER" :: $BUILD_NUMBER

echo "BUILD_ID" :: $BUILD_ID

echo "BUILD_DISPLAY_NAME" :: $BUILD_DISPLAY_NAME

echo "JOB_NAME" :: $JOB_NAME

echo "JOB_BASE_NAME" :: $JOB_BASE_NAME

echo "BUILD_TAG" :: $BUILD_TAG

echo "EXECUTOR_NUMBER" :: $EXECUTOR_NUMBER

echo "NODE_NAME" :: $NODE_NAME

echo "NODE_LABELS" :: $NODE_LABELS

echo "WORKSPACE" :: $WORKSPACE

echo "JENKINS_HOME" :: $JENKINS_HOME

echo "JENKINS_URL" :: $JENKINS_URL

echo "BUILD_URL" ::$BUILD_URL

echo "JOB_URL" :: $JOB_URL

echo “===Linux Shell Variables ===”
env


Well, it wasn't really a rocket science was it?! 🙂

That's all folks, see you soon.

Fix Mac OS X camera problems – Tell which application is using Mac OS X builtin Camera


September 16th, 2018

http://pc-freak.net/images/macosx-check-what-process-is-using-camera-screenshot
It is a common problem on Mac OS X notebooks (MacBook Air , MacBook Proc)  with builtin Video Camera to have issues with Camera in Facetime, Skype and other applications which use it.

Considering that the Camera is physically working on the Mac (it did not burn etc.) and it stooped working suddenly (is not detected by Mac OS applications which support it), the most common cause for that is the fact that another application running on the system is using it.
With the spread of spyware and malware that can easily hit your computer by exploiting Javascript bugs in browser intepreter (Firefox, Chrome, Chrome) it is not impossible that your Mac PC got infected with a kind of WebCam spy software that keeps your Video Camera active all time.

Webcam spying is a real issue of today so to secure yourself partially you can place Oversight App to get notifications when an application starts using Mac's Webcam or audio.

Open Finder and run Terminal to check whether the Web Camera is used by some of the Mac running processes.

 

Applications -> Utilities -> Terminal

 


macosx-utilities-terminal-osx-screenshot

 

 

 

MacBook-Air:Volumes root#  lsof | grep "AppleCamera"

 

You should see one or more results. If you don’t see any results, try running the following commands as well.
One of the below commands may be necessary if you’re using an older version of macOS.

 

MacBook-Air:Volumes root#  lsof | grep "iSight"

 

MacBook-Air:Volumes root#  lsof | grep "VDC"

 

If VDCAssistant process shows running kill it.
 

MacBook-Air:Volumes root#  killall -9 VDCAssistant

 

 

 

http://pc-freak.net/images/macosx-check-what-process-is-using-camera-screenshot

You can also check whether the Mac Camera is being detected by Mac OS with system_profiler command (this is Mac's equivalent of Linux's lspci / lsusb / lshw / dmidecode for more on the topic you can check my previous article Get hardware system info on Linux etc.)
 

/usr/sbin/system_profiler

 

 

   Type8Camera::12.781 system_profiler[1075:84585] Exception NSInvalidArgumentE
      Version: 10,1
      Obtained from: Apple
      Last Modified: 13.12.2017, 9:34
      Kind: Intel
      64-Bit (Intel): Yes
      Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA
      Location: /System/Library/Image Capture/Devices/Type8Camera.app
      Get Info String: 10.1, © Copyright 2002-2014 Apple Inc. All rights reserved.

    Type5Camera:

      Version: 10,1
      Obtained from: Apple
      Last Modified: 13.12.2017, 9:34
      Kind: Intel
      64-Bit (Intel): Yes
      Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA
      Location: /System/Library/Image Capture/Devices/Type5Camera.app
      Get Info String: 10.1, © Copyright 2001-2014 Apple Inc. All rights reserve

.

    Type4Camera:

      Version: 10,1
      Obtained from: Apple
      Last Modified: 13.12.2017, 9:34
      Kind: Intel
      64-Bit (Intel): Yes
      Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA
      Location: /System/Library/Image Capture/Devices/Type4Camera.app
      Get Info String: 10.1, © Copyright 2001-2014 Apple Inc. All rights reserved.

    PTPCamera:

      Version: 10,1
      Obtained from: Apple
      Last Modified: 13.12.2017, 9:34
      Kind: Intel
      64-Bit (Intel): Yes
      Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA

How to list and uninstall installed Mac OS X packages command


September 15th, 2018

how-to-list-and-remove-packages-on-Mac-OS-X-MacBook-Air-Pro-notebooks-with-commands-Terminal
1. Listing All installed packages (.pkg) files on Mac OS X

If you are used to Linux package management (with dpkg .deb package tool or Redhat's .rpm package manager rpm command) and out of a suddeny you have to use for some time or permanently choose to migrate to Mac OS X and joined the Jailed closed Computer model of Mr. Steve Jobs.

As a Linux command addict,yYou might be wondering on how to list all installed packages on Mac OS with a command just like you use Debian / Ubuntus terminal to list installed packages and their overall state for example with dpkg with:

dpkg -l

or Fedora / CentOS to list all installed packages you're pretty much accustomed to:
 

rpm -qa

The same is possible in Mac OS X by opening Terminal and running cmd:

 

MacBook-Air:Volumes root# pkgutil –pkgs

om.apple.pkg.OSX_10_13_IncompatibleAppList.16U1254
com.apple.pkg.MRTConfigData.16U4001
com.apple.pkg.ChineseWordlistUpdate.14U1355
com.apple.pkg.GatekeeperConfigData.16U1300
com.apple.pkg.MRTConfigData.16U4003
com.apple.pkg.ChineseWordlistUpdate.14U1356
com.apple.pkg.ChineseWordlistUpdate.14U1346
com.apple.pkg.GatekeeperConfigData.16U1259
com.apple.pkg.GatekeeperConfigData.16U1265
com.apple.pkg.XProtectPlistConfigData.16U4009
com.apple.pkg.ChineseWordlistUpdate.14U1353
com.apple.pkg.ChineseWordlistUpdate.14U1347
com.apple.pkg.ChineseWordlistUpdate.14U1351
com.apple.pkg.MRTConfigData.16U4038
com.apple.pkg.iTunesX.12.7.3.delta
com.apple.pkg.XProtectPlistConfigData.14U4058
com.apple.pkg.GatekeeperConfigData.16U1138
com.apple.pkg.MLVUpdate_en_GB_daniel.16U1127
com.apple.pkg.EmbeddedOSFirmware
com.apple.pkg.MRTConfigData.16U4005
com.apple.pkg.ChineseWordlistUpdate.14U1323
com.apple.pkg.GatekeeperConfigData.16U1572
com.apple.pkg.iTunesX.12.7.delta
com.apple.pkg.MRT.14U2321

For the sake of convenience run it with a pipe to less cmd:

MacBook-Air:Volumes root# pkgutil –pkgs | less

To find whether a package with a certain name is installed or not

mac-os-x-listing-installed-operating-system-packages-with-pkgutil-command

MacBook-Air:Volumes root# pkgutil –pkgs|grep -i oracle
com.oracle.jre|


To further list the content of the package (the package files contained and directory structure etc.)

 

MacBook-Air:Volumes root# pkgutil –files the-package-name.pkg

 

this is like the Linux equivalent of
dpkg -L packagename and rpm -qa rpm-packagename:

Checking the package directory location on Mac OS is done with:

 

MacBook-Air:Volumes root#  pkgutil –pkg-info com.oracle.jre
package-id: com.oracle.jre
version: 1.0
volume: /
location: Library/Internet Plug-Ins/JavaAppletPlugin.plugin
install-time: 1523533193

 


2. Deleting a Mac OS X package .pkg 
 

After reviewing the .pkg file content for smaller sized packages the best way to remove it is to manually remove all files belonging to the package (but before make sure you are not deleting an important packageand have visually closely inspected them otherwise you might break badly your Mac OS X  …) you can run below 2 commands to delete package files and directory:

 

# pkgutil –only-files –files the-package-name.pkg | tr '\n' '\0' | xargs -n 1 -0 sudo rm -f
# pkgutil –only-dirs –files the-package-name.pkg | tail -r | tr '\n' '\0' | xargs -n 1 -0 sudo rmdir

 

Once you have removed the files you can remove the receipt (e.g. remove it from Mac package database), with:
 

# pkgutil –forget the-package-name.pkg

 

pkgutil –forget is useful if you get errors during removal attempt with pkgutil –only-files … , pkgutil –only-dirs …. cmds.
 

Note that to remove a package you have to be root  or run the commands via sudo with admin privileges if you have it installed and using it.

When removing the files be extremely careful as some of the packages you might try to remove might be updating important Mac OS X system components or used as a backbone for the overall Mac OS GUI / background operations thus removing a system related package might leave your MacBook unbootable because of the removal of the necessery component …

If you get some errors while issuing some of the 2 above commands like:

"Operation not permitted when trying to uninstall" this is because  the command or directory you're trying to remove is in current use by a running process on the Mac OS or because the file or directory has a special set permissions to prevent them from easy removal (as a precaution OS safety measures).

You might wonder what might be the purpose of a manual command removal of Mac package but, If you have to regularly delete Mac OS X packages by scripting the removal of unnecessery packages or Mac OS X updates on a many numbers of computers to automate removal jobs.
I've found also a github repository bash shell script that is automating the process of removal and could even save further time if in need to script a package information about Macs and be able to easily manage packages of mac Desktops via (lets say SSH), check out pkg-remove.sh script here.

Mass substitute WordPress site Old domain URL to new URL in MySQL (MariaDB) database after website migration


September 13th, 2018

mass-substitute-old-urls-to-new-urls-when-moving-wordpress-website-migrate-wordpress

Mass substitute WordPress site Old domain URL to new URL in MySQL (MariaDB) database after website migration

If you have just migrated a wordpress blog or site to a new server (domain URL) and you have many articles pointing to the old URL. Out of sudden the new domain will end up with many broken links and that would have a severe negative SEO effect on your website leading to a certain downfall of your number of daily unique visits.

Of course manually changing the URL links is achievable by going through all Published Posts when migrating small websites with 10-20 pages,  however it is an impossible tedious task you would definitely want to avoid when you're migrating large WP based websites with few hundred or thousands of posts / pages,
bacause this would be a few weeks of mindless repeatable job to go through each and every post and substite the broken URLs.

Fortunately with a little bit of SQL magic either through MySQL CLI or PHPMyAdmin (if the website is moved to a shared hosting where you have disabled access to MySQL (MariaDB) default connect tcp port 3306.

Depending on the type of WordPress or Website the old broken URLs might be located in various Database tables.
 

– So when Mass URL substitution is might be required ?


1. You migrate a Website http://what-ever-website.com with (PHP / CSS / HTML / Templates) etc. from Hosting Provider Hostgator.com to UK2.com (because the website target client changed lately to United Kingdom customers) to http://what-ever-website.co.uk and the site is moved to a new domain beacause of Business rebranding
 

2. Other reason for changing internal URLs from one URL to another might be if you're migrating your website from HTTP to HTTPS for security.

3. You are restructuring file storage / image directories on the server or due to migration of files to external CDN (Content Delivery Network).
For example (http://your-server.com/images/ , http://your-server.com/files )  URLs pointing to old website location subdirectory has to be changed to the new one (http://your-server.com/img/ , http://your-server.com/data)

 

– So what is the automated approach to solve the task of Mass URL substitution across WP site ?

 

  •  Create full backup of all your website database and double-check the backup (try to restore on a test (home) server or other hosting account to make sure the backup is consistent and restore would work normally if necessery
     
  • You can Create Backup either with mysqldump command tool manually … with the right command arguments or use some kind of script such as My tiny mysqlbackupper.sh shell script which I shared under my previous article Make daily MySQL on Linux backup with Shell Script  via PhpMyAdmin.


2. Change old website URL to new one directly from Database using MySQL text client
 

To change incorrect URL with the new correct one the general query to run is:

 

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find string’, ‘replace string’);

 

To change old website URL to the new website URL across every table within the wordpress database use below queries:
 

hipo@linux:~$ mysql -u root -p
Enter password:

 

USE blog;

 

UPDATE wp_options SET option_value = replace(option_value, 'Existing (old) URL', 'New URL') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content, 'Existing (old)URL', 'New URL');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'Existing (old) URL','New URL');

UPDATE wp_usermeta SET meta_value = replace(meta_value, 'Existing (old) URL','New URL');

UPDATE wp_links SET link_url = replace(link_url, 'Existing (old) URL','New URL');

UPDATE wp_comments SET comment_content = replace(comment_content , 'Existing (old) URL','New URL');


3. Replace Old website URL to New one after migration using PHPMyAdmin web interface
 

If you don't have access  ssh shell, you can also run the queries via PhpMyAdmin to do so:

1. Open PHPMyadmin URL Panel in browser and login with your user / pass

2. Choose the wordpress database of the wordpress site / blog

3. Select SQL tab and in the panel type on above given SQL queries
 

web-hosting-phpmyadmin-sql-query-tab-screenshot-how-to-run-sql-queries-via-phpmyadmin

If you're lazy to type there is also a web based SQL queries generator tool for moving websites to a new domain


4. Using Search and Replace WordPress plugin to do the old URL to new URL (strings) transition
 

If you have never used SQL queries and you're totally new to it and don't want to risk breaking up something there is also a bunch of wordpress plugins available that do the URL string substitution throughout each wordpress table in a WP database one such WordPress plugin is Search and Replace I have written earlier an article Change string in all WordPress Posts with Search and Replace plugin.


5. Problems with data-serialization
 

If you do a simple search and replace of Old domain urls to New ones, using above given commands and you still end up with some broken links on WP Pages that might be due to data-serialization issues (for the cause of issues check out what is data serialization).
Data serialization in wordpress terms is an array of PHP encrypted data that contains the actual URL, thus a simple search and replace as explained above if URLs use data-serialization would not work. There are available tools online that does URL search and replace operation through  "serialize-data sensitively" if you stuck with data-serializatoin caused issues.

Besides that for there are written scripts that does URL substitution to a WordPress or Joomla websites so an alternative to above WP plugin to replace the URL after migration is to use one of the scripts available a very famous one that will do pain-free all URL / string substitutions inside your WP, Drupal,  Joomla databses is interconnect/it.
 

Few closure words
 

As a system administrator and webmaster I have migrated wordpress installations many times with the need to change the old URLs to a new ones for both customer websites and my own wordpress based. On many ocassions because of lack of attention and hurry, I've messed up things.
The moral I got out of this is when you're doing a WordPress migration just like everything you have to be very attentive and do everything step by step slowly and have a good idea on what you're doing in advance …

Even as a person who had overall idea on how MySQL Server works and have experience in writting SQL queries, I have to confess I've  made mistakes during URL substitution operations when doing it via the MySQL CLI every now and then.

Thus I would recommend you better use some of the many plugins for wordpress and script tools (few of which I mentioned above), especially if you're not having at least few years with some kind of UNIX variation / Linux / MySQL.