Posts Tagged ‘use’

How to synchronize with / from Remote FTP server using LFTP like with rsync

Sunday, October 15th, 2017

how-to-synchronize-from-remote-ftp-server-easily-like-rsync.jpg

Have you ever been in a need to easily synchronize with a remote host which only runs FTP server?

Or are you in a local network and you need to mirror a directory or a couple of directories in a fast and easy to remember way?

If so then you'll be happy to use below LFTP command that is doing pretty much the same as Rsync, with only difference that it can mirror files over FTP (old but gold File Transfer Protocol).
 

lftp -u FTP_USERNAME,FTP_PASSWORD -e 'mirror REMOTE_DIRECTORY LOCAL_DIRECTORY' FTP_SERVER_HOSTNAME


Enjoy and thanks to my dear friend Amridikon for the tip ! 🙂

How to enable Control Alt Backspace to Kill X server on Debian / Ubuntu Linux

Thursday, September 28th, 2017

kill-X-server-switch-revert-back-to-ctrl-alt-backspace-howto
Being a long time GNU / Linux user, I've been quite dissatisfied for the fact that in latest Debian and Ubuntu Linux, the default Key combination to Kill X (CTRL + ALT + BACKSPACE) is no longer working.

Though nowdays Xorg (XServer) is pretty stable it still happens from time to time for some application to overload the PC badly and make Gnome or KDE environment little or no responsive at all and here comes the goody CTRL + ALT + BACKSPACE it is pretty much  like  (CTRL + ALT + DEL) did restarted the computer in DOS and earlier Windows OS-es once the environment became unusable with the only difference that just Xorg server is restarted and the other using programs that are in background work just like they used to. 

CTRL + ALT + Backspace is a great thing to use especially if you're running some homebrew server and you use it both as a Server with some few little websites and as a Desktop environment to browse the net and do basic stuff.

So here comes the question how to make the CTRL + ALT + BACKSPACE keyboard combination be killing Xserver like in the good old days?

The easiest way to do it interactively in ncurses interface is by  running:

 

root@noah:~# dpkg-reconfigure keyboard-configuration

 

If somehow on the machine you don't have dpkg-reconfigure or you prefer to do set CTRL + ALT + BACKSPACE Kill Switch manually edit /etc/default/keyboard 

inside change value of

 

XKBOPTIONS="terminate:ctrl_alt_bksp" 

 

like shown below file:

root@noah:/home/hipo# cat  /etc/default/keyboard

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS="terminate:ctrl_alt_bksp"

BACKSPACE="guess"

The configuration should be working across Debian 7, 8, 9 as well as Ubuntu 12 ..14 .. 16 and hopefully in future releases too, just as many other Linux distributions like Mint etc. the Xserver Kill Switch setting should be located in same file.

Finally if even after that change the Control Alt BackSpace Kill Switch sequence refuses to work in GNOME Desktop environment, it might be due to a local setting typical for GNOME and this should be fixed via the good known gnome-tweak-tool

So GNOME users should run it from command line and check the setting there, e.g.:

 

$ gnome-tweak-tool


You should check:


 

Typing -> Kill Sequence to Kill the X Server

 


it should look like shown in below screenshot:

how-to-set-X-server-kill-switch-in-GNOME-gnak-tool-screenshot-debian-stretch

 

 

 

 

Bessarabian Bulgarians – A short documentary about 380 000 Bulgarians who live today in Territory of Moldova

Wednesday, January 30th, 2013


 

 Bessarabian Bulgarians in Moldova ex-Romania – documentary movie

Very few Bulgarians nowadays know well their history. Bulgaria has glorious and rich history. After the liberation of Bulgaria many Bulgarians migrated to Russia and Moldova, to escape the fierce wars and mass killingins from Ottoman Turkish. Nowdays most of people who live in Bulgaria has negative attitude towards our homeland. Few are those that know that 1000 kilometers from Bulgaria there are more Bulgarians, who are trying hard to preserve their nationality. It is very curious, that most of Bulgarians nowadays want to emigrate in Western countries, where Besarabian Bulgarians think and dream of going back to Bulgaria. I think we Bulgarians should re-think well before we think about emigration and try to do more for our country instead of having the post-communist and still rooted by communist negativism and pessimism that is ruling us.
 

Bulgarian Traditions of Bessarabian Bulgarians

(Note to make here is a lot of the commentaries on the video are junk especially concerning religion). Below is interesting statistics about Bulgarians who live on the lands of Besarabia. It was curious for me in Besarabia there is also Bulgarian schools and even Bulgarian universiy! There is also a city named BOLGRAD (BOLGAR GRAD – city of Bulgarians),

The general count of Besarabian Bulgarians in Republic of Moldova and Ukraine are about 230 000  There are also 151 596 who are Turkish speaking Bulgarians (Gagauzi). The complete number of Bulgarians Living in Besarabia is about 380 000!

In Ukraine, the number of Bessarabian Bulgarians is estimated at over 129,000 in Budjak (in the Odessa Oblast in the southern part of the country), and 75,000 elsewhere (mostly in other parts of Southern Ukraine), according to the 2001 Ukrainian Census, which counted a total of 204,600 Bulgarians in Ukraine. Bulgarians are a majority in Bolhrad District (45,600 of its 75,000 inhabitants), but they also inhabit other districts of Budjak: Arciz – 20,200 of the 51,700, Tarutino – 17,000 of the 45,200, Izmail – 14,100 of the 54,700, and Sarata – 10,000 of the 49,900. There are also 8,600 Bulgarians in the city of Izmayil (85,100 total population). Outside Budjak, Odessa has many Bulgarians that have moved there in recent years. The city of Bilhorod-Dnistrovsky is about 4% Bulgarian, making them the third-largest ethnicity there. The results of the census held in October 2004, there are 65,072 Bessarabian Bulgarians (1.95% of the population) in Moldova (excluding the region of Transnistria), concentrated mostly in the southern parts — chiefly in Taraclia district. In the census held in November 2004 in Transnistria, 3,164 (3.16%) Bulgarians have been counted in Tighina and surroundings and further 10,515 (2.39%) on the Eastern bank of the river Dnestr. 29,447 Bulgarians live in the cities (and represent 2.26% of the urban dwellers), and 36,215 live in the countryside (1.74% of the rural inhabitants). 90.60% of ethnic Bulgarians were born in Moldova (the national average is 94.6%), 5,968 (9.09%) in other countries that were once in the Soviet Union (the national average is 5.16%), and 199 (0.30%) were born elsewhere. In Moldova (and likely Ukraine too, although statistics are not available here), the Bulgarians tend to use their native Bulgarian in rural areas, and Russian (instead of the majority language Romanian) in cities and towns. 53,178 or 80.99% of ethnic Bulgarians declared Bulgarian language as native (69.23% in urban areas, and 90.55% in rural ones), 2,766 or 4.21% of them declared Romanian language as native (4.91% in urban areas, and 3.64% in rural ones), 9,134 or 13.91% of them declared Russian language as native (25.08% in urban areas, and 4.83% in rural ones), and 584 or 0.89% of them declared another language as native (0.78% in urban areas, and 0.98% in rural ones). 35,808 or 54.53% of ethnic Bulgarians declared Bulgarian language as first language in daily use (36.81% in urban areas, and 68.95% in rural ones), 5,698 or 8.68% of them declared Moldovan language/Romanian language as first (7.93% in urban areas, and 9.29% in rural ones), 23,259 or 35.42% of them declared Russian language as first (54.45% in urban areas, and 19.95% in rural ones), and 897 or 1.37% of them declared another first language (0.81% in urban areas, and 1.81% in rural ones). Bessarabian Bulgarians represent 28,293, or 65.56% of the population of the Taraclia district. There are also Bulgarians in Chişinău (8,868, or 1.2%), Găgăuzia (8,013, or 5.1%), Cahul district (5,816, or 4.9%), Leova district (3,804, or 7.4%), and Cantemir district (3,736, or 6.2%). The share of ethnic Bulgarians in Transnistria is 10,515 (2.39%), of which 2,450 (1.55%) in Tiraspol, and 7,323 (8.44%) in Slobozia sub-district (which contains the village of Parcani). There are also 3,001 (3.09%) Bulgarians in the city of Tighina, and 342 in 3 suburbs. In total, there are 79,520 (2.02%) Bulgarians in Moldova, including Transnistria. Bessarabian Bulgarians represent a majority in one city of Moldova, Taraclia (10,732 Bulgarians, or 78%) and in 8 communes in the country:

SuperMarket Secrets and Deception a video explaining the badness of use of super-markets and how super market chains lie to us

Saturday, June 23rd, 2012

SUPERMARKET SECRETS & DECEPTIONS PART 1 (Full Video)
(AKA "How To Avoid Being Fooled at the Supermarket")

Today almost every country in both the developed the less-developed and the under-development world has already largely adopted the super market buying culture.
Not that the people are so keen on buying from super-market but rather it is the people with money business-es has slowly "forced" those fake buying culture.

Though things are organized so well and it seems like the supermarket is a great place all made to benefit the client it is exactly the other way around. The truth is the whole super-market with the most little details was designed to benefit the company owning the market.

Below is an interesting documentary, showing parts of how foods are processed before they enter the super-market shelf. Also it is explained, how the strive for perfect looking products takes its toll in terms of end-client quality. Though many fruit and vegetables looks perfectly looking (perfectly shaped) the nutrition this perfect vegs and fruits is often inferior to grown foods which are less symmetrical. Often this is evident even by tasting the fruits and vegetables bought, they somehow are tasteless or whether you eat it feels like you eat plastic.

The movie also wents through showing a lot of farms for growing cows for beef and milk and the bad conditions the animals lives their whole short live on earth. Also the fast food injections the animals are given often results in unexpected animal disease. The lack of movement and the short living space for animals is another severe problem as most of the animals does not grow the way God intended them to when he created the earth animals and us.

The offers to get 3 for the price of 1 or "pay 1 get 2" that so many super-market offer today is another sad story.

The expenses for this fall on the producer and the client instead on the super-market franchiser.

Another severe problem is the 'international logistics' applied by mostly all large super-market chains. At many cases foods grown or breed has to travel hundreds or thousands of kilometers for something as simple as cutting the meat or vegs and packaging them. So a food produced just 50 or 100 kilometers away from the local super-market from where we buy travels some 500 kilometers for the packaging and then comes back packaged in the super-store. As you can guess this increases significantly the price of the product for us the buyers and besides that creates a large environmental contamination.

Also the movie shows that often fruits and vegetables one can buy from local open market are both more nutritious than in super-markets as well as can be gotten on lower price.

Knowing all this it makes one wonder why anyone still is buying from the super-market. Well let me tell you it is because of habit. Through the last 50 years in most countries large supermarket chains successfully imposed the New Age super market culture. As a result for youngsters it is absolutely natural to purchase goods from the super market and buying from anywhere else is considered nowdays unusual.

The result of the lack of nutritious food we buy from the super market severe affects our health and budget. In many countries the over fatness of youngsters is a severe problem.

This problem has a direct relation with the culture of eating junk package food introduced within super markets as well as the over consumption which took place the last years again "thanks" to the huge increase of advertisement influence on people behavior and supermarkets profit only concerned company policies.

Skype remove word completion / Howto Disable spellcheck autocorrect on Mac OS X, Android Phones Tablets and IPhone iOS

Tuesday, March 14th, 2017

How-to-disable-auto-correct-on-MacOS-X-android-and-iphone

I've recently upgraded my wife's Mac Book Air Mac OS X release from Mountain Lion to latest available OS X release Yosemite and after upgrade the old version of Skype used for about 3 years without any problems (except camera issues due to mac OS X bug the old post is here) stopped working (did crashed) on Skype launch so I took few minutes to upgrade Skype as well from Skype.com Skype for Mac official download page after the quick and unproblematic Skype re-install, Skype client was back to normal with a shiny new outlook and on a first glimpse all worked like a charm but …

On the next day when I took use of temporary the upgraded Mac Book Air with the fresh new OS X Yosemite and Skype's latest app to to do a quick login with my Skype credentials noticed a very annoying autocorrect (auto spelling)  Skype behavior on any new input text message.

I have to admit the idea of autocorrect feature on a system wide scale is great however quick keyboard typers like me who are used to type more than a letter per second use to type so quickly that occasinally you do errors which you're quick to fix but anyhow errors are automatically corrected in a way that you have to retype the whole word quite often which makes your typing a hellish experience. Then the same auto-correct feature becomes a terrible experience and on any device I notice this behavior I tend to remove it immediately.

I remember  the same dictionary auto-spell check / corect behavior was present on my Android run ZTE blade 3 mobile after first Mobile boot and also present on my current iPhone 5 iOS and thus the first thing I did once I start using it is to remove autocorrect (auto spelling) feature and relax the irritation of it.

Just in case if you need to disable Spellcheck auto-correct on Android Phone or Tablet do it from

Settings -> Language & input

android-phone-tablet-disable-autocorrect-spell-check

If you happen to be using also IPhone 5 as me or  Iphone 6 / 7 to disable AutoCorrect feature on SMSes / Skype / Viber and other applications do it from Phone's:

Settings -> General

disable_Turn_off_AutoCorrect_in_IPhone_iOS

Shortly I've noticed that the auto-correct feature does not only mess up your typing in Skype but also in Mail and TweetDeck and generally any open application where you can type on Yosemite.


I've took the time to investigate quickly what was causing the new feature that bugged me so much online and came to this nice little article How to turnoff autocorrect on Mac OS X 10.11 El Captain

As the article revealed to Turn off the autocorrect Mac OS X feature you I have to go:

Finder -> System Preferences

 

stop-skype-autocorrect-annoying-macosx-yosemite-system-preferences-menu-screenshot

Click on Keyboard -> Text
and turn  Autocorrect off by unchecking Correct spelling automatically

stop-skype-autocorrect-annoying-macosx-yosemite-system-preferences-keyboard-menu-screenshot

By doing this autocorrect spelling is disabled for all applications, however for some people it might be handy to leave the correct feature for Mail app or Microsoft Office (Microsoft Word / Excel) etc. and only turn off (disable) the autorrect feature per application side.

You can  do this in the separate Applications (of choise where you need auto spelling) from  Edit Menu under Spelling and Grammer and enable / disableCheck Spelling While Typing

stop-skype-autocorrect-annoying-macosx-yosemite-spelling-and-grammar-menu-screenshot


Tadam Enjoy ! 🙂

 

Windows missing volume control on Windows 7, 8 Fix / How to run volume control from command line

Thursday, March 9th, 2017

windows-7-missing-volume-controller-bring-back-volume-control-windows-7-command-to-show-volume-control-on-windows-os

 

Windows 7/8 Volume Icon disappear from Taskbar?

If you are using  Windows 7 or  Windows 8 Operating System inside a corporate network and your notebook PC is inside domain controller controlled by some crazy administrators who for some reason decided to remove the Taskbar from your Taskbar tray you have come over to exactly same situation like I do here.

Actually some might have experienced an icon "combined" feature which gives the opportunity of some of the standard Tray icons we know since Windows 98 / XP onwards to not show full time in order to save you space. No doubt this feature is great one to use as it is distracting sometimes to have a tons of applications constantly keeping in the Taskbar (right down corner) however if the Active Domain admin did it without any notification and you're a kind of victim you might dislike especially since this behaviour is making you impossible to easily control your phone / headspeakers and mic.

 

windows-7-8-grouped-taskbar-icons-screenshot-volume-dialog-bar

If you check in the Control Panel and click on Sounds  menu in Windows 7/8, you don't see any checkbox for adding the icon back as I have assumed, , but instead all the audio there you can only see the inputs and outputs on your system general settings.

windows-7-8-control-panel-sounds-dialog-box-properties

This behavior was made on purpose and makes sense cauze the taskbar icons since Win XP (if not mistaken) has to be controlled by the taskbar settings pan.

Thus in order to bring back the disappeared icon on  Winblows 7 / Win 8 there is a taskbar properties feature enabling to to hide or view the various taskbar running apps in that number the Volume icon, hence to bring back your Volme Control speaker icon to taskbar you need to customize it.

To do so do a mouse Right-click anywhere on the taskbar and choose Properties.

taskbar-properties-windows-7-8-dialog

Now, click on the Customize button under Notification area.

taskbar-and-startmenu-menu-properties-customize-taskbar-dialog-bar

In  Notification Area Icons dialog box, there is 2 ticks to check. Assure yourself the volume icon default behavior is set to

Show icon and notifications like in below screenshot

show-icon-notifications-volume-bar-windows-7-8-dialog

To make the new behaviour active click on Turn system icons on or off.

turn-system-icons-on-off-windows-7-8-notification-restore-default-icon-behavior-dialog

One thing to note here is the volume icon shoukld be set to On like in below| shot:

 

turn-system-icons-on-off-volume-icon-on-windows-7-8
If the reason for the disapperance of the Volume controller in task is not due to Domain Controllear policty it could happen due to late updates pushed by Microsoft if the PC needs a restart or after computer Log off operation.
Another reason for the casual disappearance of sound box could be also a buggy driver, so if the icon keeps disappearing over and over again, you better try to update the driver for your sound card.

However if you end up in a Windows Domain Controller (AD) Policy that is prohibiting the Sound Voulme to appear on your taskbar like in my case all the above won't help you solve it, but luckily there is an easy way to invoke the Volume Control dialog box via

 

sndvol.exe

 

the command will bring up the Volume Control as in upper left corner of screen like in below screenshot:

windows-volume-mixer-taskbar-windows-7-8-shot

 

If you to show it with a silder use -f flag

sndvol.exe -f

Running just

sndvol.exe


opens the volume mixer, as you noted.

 

On windows XP the respective command to open a missing Volume Control dialog in taskbar, use instead:

sndvol32

command from Windows Command Prompt:

 

Start -> Run -> cmd.exe

 

sndvol32

no params to display master volume window

 

 

sndvol32 -x

to display small master volume window

sndvol32 -t

to display volume control only (as per sound icon)

If you have the Volume Controller behavior to be hidden or you need to view any other taskbar hidden application icon  it will be useful for you to use:

AutoHotKey Win+B to focus on the system tray, Left (arrow) to highlight the Volume Control icon icon, and then Enter to bring up the popup.

 

A good tip you might be interestted to use occasionally is  how to show the current Wireless networks via a command (if that's prohibited otherwise via GUI) so you can easily see the  Connected Networks on Windows using cmd:

rundll32 van.dll,RunVAN

Remove string line from file on Linux and BSD – Delete entire line with string from file

Tuesday, March 15th, 2016

linux-remove-lines-containing-string-with-sed

If you're already used too using grep -v "sometring" filename to print everything from a file without the certain grepped string output and you want to do the same to delete lines based on strings without having to output the grepped string to a file and then overwritting the original file:
 

grep -v 'whatever' filename > filename1
mv filename1 filename


A much better way to delete an whole line containing a string match from a file is to use sed
sed
should be the tool of choice especially if you're scripting because sed is especially made for such batch edittings.

Here is how to do delete an entire line based on a given string:

 

sed –in-place '/some string to search and delete/d' myfilename


It might be a good idea to also create backups just to make sure something doesn't get deleted incidently to do use:

sed –in-place=.bak '/some string to search and delete/d' myfilename

If you need to wipe out an exact string from all files within a folder you might use a for loop or perl (some good examples check my previous article here)

In short to use bash's for loop here is how to backup and remove all lines with a string match within all files within a Linux directory:

 

for f in *.txt; do sed –in-place '/some string/d'
"$f"; done
find -name '*.txt' -exec sed –in-place=.bak '/some
string/d' "{}" ';'

 

BTW SED is really rich editor and some people got so much into it that there is even a sed written text (console) version of arkanoid 🙂

sed-text-editor-written-arkanoid-game-linux-bsd

If you want to break the ice and get some fun in your boring sysadmin life get sed arkanoid code from here.
I have it installed under pc-freak.net free ASCII Games entertainment service, so if you want to give it a try just login and give a try.

Enjoy 🙂

chmod all directories permissions only and omit files (recursively) on Linux howto

Friday, March 11th, 2016

execute-write-read-of-user-group-and-others-on-linux-unix-bsd-explanationary-picture

If you mistakenly chmod-ed all files within directory full of multiple other subdirectories and files and you want to revert back and set a certain file permissions (read, wite execute) privileges only to all directories:
 

find /path/to/base/dir -type d -exec chmod 755 {} +


If there are too many files or directories you need to change mod use
 

chmod 755 $(find /path/to/base/dir -type d) chmod 644 $(find /path/to/base/dir -type f)

Above willl run evaluate $() all files searched and print them and pass them to chmod so if you have too many files / directories to change it will drastically reduce execution time.

An alternative and perhaps a better way to do it for those who don't remember by heart the chmod permission (numbers), use something like:
 

chmod -R u+rwX,go+rX,go-w /path

Below is arguments meaning:

    -R = recursively;
    u+rwX = Users can read, write and execute;
    go+rX = group and others can read and execute;
    go-w = group and others can't write

If like piping, a less efficient but still working way to change all directory permissions only is with:
 

find /path/to/base/dir -type d -print0 | xargs -0 chmod 755
find /path/to/base/dir -type f -print0 | xargs -0 chmod 644


For those who wish to automate and often do change permissions of only files or only directories it might be also nice to look at (chmod_dir_files-recursive.sh) shell script

Tadadam 🙂

 

Removing exim and installing qmail / Generate and install pseudo mta dummy package on Debian / Ubuntu etc. .deb based Linux

Thursday, March 10th, 2016

debian-dummy-mta-package-install-howto-tux-mail-nice-mascot
If you happen to be installing Qmail Mail server on a Debian or Ubuntu (.deb) based Linux, you will notice by default there will be some kind of MTA (Mail Transport Agent) already installed mail-transfer-agent package will be installed and because of Debian .deb package depedency to have an MTA always installed on the system you will be unable to remove Exim MTA without installing some other MTA (Postix / Qmail) etc.

This will be a problem for those like me who prefer to compile and install Qmail from source, thus to get around this it is necessery to create a dummy package that will trick the deb packaging depencies that actually mta-local MTA package is present on the server.

The way to go here is to use equivs (Circumvent debian package dependencies):
 

debian:~# apt-cache show equivs|grep -i desc -A 10

Description: Circumvent Debian package dependencies
 This package provides a tool to create trivial Debian packages.
 Typically these packages contain only dependency information, but they
 can also include normal installed files like other packages do.
 .
 One use for this is to create a metapackage: a package whose sole
 purpose is to declare dependencies and conflicts on other packages so
 that these will be automatically installed, upgraded, or removed.
 .
 Another use is to circumvent dependency checking: by letting dpkg
 think a particular package name and version is installed when it

Btw creating a .deb dummy package will be necessery in many other cases when you have to install from some third party debian repositories or some old and alrady unmaintaned deb-src packages for the sake of making some archaic software to resurrect somewhere, so sooner or later even if you're not into Mail servers you will certainly need equivs.

Then install equivs and go on proceeding creating the dummy mail-transport-agent package
 

debian:~# cd /tmp debian:~# cp -rpf /usr/share/doc/equivs/examples/mail-transport-agent.ctl . debian:~# equivs-build mail-transport-agent.ctl


Above command will build and package /tmp/mta-local_1.0_all.deb dummy package.
So continue and install it with dpkg as you use to install debian packages
 

 

debian:~# dpkg -i /tmp/mta-local_1.0_all.deb


From then on you can continue your standard LWQ – Life with Qmail or any other source based qmail installation with:

 

 

./config-fast mail.yourmaildomain.net


So that's it now .deb packaging system consistency will be complete so standard security package updates with apt-get and aptitude updates or dpkg -i third party custom software insatlls will not be breaking up any more.

Hope that helped someone 🙂