Get file encoding via Linux shell
To find out which encoding a certain file has, you can use the file command on Linux shell: $> file -i path_to_encoded_file.ending Output example: path_to_encoded_file.ending: text/plain; charset=iso-8859-1
To find out which encoding a certain file has, you can use the file command on Linux shell: $> file -i path_to_encoded_file.ending Output example: path_to_encoded_file.ending: text/plain; charset=iso-8859-1
Today I had to solve the problem, that my wordpress cron throws an exception like this when sending an email via wp_mail function inside a cron scheduled event function. PHP Fatal error: Uncaught exception ‘phpmailerException’ with message ‘Invalid address: (setFrom) wordpress@’ in /var/www/clients/client2/web8/web/wp-base/wp-includes/class-phpmailer.php:1023 Stack trace: #0 /var/www/clients/client2/web8/web/wp-base/wp-includes/pluggable.php(352): PHPMailer->setFrom(‘wordpress@’, ‘WordPress’, false) #1 /var/www/clients/client2/web8/web/wp-base/wp-content/plugins/sheldon_misc/admin/class-sheldon_misc-admin.php(183): wp_mail(‘info@ask-sheldon.com….’, ‘Statusmailing i…’, […]
Today I ran into a still open bug of ISPConfig (ISPConfig 3.1.3 under Debian Jessie). The problem occurred, when I tried to clone a BitBucket repository with a non root SSH-user in his own website root (where permission rights generally should be no problem). Hence I wanted to use key-based authentication for BitBucket, I generated […]
Recently I had to setup DDNS for my parents DS212+ DiskStation from Synology. I have an all-inkl.com hosting package including a dynamic DNS feature (DDNS under tools): The problem was to get the right settings for the Synology box. Solution for the DDNS problem I found the solution in this blog article: http://www.pflipsen.net/2015/12/21/all-inkl-com-ddns-auf-der-synology-diskstation-einrichten/ I saved […]
Recently I tried to remove a big bunch of files from one of my raspberry pies where ffmpeg had swamped my SD-card with too many capture images. So I had to delete x files from folder. I just tried: rm -rf *.jpg But that gave me an “unable to execute /bin/rm: Argument list too long” […]
Today I had the challenge to find a way to download a backup from my hosting root server via FTP directly to my Synology DS212+. Here is how I got it done with the given toolset of the Synology DSM 6.1.1-15101. (How to mount FTP on Synology Boxes) Oben Synology Backend and open the File Station […]
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 […]
From time to time I stumbled over the case, that I had to drop all tables from a MySQL database. In phpMyAdmin or other GUI-based tools – in general – you only have the possibility to drop the whole database. But then you have to recreate it from the scratch.  Or you have to click-drop each table […]
Today a colleague of mine wanted to export a single folder from a git repository to a tar.gz archive. This is how to export git subfolder to archive: git archive –remote=’git@bitbucket.org:sheldon/ask-sheldon.com.git’ master path/to/file/or/folder/in/repo –format=tar.gz > archived_folder.tar.gz With this snippet the git repository folder path/to/file/or/folder/in/repo is exported to the archive file archived_folder.tar.gz. The archive will be cleared of all […]
To rename multiple files in the current folder, you can use the following command: $> # rename: $> for f in Sheldon_*.xml; do mv -n “$f” “${f}_bkp”; done $> # rename it back again: $> for f in Sheldon_*.xml_bkp; do mv -n “$f” “${f/_bkp}”; done In this case, I had a bunch of files that […]