Base64 encode on shell

Sometimes you need to encode a string  with a base64 encoding. For example when trying to send a HTTP request with a Basic Authentication header like that: ### own controller: POST http://thedomain.com/webhook/post?XDEBUG_SESSION_START=11931 Content-Type: application/json Authorization: Basic c25zOlVzZVRoZWZvcmNlCg== { “uuid”: “08e9a8d3-9279-4af5-88ff-ebe42359f0e0”, “eventname”: “peng.page.publish”, “data”: { “sitemap_id”: “1234”, “locale”: “de_DE”, “path”: “unigue/page/path”, “title”: “Testpage over API”, “meta_title”: […]

Mount ssh filesystems under Linux or how I mounted my webspace into my root server

Today I had to mount a ssh filesystem under Linux. The reason was, that I had the perception that I would be a very cool idea, to use my old webspace package from all-inkl.com, that I only kept because of the 10 included domains, as a backup storage for my root server.The plan was to […]

Setup monit behind Apache proxy under ISPConfig

Today I wanted to setup monit behind Apache proxy on my webserver, which runs ISPConfig (https://www.ispconfig.org/) under Debian. Monit is a OpenSource monitoring tool for Linux (see https://mmonit.com/monit/). Requirements I had the following requirements on the solution: monit should only be accessible from the server itself (localhost) monit should run under a special SSL-secured URL (not IP:PORT as […]

Export or extract a certificate to or from PFX

Sometimes you have to deliver or you even get your server certificate files in the pfx file format (personal information exchange, see https://msdn.microsoft.com/en-us/library/windows/hardware/ff549703(v=vs.85).aspx), that is commonly used in Windows based environments. The following paragraphs show, how to export or extract a certificate to or from PFX. Export cert to PFX In order to export the Certificate, Private Key and any […]

Get your public IP via shell

To get your public IP you can use websites like www.whatismypublicip.com/ or just google for it (http://lmgtfy.com/?q=public+ip) But you can also get your public IP via the following Linux shell  command (the smart way :-D): $> curl ifconfig.me/all This gives you an output like that: ip_addr: 31.18.198.134 remote_host: ip123456.dynamic.kabel-deutschland.de user_agent: curl/7.35.0 port: 47745 lang: connection: keep_alive: encoding: […]

Run a DynDNS client under Raspbian

For a home automation project I have to setup a local DynDNS client on my Banana Pi running with Raspian. Here are the steps I’ve taken to run a DynDNS client under Raspbian (will work on other Debian based Linux distributions too): Install ddclient package: $>sudo apt-get install ddclient This command installs the package and starts the DynDNS […]

Run dnsmasq as a local DNS Server (Arch Linux)

Dnsmasq is a very handy and easy to install DNS / DHCP server implementation, that uses the local hosts file to determine hostname to IP mappings. I use a local DNS to be able to call my local machines by a memorable domain instead of their IP. Additionally dnsmasq works as an DNS Cache. Installation of dnsmasq […]

Resolve problems with authorized_keys permissions

Sometimes I had problems to connect to a server via public key authentication. In most cases I could solve them by setting up the right permissions for the file and path of the authorized_keys file. This can be done as shown below: $> chmod 700 $HOME/.ssh $> chmod 600 $HOME/.ssh/authorized_keys $> chmod go-w $HOME $HOME/.ssh […]

“Could not resolve host” error

If you get this error message when trying to update the system (see example below) or just pinging an external host … $> sudo pacman -Syu :: Synchronizing package databases… error: failed retrieving file ‘core.db’ from mirror.archlinuxarm.org : Could not resolve host: mirror.archlinuxarm.org error: failed to update core (download library error) error: failed retrieving file ‘extra.db’ […]