Uptime percentage chart shows how much downtime is allowed per year, month, week and day to correspond to a certain SLA level. Availability is usually expressed as a percentage of uptime in a given year. Continue reading
Aug 15 2021
How to limit the number of simultaneous calls in Asterisk PJSIP
In order to limit the number of simultaneous calls in Asterisk PJSIP, use the GROUP and GROUP_COUNT functions. Below is an example of Asterisk dialplan, where the quantity of simultaneous calls is limited to 1. Continue reading
Aug 15 2021
Vicidial: different carriers for different campaigns
In Vicidial you can have many different campaigns and different carriers for them. Another case is when you want to use one particular carrier for a campaign or few campaigns. Here is how you can configure your Vicidial to use different carriers for different campaigns. Continue reading
Aug 05 2021
Allow Access To Port in SELinux and Firewall
SELinux can be a pain at times if you don’t have a clear understanding how it works. A good chunk of resolutions around the web end up suggesting turning off SELinux completely. This, to say the least, is one of the worst things you can do to your server.
Allowing access to ports through SELinux is one of the things that came across while setting up Elasticsearch cluster on Cent OS servers and I wanted to share a quick run down of steps/commands required to allow a port through the firewall. In this example, we’ll be allowing access to port 8090
. Continue reading
Aug 04 2021
How to update passwords in bulk in ViciDial
To simultaneously update all of the username and phone passwords in ViCiDial, please log in to your MySQL (or PhpMyAdmin, if available) and run the following SQL statements:
1 2 3 |
UPDATE phones set pass='Your_Password',conf_secret='Your_Password' where user_level=1; UPDATE vicidial_users set pass='Your_Password',phone_pass='Your_Password' where user_level=1; |
Aug 03 2021
Special Bash characters and parameters and their meaning
Here I accumulated the most useful and frequently used special Bash characters and parameters. This list of special bash parameters is by no means complete and only contains some of the bash script parameters which I have encountered, so please contribute any bash parameter which is not in this list and you found useful. Continue reading
Aug 02 2021
Webmin uses default certificate instead LetsEncrypt
The Letsencrypt certificate was successfully configured for Webmin in Webmin Configuration -> SSL settings -> Letsencrypt.
However Webmin still uses default certificate like it does not see Letsencrypt certificate at all.
Steps taken to cause problem: Continue reading
Jul 06 2021
How to properly mirror a git repository
What we want with mirroring is to replicate the state of an origin repository (or upstream repository). By state, we mean all the branches (including master
) and all the tags as well.
You’ll need to do this when migrating your upstream repository to a new “home”, like when switching services like GitHub.
As with most tools, there’s a lot of ways to accomplish that, but I’ll be focusing on two of them. The difference lays on whether you already have a working copy of that repository or not.
Mirroring a git repository without a local copy
If you haven’t cloned the repository before, you can mirror it to a new home by
1 2 3 |
$ git <span class="hljs-built_in">clone</span> --mirror git@example.com/upstream-repository.git $ <span class="hljs-built_in">cd</span> upstream-repository.git $ git push --mirror git@example.com/new-location.git |
This will get all the branches and tags that are available in the upstream repository and will replicate those into the new location.
Warning
Don’t use git push --mirror
in repositories that weren’t cloned by --mirror
as well. It’ll overwrite the remote repository with your local references (and your local branches). This is not what we want. Read the next section to discover what to do in these cases.
Also git clone --mirror
is prefered over git clone --bare
because the former also clones git notes and some other attributes.
Mirroring a git repository if you already have a local working copy
By working copy, we mean a “normal” repository, in which you have the files that are being tracked into git and where you perform commands like git add
and so on.
In this case, you may have a lot of local branches and tags that you don’t want to copy to the new location. But you do have references to remote branches. You can view them with git branches -r
. If you pay attention to that list, tough, you may notice that you have a lot of branches that were already deleted in the upstream repository. Why?
Cleaning old references to remote branches
By default, when you do a git fetch
or git pull
, git will not delete the references to branches that were deleted in the upstream repository (you may view them in your .git/refs/remotes
dir). We need to clean those old references before mirroring them to a new location.
To do so, run
1 |
$ git fetch --prune |
This will update your references to the origin repository and also clean the stale branches reported by git branch -r
.
Finally, mirroring the repository to a new location
Now we’re ready to send those updated references back to the origin
repository:
1 |
$ git push --prune git@example.com:/new-location.git +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/* |
Ok, what just happened here?!
We want those references inside the .git/refs/remotes/origin
to be the LOCAL references in the new location. The local references there will be stored in the refs/heads
dir. Same thing happens to tags.
The +
sign indicates that we want to overwrite any reference there may already exist.
--prune
means we want to delete any reference that may exist there if we don’t have such reference in our refs/remotes/origin/*
(and tags) references.
Good luck!
Jul 05 2021
How to Enable the Slow Query Log in MySQL/MariaDB
Enabling the Slow Query Log for MySQL or MariaDB can be a useful tool to diagnose performance and efficiency issues affecting your server such as MySQL high CPU load. By identifying queries that are particularly slow in their execution, you can address them by restructuring the application that triggers your queries. You can also rebuild the queries themselves to ensure that they are constructed as efficiently as possible. Continue reading
Jun 23 2021
LetsEncrypt certificates automatic renewal in Azure Application Gateway
I can bet almost any IT technician have heard of Letsencrypt certificates. They are completely free and fully supported by big corps such as Google, Facebook, Microsoft, and many others, to have a more secure and privacy-respecting Web. A lot of public websites are using those certificates. Of course, as for any free stuff, there are some limitations. For example how many certificates you can generate. Pay attention that Let’s Encrypt certificates are valid for 90 days. So setting up automatic renewal of Letsencrypt certificates is absolutely necessary.
When using an Azure Application Gateway, one of the things you need to do is to install the SSL certificate on the gateway to secure resources behind.
In this article I’ll show you how to set up Letsencrypt certificates automatic renewal in Azure Key Vault and Azure Application Gateway. Continue reading