generate a new self-signed SSL certificate for Virtualmin/Webmin

Virtualmin/Webmin ships with a self-signed SSL certificate. In case you want to generate a new one, here’s how: openssl rsa -in webmin.key -out webmin.pem openssl req -new -key webmin.key -out webmin.csr openssl x509 -req -days 1095 -in webmin.csr -signkey webmin.key -out webmin.crt cat webmin.crt >> webmin.pem cd /etc/webmin/ cp miniserv.pem miniserv.pem.bak cp /root/ssl/webmin.pem miniserv.pem service webmin restart

April 9, 2014 · 1 min

Xen: extend lvm of virtual machine

First: Make sure to shut down the virtual machine or to unmount the disk inside it. Once finished you can start to extend the logical volume on the hypervisor: lvextend -L+400G /dev/vg0/disk e2fsck -f /dev/vg0/disk resize2fs /dev/vg0/disk There might be a chance you need kpartx, growpart (provided by cloud-guest-utils) followed by resize2fs to grow the mounted partition. In case you shut down the virtual machine you may start it again with ...

April 4, 2014 · 1 min

git: add manually removed files to index

If you ever manually remove files from a git repository you have to tell git they have been removed and add the files to the index to commit the changes afterwards: for FILE in $(git ls-files --deleted);do git rm $FILE;done

February 24, 2014 · 1 min

prevent TeamViewer from running on system startup

By default TeamViewer 9 starts its daemon on system startup, even if you won’t use TeamViewer in your current session. You can disable the daemon with the following command: sudo teamviewer --daemon disable In case you need TeamViewer the command teamviewer --daemon start will start the daemon.

January 20, 2014 · 1 min

Exclude LaTeX files from syncing with Seafile

If you’re working with LaTeX and store you tex-Files in a Seafile repository you might end up with tons of files which are generated by the LaTeX compiler. Since they don’t need to be tracked by Seafile I came up with the following solution. Place a file called seafile-ignore.txt in the root of your library and fill it with this: ## exclude LaTeX compile files from syncing *latex*/*.acn *latex*/*.acr *latex*/*.alg *latex*/*.aux *latex*/*.bbl *latex*/*.blg *latex*/*.dvi *latex*/*.glg *latex*/*.glo *latex*/*.gls *latex*/*.idx *latex*/*.ilg *latex*/*.ind *latex*/*.ist *latex*/*.lof *latex*/*.log *latex*/*.lot *latex*/*.lyx *latex*/*.maf *latex*/*.mtc *latex*/*.mtc1 *latex*/*.out *latex*/*.synctex.gz *latex*/*.toc This will prevent Seafile from syncing this files if you’re working in a (sub-) folder that contains the expression “latex”. This way you can still track .log files as long as they are not in a directory that contains the word “latex”. Be aware of the fact that this matches also if one of the parent folders contains the expression “latex”. ...

November 16, 2013 · 1 min

php5-mcrypt not working after upgrade to Ubuntu 13.10

If you are using the php5-mcrypt library in your projects you might experience that it’s no longer working after you have upgraded Ubuntu to 13.10. You can fix this with the following three commands I have found on stackoverflow [1]: sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available sudo php5enmod mcrypt sudo service apache2 restart [1] http://stackoverflow.com/questions/19446679/mcrypt-not-present-after-ubuntu-upgrade-to-13-10

October 21, 2013 · 1 min

USB-Keyboard not working to enter passphrase for encrypted LVM on Ubuntu 13.10

Ubuntu 13.10 was released a few days ago and I upgraded one of my machines. Everything went fine until I had to reboot. Choosing entries in the grub menu worked flawlessly but as soon as I had to enter my passphrase to unlock my encrypted partitions my keyboard (USB) no longer was working – it was dead. As I don’t have the option to use a PS/2-Keyboard (not owning such a keyboard, machine has no PS/2 port) I was locked out of my system. ...

October 21, 2013 · 1 min

backup your ownCloud contacts via cron

If you ever wondered if there is a way to automatically backup your ownCloud contacts via cron here is the solution: <?php date_default_timezone_set('Europe/Berlin'); error_reporting(E_ALL); $date = date('Y-m-d-h-i-s'); $user = 'your_owncloud_username'; $password = 'your_owncloud_password'; $cmd = "wget --no-check-certificate --user=".$user." --password=".$password." -O ".$date."_contacts_".$user.".vcf https://your.owncloud.tld/remote.php/carddav/addressbooks/".$user."/contacts?export"; $dump = exec(escapeshellcmd($cmd)); ?> You just need to fill in your credentials and modify the path to your ownCloud installation.

August 7, 2013 · 1 min

set up your own sync server for Mozilla Firefox using FSyncMS on Debian

Recent versions of Firefox include the ability to sync your bookmarks, passwords, preferences, etc. with a remote server. You can choose between a server provided by Mozilla or a custom server. There seem to be two solutions to deploy a custom server: Firefox Sync Server http://docs.services.mozilla.com/howtos/run-sync.html FSyncMS https://github.com/balu-/FSyncMS/ Firefox Sync Server requires Python 2.6 and Virtualenv. Since there are no packages for Debian you will have to use make and install some libraries to get it running. FSyncMS is an PHP-based MySQL/SQLite solution which only requires only a normal webspace and a few steps to setup. ...

August 2, 2013 · 2 min

Virtualmin: Enable Sieve for Dovecot and Procmail

aptitude install dovecot-sieve dovecot-managesieved /etc/dovecot/conf.d/15-lda.conf # Address to use when sending rejection mails. # Default is postmaster@<your domain>. postmaster_address = mail@domain.tld protocol lda { # Space separated list of plugins to load (default is global mail_plugins). mail_plugins = $mail_plugins sieve } /etc/dovecot/conf.d/20-managesieve.conf service managesieve-login { inet_listener sieve { port = 4190 } } Edit /etc/procmailrc and fill in the DELIVER parts. I’ts important to make continued use of procmail because spam filtering is done there. ...

July 15, 2013 · 1 min