Category Archives: Coding

One – liner to batch rename files with regex-remove part of the filename

Don’t read this post. It’s only for me so that I don’t forget it šŸ˜‰ After a long fight with bash, find, sed, … Here is the one – liner: for i in $(find -E . -regex ‘(.*[a-zA-Z]{3}[0-9]{3}[a-zA-Z]{3}_[0-9]{9})(\.[0-9])(\.[jJ][pP]([eE])*[gG])’) ; do … Continue reading

Posted in bash, Coding | Tagged , , , , | Leave a comment

Rails derailed again (and again)

Executive summary (aka TL;DR) Rails docs suckā€¦ erm, no. I mean they are great but most probably written by people who never actually had to use them. If you want to follow Rails Guides and install a fresh Rails environment … Continue reading

Posted in Rails, Rants | Tagged , , , , | 4 Comments

PHP’s “associative array”: removing blacklisted or keeping whitelisted keys

Yup, if there is one language I loathe more than PHP, it’s Javascriptā€¦ but this here is about PHP and how to either remove unwanted keys from an “associative array” (as they call it in PHP world) or leave only … Continue reading

Posted in Coding, php | Tagged , | Leave a comment

openvpn inactivity timeout (–ping-restart) restarting

So, there’s a nicely configured OpenVPN server, there is the client config that is proven to work with all your colleagues around and everything “just works” … or maybe, rather “just needs more work”? was it? If you happen to … Continue reading

Posted in Coding, DevOps | Tagged | Leave a comment

How come this crap creeps in for so many years?!

perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = “UTF-8”, LANG = “en_US.UTF-8” are supported and installed on your system. perl: warning: Falling back to the standard locale … Continue reading

Posted in Coding, GNU/Linux, Rants | Tagged , , , , | 3 Comments

Raspberry Pi, hub USB 3.0, error -71

If you have a USB 3.0 hub connected to your Pi and devices plugged into this hub are not configured properly, you check the logs and you see something like device descriptor read/64, error -71 around USB activity – chances … Continue reading

Posted in GNU/Linux | Tagged , , , , | Leave a comment

HTTP query strings in Laravel routes

So you read the documentationĀ back and forth, and again, and even more again. And you still can’t make your Route::get(‘myroute?querystring=myquerystring’, function() work? Well – you don’t find it in the docs but what you have to do is: Route::get(‘myroute’, function() … Continue reading

Posted in Coding | Leave a comment