Asterisk for small office without web

Long time ago my friend asked to configure SIP server without any web-ui. As result I got next configuration which is a bit specific for Ukraine. extensions.ael context local { _1[1-3]XX => { Dial(SIP/${EXTEN},20,Tt); }; _NXXXXXX => { Set(CALLERID(all)=DEFAULT_TRUNK); Dial(SIP/${EXTEN}@DEFAULT_TRUNK,20,TtwW); }; _0NXXXXXXXX => { Set(CALLERID(all)=DEFAULT_TRUNK); Dial(SIP/${EXTEN}@DEFAULT_TRUNK,20,TtwW); }; _10[1-4] => { Set(CALLERID(all)=DEFAULT_TRUNK); Dial(SIP/${EXTEN}@DEFAULT_TRUNK,20,TtwW); }; _911 => { Set(CALLERID(all)=DEFAULT_TRUNK); Dial(SIP/${EXTEN}@DEFAULT_TRUNK,20,TtwW); }; _15XX => { Set(CALLERID(all)=DEFAULT_TRUNK); Dial(SIP/${EXTEN}@DEFAULT_TRUNK,20,TtwW); }; _00. => { Set(CALLERID(all)=DEFAULT_TRUNK); Dial(SIP/${EXTEN}@DEFAULT_TRUNK,20,TtwW); }; _88....

June 12, 2018 · 2 min · Dmytro Prokhorenkov

Learning bash scripting for beginners

Bash (Bourne-Again SHell) is a Linux and Unix-like system shell or command language interpreter. It is a default shell on many operating systems including Linux and Apple OS X. If you have always used a graphic user interface like KDE or Gnome or MS-Windows or Apple OS X, you are likely to find bash shell confusing. If you spend some time with the bash shell prompt and it will be difficult for you to go back. ...

June 12, 2018 · 2 min · Dmytro Prokhorenkov

Connect Vyos to Aws With Ipsec

Setup VPN in AWS Create Virtual Private Gateway in “VPC” → “Virtual Private Gateways” and attach it to current VPC. Enable route propagation in Route Table in “VPC” → “Route Tables”: Add Inbound rule for local IPs of server(s) behind Vyos which you want to allow access from: Create VPN connection in “VPC” → “VPN Connections” with following details: In the same VPN section, select the VPN you just created and hit “Download Configuration” button....

June 12, 2018 · 2 min · Dmytro Prokhorenkov

Recovery Broken Vmdk Image

Disk images for virtual machines in VMWare products are stored in 2 files: disk description and data. In filesystem virtual machine partition stored as 2 files: disk file image: linux-flat.vmdk disk file config: linux.vmdk So in situation when you accidentally removed linux.vmdk (when you’re connected with SSH) or it’s broken, you can restore your disk drive image and mount it to another virtual machine. To restore image you should do next steps (example is for ESXi installation as the most common for me)....

May 9, 2018 · 3 min · Dmytro Prokhorenkov

Jinja2 Howto Get String Outside for Loop

Long time ago while I was rewriting our salt formula I got problems with getting value outside for loop. After some investigation and reading documentation I got next text to get what I need: {%- set dc_name = ['jotunheimr'] %} {%- for s_group, s_details in pillar.get('server-groups', {}).items() %} {%- set s_srvs = pillar.get('server-groups', {}) %} {%- for srv in s_srvs[s_group] %} {%- if srv == grains['id'] %} {%- do dc_name.append(s_group) %} {%- endif %} {%- endfor %} {%- endfor %} {%- if dc_name|length > 1 %} {%- endif %} {%- set bacula_path = salt['pillar....

April 3, 2018 · 1 min · Dmytro Prokhorenkov

Kubernetes Monitoring With Icinga2

History In our company we use for monitoring Icinga2. And everything was ok until it came to Kubernetes. As everyone know, best tool for Kubernetes monitoring is Prometheus. But I wanted to keep monitoring and alerting in Icinga2. I started looking in Internet for existing solution to monitor Kubernetes with Icinga2. And in the end found tools written by guys from Nexinto. They created two applications: check_kubernetes application to run checks kubernetes_icinga - daemon which scan Kubernetes cluster and automatically change Icinga2 configuration through API Details about applications check_kubernetes Usage of /usr/lib/nagios/plugins/check_kubernetes: -alsologtostderr log to standard error as well as files -kubeconfig string kubeconfig location -log_backtrace_at value when logging hits line file:N, emit a stack trace -log_dir string If non-empty, write log files in this directory -logtostderr log to standard error instead of files -name string name of object to check -namespace string namespace of object (default "default") -stderrthreshold value logs at or above this threshold go to stderr -type string type of object to check -v value log level for V logs -vmodule value comma-separated list of pattern=N settings for file-filtered logging This application perform only simple checks for:...

March 29, 2018 · 3 min · Dmytro Prokhorenkov

Running Blog With Hugo

Introduction I wanted to migrate my blog from Wordpress to statically generated HTML blog. But on the other hand I wanted to keep history of all my changes in blog. Finally I decided to go with Git repo for files and Hugo as file generator. To automate generation and deployment of site I’m using GitLab and its CI. Overview Here is how looks like my setup for blog: Files are hosted on personal VM Blog content is hosted in a private repo at VM with GitLab DNS for my zone is hosted in Cloudflare Theme for site is included as git submodule into repo After editing something or adding content I commit and push changes to repository When content is pushed to GitLab instance CI runs pipeline to build site GitLab CI contains two steps: Building and generation site artifact Pushing site artifact to web server As example I used this article....

March 24, 2018 · 2 min · Dmytro Prokhorenkov