kubctl logs fails

March 23rd, 2022 by admin | Permalink

If you are facing this situation,

kubectl logs django-b95655d7f-8nw7f -p
standard_init_linux.go:228: exec user process caused: exec format error

it is most likely that you are trying to run a Docker container that is built on a different architecture than the server.
Let me guess, you are using a Mac with a M1 processor and you try to run the docker container on some cloud service.
That’s not going to work.

Rebuild the docker container on the server first and then reuse it.

Simple tool to automatically translate .po files using DeepL

January 15th, 2022 by admin | Permalink

DeepL is a powerful, AI driven translation engine.
Most of my Django projects are multi-language or i18n applications.

Usually you would use SaaS products like Phrase or PoEditor to translate your projects.
They also have an integration with DeepL and other translation engines, but unfortunately these features are only available in the pro packages.

As DeepL has a simple API, we quickly built our own Python script doing this and released it on GitHub.

python-auto-translate-gettext

This is under MIT license and should help everyone that wants a quick solution for automated translations.

Enjoy!

Dovecot and Letsencrypt R3 error

September 30th, 2021 by admin | Permalink

If your Dovecot just started telling your that the Letsencrypt R3 certificate expired, make sure you are using the fullchain certificate in your configuration file.

Make sure you have the following in your /etc/dovecot/conf.d/10-ssl.conf

ssl_cert = /etc/letsencrypt/live/mail.foo.com/fullchain.pem
ssl_key = /etc/letsencrypt/live/mail.foo.com/privkey.pem

And restart dovecot afterwards.

How to change the language of Excel, Word, Powerpoint on Mac

August 5th, 2021 by admin | Permalink

Open a terminal, and type in:

defaults write com.microsoft.Excel AppleLanguages ‘(“en-US”)’
defaults write com.microsoft.Word AppleLanguages ‘(“en-US”)’
defaults write com.microsoft.Powerpoint AppleLanguages ‘(“en-US”)’

en-US stands for English – USA.

Restart Excel, Powerpoint or Word. DONE

Floating Labels with Semantic UI

April 11th, 2021 by admin | Permalink

I recently started working on a project using Semantic UI.
It’s a super-rich CSS framework, coming with nearly all the things you want and need.
From my perspective it is simpler than bootstrap to learn, as there is much more “speaking” css class names like a FORM is “ui form”, a grid is “ui grid” and so on.

Unfortunately it is missing one import style utility called FLOATING LABELS.

This is the coming into effect when you get into an input field and start typing. It shifts the name of the field to the top of the input field and still shows the name.

I found a script that helps you doing this.
https://codepen.io/ysung812/full/MWWGJJz

Simplified you just need the CSS styles:

/*************************
Floating label
**************************/

.ui.input.floating-label {
position: relative;
margin-bottom: 1rem;
}

.ui.input.floating-label>input,
.ui.input.floating-label>label {
height: 3.125rem;
padding: 0.75rem;
}

.ui.input.floating-label>label {
text-align: left;
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
margin-bottom: 0;
/* Override default `

.ui.input.left.icon.floating-label>label {
left: 26.99px;
}

.ui.input.floating-label input::-webkit-input-placeholder {
color: transparent;
}

.ui.input.floating-label input:-ms-input-placeholder {
color: transparent;
}

.ui.input.floating-label input::-ms-input-placeholder {
color: transparent;
}

.ui.input.floating-label input::-moz-placeholder {
color: transparent;
}

.ui.input.floating-label input::placeholder {
color: transparent;
}

.field.floating-label input:focus::-webkit-input-placeholder {
color: transparent;
}

.field.floating-label input:focus:-moz-placeholder {
color: transparent;
}

.field.floating-label input:focus::-moz-placeholder {
color: transparent;
}

.field.floating-label input:focus:-ms-input-placeholder {
color: transparent;
}

.ui.input.floating-label input:not(:placeholder-shown) {
padding-top: 1.25rem;
padding-bottom: 0.25rem;
}

.ui.input.floating-label input:not(:placeholder-shown)~label,
.ui.input.floating-label input:-webkit-autofill~label {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
font-size: 12px;
color: #777;
}

.ui.input.floating-label::-webkit-input-placeholder {
color: #6c757d;
opacity: 1;
}

.ui.input.floating-label::-moz-placeholder {
color: #6c757d;
opacity: 1;
}

.ui.input.floating-label:-ms-input-placeholder {
color: #6c757d;
opacity: 1;
}

.ui.input.floating-label::-ms-input-placeholder {
color: #6c757d;
opacity: 1;
}

.ui.input.floating-label::placeholder {
color: #6c757d;
opacity: 1;
}

/* Fallback for Edge
————————————————– */

@supports (-ms-ime-align: auto) {
.ui.input.floating-label>label {
display: none;
}
.ui.input.floating-label input::-ms-input-placeholder {
color: #777;
}
}

/* Fallback for IE
————————————————– */

@media all and (-ms-high-contrast: none),
(-ms-high-contrast: active) {
.ui.input.floating-label>label {
display: none;
}
.ui.input.floating-label input:-ms-input-placeholder {
color: #777;
}
}

How to check if a domain is in a SSL certificate

October 9th, 2020 by admin | Permalink

Quite simple, using openssl:

openssl s_client -verify_hostname example.com -connect domain.com:993

This will show if a domain is in that certificate.

SSLChecker a script to avoid expired Letsencrypt certificates

May 4th, 2019 by admin | Permalink

Letsencrypt is a wonderful, simple and cost free way to encrypt your SSL traffic.
Since it start it helped protect data privacy to millions of websites. One of the downsides of Letsencrypt is the limited time a certificate is valid. Every three months you need to update your certificates, otherwise your users will be seeing a warning page in their browsers.

But not only Letsencrypt users struggle with the problem of expiring certificates. Also bigger every now and then face the same problem. Just with a different twist. The more servers and components are running SSL and need certificates, the more likely people tend to buy certificates with long running periods. Which means, on one hand you have to touch all these systems only every couple of years, but on the other hand the probability that the colleague that installed the cert is not around anymore. Results in partial failing systems and people under pressure trying to fix system by system.

As I am running multiple servers and also multiple domains, I created a small Python script called SSLChecker which notifies you via email 30,14,3 and one day before a certificate expires.

It can handle multiple domains at once and notify a list of people.

It is under the GNU license released on GitHub. Feel free to contribute, use and help keeping data private.

How to fix the Mac calendar, when syncing is not working?!

January 31st, 2019 by admin | Permalink

I often have trouble with my Mac calendar syncing with Office 365. Here is a quick fix for that.

https://michaelkummer.com/technology/fix-calendar-cant-save-event-x-exchange/

Plugins that improve your WordPress performance, page speed and security

September 25th, 2016 by admin | Permalink

Despite the optimization on the webserver, it makes sense to install a couple of plugins that secure and speed up your wordpress installation.

In my concrete case, I am using as a minimum the following:

Hyper Cache
Hyper Cache is a simple caching plugin that pre-renders your content, so your webserver doesn’t need to processes all dynamic content for every request and only does this once there is a change.
Super simple, but speeds up your website enormously.
It also supports CDN.

Login LockDown
Limites the amount of possible attempts to login. This helps to prevent bruteforce attacks where an attacker tries random passwords till he has access. Find information about it here.

Stop XML-RPC Attack
Stop XML-RPC Attack helps you reducing the amount of requests going to xmlrpc.php. This could possibly used to flood your webserver with useless requests.

BJ Lazy Load
Lazy Load helps to only load content that the user is looking at. E.g. when opening a long page, not all pictures are visible directly. Some are below the fold. It makes no sense to load these images before they are watched, so this helps preventing unnecessary requests + increases the user experience, while speeding up everything.

EWWW Image Optimizer
EWWW Image Optimizer optimizes and compresses all pictures that you have uploaded or will upload in WordPress. Makes files smaller, while not losing the quality and therefore speeds up the page.

miniOrange 2 Factor Authentication
miniOrange 2 Factor Authentication enables you to use several methods of two factor authentication, means your username + password + a second authentication. This could be e.g. an email, SMS or the Google Authenticator. I highly recommend the Google Authenticator. It is free and simple.

All these plugins are free of charge, some have a pro version, which I don’t need.

Load static content directly thru Nginx

September 24th, 2016 by admin | Permalink

Everytime your wordpress blog loads, it is also sending a lot of files that are static e.g. images, CSS, javascript and so on.

In the standard configuration, this is passed thru the PHP process which slows down the delivery as it has to be processed before, even that there is absolutely no reason to do this.

You can avoid this, by configuring NGINX to directly deliver these files and speed everything up.

Add to your https configuration the following line

location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff)$ {
expires 30d;
log_not_found off;
}

If you have more file types that you want to deliver directly and that are static, add them to js|css|png|jpg|jpeg|gif|ico|woff e.g. js|css|png|jpg|jpeg|gif|ico|woff|pdf

Restart your NGINX and you are good to go.

%d bloggers like this: