Author: chirale

Automate log cleanup for GDPR: the Sentry case

Leave a comment
Howtos / System Administration

With the General Data Protection Regulation (GDPR) enforced by European Union logs have to be cleaned regularly to delete IP addresses and other information about visitors. This can be interpreted as a way to protect an emerging and discussed right, the right to be forgotten. This new regulation is impacting every automated log system out of there. Since Sentry is a good open source error monitoring software* and it’s widely used, this guide will show […]

Cannot connect to wired connection on Ubuntu (SOLVED)

Leave a comment
Howtos / System Administration

When your Wireless interface is working and the ethernet isn’t working on Ubuntu, here’s a quick howto to check and fix a misconfiguration. It doesn’t solve any ethernet issues but you can give a try and on an Asus laptop (with JMicron chipset) I worked on it makes the job done. Tested on Ubuntu 16.04 LTS First steps To detect Ethernet interface: To check and configure connection: To save the current status of network interface: […]

Delete git files from public GitHub history

Leave a comment
Coding / Howtos

To delete git files uploaded accidentally to GitHub (or any other public repository) do these steps: Download https://rtyley.github.io/bfg-repo-cleaner/ as suggested by GitHub git clone –mirror GIT_REPOSITORY_URL cd path/to/cloned/repository Download BFG java -jar /path/to/download/dir/bfg-VERSION.jar –delete-files filename.ext Run the command specified by BFG (usually git reflog expire –expire=now –all && git gc –prune=now –aggressive) git push If you get an error on pull, probably you haven’t cloned the repository as step 2. Browsing the public history, any […]

Mass delete old email on Gmail preserving Special and Tagged ones

Leave a comment
Howtos

To mass delete old emails on Gmail type this search query in the search box of mail.google.com (or Gmail for Business): after:2017/01/01 before:2017/31/12 -has:userlabels -is:starred You can use these filters in any language but remember to use the YYYY/DD/MM format for the data (Year/Day/Month) for the after and before filters. This search will show you all emails between January, 1st and December, 31st 2017 that: Haven’t any User Label Aren’t starred (without Star) Change dates […]

How to shrink a scanned PDF on Linux

Leave a comment
Howtos

When you want to reduce the file size of a PDF document, this quick command using convert will shrink the original PDF file. This command is particularly useful against scanned documents, the jpeg quality will be 60% for 150dpi. Converting an original 300dpi / color PDF to a 150dpi, greyscale PDF can reduce file size up to 50%. There will be some quality loss but in this way you can reduce file size enough to […]

PIL: ord() expected a character, but string of length 0 found (SOLVED)

Leave a comment
django / Howtos / Python
PIL error

Using Django, and easy_thumbnails coupled with Pillow specifically I’m stumbled upon this error in PIL.ImageFile on PIL/_binary.py: ord() expected a character, but string of length 0 found This python error was so frequent I’ve done some research, coming up with nothing. I’ve checked current Pillow version with: Getting: Pillow==3.0.0 Then I’ve upgraded the Pillow package with this: The sofware was updated to the very last version (5.0.0) without any issue on easy_thumbnails backend or frontend. […]

Failed to start Authorization manager (SOLVED)

Leave a comment
Howtos / System Administration

If you get the “Failed to start Authorization manager” while booting a Linux OS (e.g. CentOS) most likely you’ve a SELinux misconfiguration. The main issue is that if you’ve restarted the system, you cannot login since OpenSSH service is not running. If you’ve a virtual server, even the console shipped by your provider is stuck on the Authorization manager error. The reason behind this in my case was a completely wrong value in SELINUXTYPE. The […]