Facebook Twitter
Linkedin LJ
Git Instagram
IPv6

I write mostly about security, mail, web and linux. My contacts are: me@andreybondarenko.com, skype andrey.bondarenko, facetime shaman007@me.com, Telegram, FB chat, WhatsApp, +420-773-591-443. I am not using abondarenko@gmail.com and +7-903-7929724 any more and you will not find me in Moscow, Russia. My CV. This site can use cookies.

17QxrNyk9BCrP6LGUbqCNnXCzu4oeoYKaH (btc) 0x57500960FBC986225209E597D5B97065A9A10043 (eth)

Later Ctrl + ↑

Moving iTunes Account to the other contry

If you are changing the country you may need to change the location of your online services as well. May be if you are moving from US to EU it’s not that important, but if you are moving from Russia to EU keeping old setting would be painful. First, payment can be only done from Russian card. Second, by Russian regulations “Russian” users’ data must be located in Russia. It’s far. And I don’t like the idea of keeping my data there.

Switching the region in the iTunes is not that easy. You need pre-requisites:

  1. You need to have address and the payment card that is issued in the same country.
  2. You need to cancel all your subscriptions. And that’s not that easy. “iTunes Music” had per-month payment basis. But “iTunes Match” is purchased for one entire year and you cannot terminate it. That made me wait 5 months!
  3. “iCloud Storage”, however, may be active.

Than you need to go to the account settings, change the store, add new credit card, re-login on all devices. Applications on the phone are working without problems (seems like this, though I didn’t have any update yet, but it’s x-mas). But not the music! You need to re-enable Match and Music subscriptions and reload all music back to the cloud. A lot of duplicated may appear in process, be prepared for that.

2016   apple   ios   IT   itunes   music

TOC and collapsible block samples

I am writing some tool for my daily work that produces fancy HTML page from RHEL, CentOS or Fedora log and config files, so it would be more easy to read them. Nothing special, just some bash scripts with sed, grep and awk that produce HTML with some CSS and JQuery.

  1. TOC I really liked: http://projects.jga.me/toc/ It’s very easy to use and implement, it just looking through the document for h1, h2, etc tags. Scope and what tags to look can be customized.
  1. Collapsible blocks sample: https://codepen.io/peternguyen/pen/hICga/

May be it would be yet another “log2html” framework in the end.

2016   bash   IT   jquery   js   linux   work

How to sort messages log

If you need to sort out what is reporting to the /var/log/messages to array in case of Red Hat Enterprise Linux or Fedora, you need to do flowing manipulations:

  1. read log;
  2. get 5th column from the log, it’s daemon name;
  3. get rid of all digits, so the daemons with different PIDs would be counted as one;
  4. get rid of all ‘/’ and replace ‘[’ and ‘]’ with ‘\[’ and ‘\]’ to keep things both readable and usable for future scripting;
  5. sort unique stuff.

in my case this gets look like:

cat /var/log/messages | awk '{ print $5 }'| sed 's/\[[0-9].*$//'|sed 's/\[/\\\[/g' | sed 's/\]/\\\]/g'| sed 's/://g' |sed 's/\///g' |sort -u``

the result is usable as array for example. My host’s result:

abrt-hook-ccpp
at-spi-bus-launcher
audit
avahi-daemon
blueman.desktop
blueman-mechanism
bluetoothd
chronyd
cinnamon-killer-daemon
cinnamon-session
com.redhat.imsettings
...
skip
...
tracker-store.desktop
udisksd
usrlibexecgdm-x-session
vmware-user.desktop
wpa_supplicant
2016   awk   bash   centos   fedora   IT   rhel   scripting

Debugging Kerberos

If you need to debug Kerberos, check the time synchronization at the first place. In about 50% cases it is it.

  1. the ntpd (or chrony) should be presented in the process list
  2. they should really be configured correctly
  3. in case of the virtual host crony is preferable, with the ntpd time skew is possible

Really nice crony/ntpd comparative chart: https://chrony.tuxfamily.org/comparison.html , “Summary” section is complete.

2016   chrony   kerberos   linux   ntpd   security

Not to forget: ugly font and the Opera Browser

Might be interesting for non-English speaking users of the Opera: some font on some sites are really ugly and there is no way in the interface to disable them, because they’re not system fonts, but one that web page get downloaded. --disable-remote-fonts is the option to fix them forever. Such fonts usually contain normal English glyphs, bot other are ugly. To fix it in the Gnome Shell:

  1. cp /usr/share/applications/opera.desktop ~/.local/share/application
  2. Add --disable-remote-fonts to every “Exec”. Don’t touch “TryExec”
2016   desktop   linux   opera   web

Not to forget useful vi and bash settings

.bash_profile

alias opera=opera --disable-remote-fonts
alias grep='grep --color=auto'
alias unigrep='grep -P "[^\x00-\x7F]"'
alias mkdir="mkdir -p"
alias ls='ls -lh --color=auto'
HISTCONTROL=ignoredups:ignorespace
HISTSIZE=100000
HISTFILESIZE=200000

.vimrc

set mouse=r
syntax enable
set tabstop=4
set softtabstop=4
set expandtab
set number
set cursorline
set hlsearch
set incsearch  
set showmatch
nmap <F1> <Esc>:set nonumber<cr>                                                                                                                                             
nmap <F2> <Esc>:set number<cr>
nmap <F5> <Esc>yy<cr>
nmap <F6> <Esc>p<cr>
nmap <F8> <Esc>dd<cr>
nmap <F10> <Esc>:wq!<cr>
nmap <F12> <Esc>:q!<cr>

Not sure about ‘number’ setting, if interferes with the clipboard annoyingly, so I can turn them off.

2016   bash   centos   desktop   linux   vi
2016   gnome   linux

CentOS 7.2 -> 7.3

  • it’s now rolling release, so to get updated:
yum install yum-utils
yum-config-manager --enable cr
yum update
  • it restores SELinux context to all defaults, so need to repeat all changes.
2016   centos   IT   linux

FC 25 annoying auth bugs

Evolution keeps failing to connect to Google calendars if it works for more than one day. Restarting goa-daemon with

/usr/libexec/goa-daemon --replace

does not always help. That is frustrating: why not always?

2016   desktop   linux
Earlier Ctrl + ↓