Just discovered a quick and dirty way to resize a bunch of jpeg files to a maximum resolution and size: mogrify -resize 1024x1024 -strip -define jpeg:extent=200kb *.jpg This command will resize all jpg images in the current directory with a…
Sometimes you have to give your users a way to manage files on your server. A typical scenario is a web server where your users manage their websites by themselves.
The classical approach in this scenario was to use FTP to give file management capabilities to your users, but it has many drawbacks:
- You have to provision and maintain a new service on your server;
- FTP is an annoying protocol from a firewall configuration point of view;
- FTP is not encrypted by default, and you have to put some effort to configure an FTP server which is protected from sniffing.
If you are a lazy sysadmin like me you’ll prefer to use a service you already have, which is encrypted by default and do not require a special firewall configuration other than the port 22 you are already using.
ssh to the rescue!
During the development of a Django model on your local machine is it often necessary to refine the most recent migration to cope with updates to the model, without polluting the migrations of the app with a new migration for each local update.
So I put togheter a simple bash script to automate the process.
In few steps you’ll be able to automate the production of release signed apks of your app, ready to be published on the Google Play Store.
Recently I discovered a powerful tool from the awesome Google Developers Youtube channel: Google Apps Script.
I tried it writing a simple, but powerful example, experimenting with a use case that for sure will be useful to me in the future: geocoding a list of addresses taken from a spreadsheet.
Here is one of those little things that make me love Python: Prints: a 1 2 b 3 4 How cool is that? ;)
Recently I had a problem of memory usage in Django: when I accessed an apparently innocent view I saw the memory usage of my server grow without rest. The problem turned out to be very trivial to solve, but I think the process I used to find the leak is worth a blog post. 😉