Facebook Linkedin
Git Instagram
40 posts tagged


Later Ctrl + ↑

Let’s encrypt cert updates

Let’s encrypt is wonderful, but certificate are getting expired every 3 months. Since it’s a first time I need to renew them, I have done it manually. The tool authenticates you (by default) with special file created in the .well-know/acme-challenge directory of the root, so the blog engine should not interfere or rewrite anything and should not return it’s own 404 page. Historically my nginx.conf has lots of existing redirects and rules, I am too lazy to correct and simplify it, so simple

localtion ~ .well-known {
        allow all;

does not work. And I am too lazy to figure out why it is so (bad for me). So the most simple way to renew certs for me is to switch to minimal config. Putting it here for the future reference.

user  nginx;  
worker_processes  1;
error_log  /var/log/nginx/error.log;
pid        /run/nginx.pid;
events {
    worker_connections  1024;
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    server_names_hash_bucket_size 128;
    index   index.html index.htm;
    server { listen 80;
        listen [::]:80;
        server_name andreybondarenko.com;
location / {
                 root   /var/www/;

 No comments    16   2016   IT   linux   nginx
 No comments    9   2016   apple   awk   bash   IT
 No comments    4   2016   google   IT   security   web

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.

 No comments    24   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.

 No comments    32   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:

 No comments    25   2016   awk   bash   centos   fedora   IT   rhel   scripting

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.
 No comments    4   2016   centos   IT   linux

Today I’ve learned...

My colleagues from the linux.org.ru board have found out one small flaw, so everyone including me stared to dance around PGP/GPG. So far I have found that among my systems:

  • Linux works as it should: two mouse clicks and you are ready. Covers 100% of my work mail, 75% of my personal mail.
  • Mac OS Sierra is not ready: GPG Suite has no support for the mail.app yet, just a workaround (yet). Hopefully we will see the solution in days.
  • iOS has only S/MIME out of the box, but GPG/PGP solution is ugly (due to restrictions).

And I don’t like install software that does not come with the operating system, for a reason :-)

 No comments    2   2016   internet   ios   IT   linux   mac   mail   security
Earlier Ctrl + ↓