All the way back in 2010 I wrote a post how to connect your Android device to your Ubuntu computer in order to develop on it. There have been a few changes since then, so here is the updated version
Gradle – Automatically rename the .apk file and copy the ProGuard mapping.txt file
ProGuard writes the mapping file under the build directory of the project. Under normal circumstances all files and directories under the build dirs are excluded from version control. That is a bit of an issue if you want to be able to save that file with every release build. I always forget to this manually. So, let’s do that at build time with Gradle and while we are at it, we might as well rename our apk file, so we don’t have to do that manually either.
The Android SDK Manager fails to fetch the platform and tools list from Google
If you get the following error message when launching the Android SDK Manager: Failed to fetch URL https://dl.google.com/android/repository/addons_list-2.xml, reason: File not found most likely the owner/permissions are not set correctly for the ~/.android directory. This error message is very confusing
Find out what DNS requests are made in real time via command line
Since all DNS requests are over port 53, we can use the raw tcpdump utility and just look at the packets on that port: tcpdump -vvv -s 0 -l -n port 53 Someone took the extra step to write a
Set up a MySQL user dedicated to backups
It is not a good idea to use the root MySQL account to do backups. So, let’s create a user dedicated exclusively to doing backups. Log on to MySQL as root: mysql -u root -p Then create the new user
Batch scale images to a particular size
First install imagemagick: sudo apt-get install imagemagick Then CD into the directory containing the images and make a new directory that will hold all the re-sized images. In this case I called it resized: mkdir resized Then run the command
Upgrading to Apache 2.4 will prevent WebDAV listing of directories containing index files
I recently upgraded Apache from 2.2 to 2.4 and among all the expected changes that had to be made to the existing sites-available config files, I encountered an unexpected issue with the WebDAV sites. I could connect to the sites
Force all HTTP traffic to HTTPS
If you have SSL installed and configured on your site, there is a little need to continue serving http traffic over port 80. Performance is no longer a big issue and now Google would reward with better ranking sites that
Unable to create new directories or files (write access) in WebDAV with Apache2
It turns out that if you have enabled mod_rewrite on the server and you are actually doing any url re-writing for the site under which WebDAV is running, then you will not be able to create new directories or files
Block a range of IP addresses from reaching your server
When your Linux server gets bombarded with malicious requests the quickest and easiest thing is to block the offending IP address (or the entire range) using iptables: To block just one IP address: $ sudo iptables -A INPUT -s 103.10.86.53