UWOT.EU

mdadm RAID on Linux

Every time I have to setup a software RAID in Linux using mdadm I forget something, this time I am writing it down once and for all (or at least I hope so).For the sake of simplicity I will use the creation of a RAID1 as example but this very same procedure can be applied for any other kind of RAID..:. RAID array creation 1. Partition the drivesThis step must be repeated for each drive of the array (/dev/sdb and /dev/sdc in my case). …

Posted on

Defragment XFS file system

XFS just like EXT4 (I wrote a post about it last year) supports online defragmentation, to manage those volumes on CentOS and Fedora “xfsprogs” package is needed.Fragmentation level of XFS volumes can be checked with the command:To perform online defragmentation of XFS volumes run the following command:The defragmentation process can take a very long time, if performed on a remote machine I strongly suggest to use “screen” or a similar tool to prevent accidental disconnections which would probably result in files corruption.

Posted on

QEMU+KVM, reclaim disk space

After some time qcow2 images tend -especially after taking snapshots- to grow bigger and bigger, even bigger than the maximum size specified at creation time.QEMU provides a tool called virt-sparsify (install “libguestfs-tools” package in CentOS 7) that can effectively make a virtual machine disk thin provisioned (space is not preallocated, only the actual space needed is used).virt-sparsify has a nice number of options, the most interesting one is “–in-place”, it tells QEMU to shrink the volume in place without requiring any addition space. …

Posted on

CentOS, DNSCrypt and pdnsd

DNSCrypt installation process is pretty simple since it is present in the repository, pdnsd on the other hand is missing, luckily compiling from source is not that hard.For the sake of completeness I will also cover the procedure to install DNSCrypt from source, alternatively “yum install dnscrypt-proxy”.Install the required dependencies and get the source code:.:. pdnsd Compile and install:It is advisable to run pdnsd with its own unprivileged user and use a configuration file placed in the usual /etc directory. …

Posted on

Setting up Vim on Fedora

Since every time I am about to install Vim I forgot how to set it up, set it as default system wide text editor and so on I figure I’ll write it down once and for all.First of all let’s install Vim, specifically the so called “enhanced” version which is capable of loading plugins and colorschemes:I personally really like molokay colorscheme from tomasr; putting it in the default colorscheme directory does the trick if we want to use it for every user. …

Posted on

ejabberd and fail2ban

Fail2ban is a useful tool capable of mitigating brute force attacks performed against a multitude of services (ejabberd in our case). Configuration is split between a multitude of files; jail.conf defines which filters are active while the filters scripts are placed in ./filter.d directory. [root@CentOS ~]# vi /etc/fail2ban/jail.conf --- bantime = 1200 findtime = 1200 maxretry = 10 backend = auto [ejabberd-auth] enabled = true port = 5222,5280,7777 action = iptables-multiport[name=ejabberd, port="5222,5269,5280,777", protocol=tcp] logpath = /var/log/ejabberd/ejabberd. …

Posted on

ejabberd SOCKS5 proxy – file transfer

Ejabberd XMPP server includes a SOCKS5 proxy, setting it up correctly is what makes the difference between fast or very slow file transfer operations. As per XEP-0065 file transfer is either peer-to-peer or mediated by a proxy server. In Conversation peer-to-peer transfer is done by converting the file in base64, split it in 4 kb chunks sent one at the time always awaiting first for the ACK of the precedent one; this makes the whole process painfully slow and bandwidth consuming. …

Posted on

DNScrypt-proxy 1.6.2, new configuration

The latest version of DNScrypt-proxy does not use anymore a single configuration file (“/etc/conf.d/dnscrypt-proxy”) but instead completely relies on systemd.Configuration is now split in two different files.

Posted on