Android DiskUsage – check your free space
What to do when the memory card or internal memory is full on you Android device? How to find the real nasty memory hogs? That’s what the following article is about.
A few days ago I was confronted with the fact that my memory card on my Galaxy S2 was full. Unfortunately, I could not imagine what would consume so much memory, yet I was willing to to clear something up on a venture.
So there had to be an app. As always, I prefered a free one. And here it is – Disk Usage – my find of the day.
With DiskUsage you can visualize which folder uses how much memory. So you get a quick overview of where the real “memory hogs” are.
After starting the app, you must first select which storage medium has to be analyzed. You have the choice between the internal (device) memory and/the SD card(s).
If you have decided on a storage path, the app starts to analyze all folders, starting from the topmost of the hierarchy. This may take a moment. So forbear – the patience finally pays off.
After the analysis is complete, you will get an overview of the folder structure and the size of each folder. Clicking on a folder you can zoom into it, i.e. consider their subfolders detail.
When you have found a “memory hog” and want to get rid of it, one click on the device’s menu button is enough. In the dialog that opens, you can remove the selected folder with just one click. (Ok, actually there are two clicks, because certainly there’s a security question like “Do you really want to delete this folder?” But otherwise the whole thing is really smooth. You can just trust me.)
So, was I able to convince you? Then you can download DiskUsage from the Android Market.
What do you think of the app? Have you already used it or do you know some good alternative?
How to add speech recognition to any website with HTML5
Since Apple’s Siri voice recognition/voice control has again got back in focus of the crowd. But Siri is far from being the only working voice control solution. There were already a number implementations before, some good some bad, and there is still far more than just Siri.
How you can “install” a voice recognition into your website with just one line of code, is what I want to show you today. The whole thing is based on HTML5 and is established as an input element-tag.
And this is how it works:
<input type="text" x-webkit-speech />
Who wants to see the speech recognition in action, should go over there. The only downside of this solution is the fact, that this speech recognition is far from cross-browser compatible. So at the moment it’s only implemented in Google’s Chrome browser. However, I could imagine to use the speech recognition, for example, for the search window on my blog.
And so that users of other browsers do not stand there without looking, you could display the classic text input field via browser switch for all other users.
What do you think about this new html tag? Will the speech recognition prevail and would you use it on your website?
News flash – the shop is opened!
It’s once againt time for a small update, so once again there is something new at this blog. At the top menu, a new item called “Shop” has been added. Yesterday I created an tiny aStore, that’s how Amazon calls its custom shops.
Therefore the products are not from me but from various retailers. The shop here in the blog is basically an selection of items from the Amazon range, handpicked by myself.
All products in the shop are either owned by myself, so that I can recommend them with a clear conscience or they’re products, which I think are worth to be recommend and relevant to one or more of my blog articles.
If you buy something, I get (on average) 5-10% commission of the selling price. With a purchase through the shop you can support me and my work. Among other things, the Sony Ericsson LiveView and the TP-Link WR703N router can be found in the shop, which I have presented here on the blog in detail.
In the end, I speculate that perhaps one or the other sale, related to the matching articles in my blog, is made. Furthermore it doesn’t cost me more than one link, so thus it would be simply wasted potential.
If my plans work and atleast one sale is generated, I am happy about every cent that comes back as a “thank you” for my work. If not, I can say at least that I’ve tried it.
404Checkr – a fast and free bulk link checker
This article is dedicated once again to a small self-creation. So it’s about a little tool of mine, which I have created acouple of days ago, as in most cases, out of necessity. So I was recently looking for a opportunity to check a large list of links as easy as possible to identify the dead links out of it.
The initial situation
At least if you have to check 20 or more links for their validity by hand, you realize that ther must be a better and faster solution. Therefore I have written a small program in C#, which helps you to check as many links/urls as you like for their validity. I have named the tool “404Checkr”, whereby 404 refers to the HTTP statuscode 404, which says that a page/file could not be found.
What does the 404Checkr?
The 404Checkr can handle an arbitrarily large list of links. These can be entered either manually or via copy and paste. After that you can choose the amount of threads. This means practically, how many pages are checked in parallel. The ideal value for this is always depending on the quality and speed of the users internet connection.
Next you can set the number of seconds which is needed before a timeout error is raised. This can be useful if you want to have only sites classified as “OK”, which answer within a certain time. Depending on your requirements, a page may be technically ok but practically unusable when it answers not unti after 15-20 seconds.
If these settings are made, the analysis of the links can be started with one click. The current progress of the review process can be monitored bya progressbar and a text-based output. Although the result list refreshes in real-time.
When testing is completed, the results can be exported either as simple .txt-document or as a .csv-file.
Download and instructions
Of course you can download and use the software (404Checkr) for free. Should you however want to use it commercially (for example in your company), so I would appreciate that you contact me or send me at least a small donation via Paypal.
Download: 404Checkr (v. 1.0.0.0)
Screencast – 404Checkr live!
Source code and developer information
Contrary to some of my other projects, I’m also providing you with the source code of 404Checkr. You are welcome to add new functions or work on the performance. Should you actually build something new from the project, I’d appreciate a comment or an email. (I, for myself, always like to see what others have for ideas that you didn’t come to my mind. Moreover, sometimes there are arinsing really interesting discussion out of such situations.)
Two more notes before I’ll give you the download link for the Visual Studio project.
- As I said, you are allowed to create something new from the existing project. What I do not like is when you only replace my name and add yours or your logo and then tell everybody that the program was “your genious idea”. I say this aware at this point, since I often times get such requests lately.
- Do not expect too much from the sources. The program is basically built between two coffee cups. If you get lost in the code, I can not be held responsible for. ;)
Download: 404Checkr (v. 1.0.0.0) – Visual Studio 2012 Solution
Mastering OpenSSH – Part 3: How to secure login by using a key file
After we set up an OpenSSH server in the first part and completed the basic configuration to secure the server in the second part of this article series, we now want to configure the server to make use of a key file (hereinafter also “key”) for the login process.
The SSH key authentication is based on the principle of asymmetric encryption. So we need a key pair consisting of a public key and private key. The public key is then stored on the OpenSSH server and the private key goes to the client.
The top priority here is to keep the private key secret forever and in any case. If someone else comes into the possession of the private key, he or she can log on to your server.
As a small obstacle you can provide the private key itself with a password. But nevertheless, if the private key gets public or falls into wrong hands, it should quickly be ensured that the counterpart, the corresponding public key, is removed from the OpenSSH server.
To generate a key pair, there are several possibilities. Two of them I will explain further below. One possibility is the creation by means of the command line tool “ssh-keygen”. This comes with the installation of OpenSSH and is therefore available atleast for Linux. The OpenSSH for Windows package hadn’t included ssh-keygen at the time, when I wrote this article.
If you prefer working with a graphical interface, you should have a look at the second option presented. By using the program “PuTTYGen” you can create the required key pair without getting in touch with the commandline. Furthermore PuTTYGen is also available for Windows.
How to generate a key pair using ssh-keygen
One way to generate a key pair is using ssh-keygen. However, this tool is not included in the OpenSSH for Windows installation. Either you need access to a Linux machine or you use the Linux server, which runs your OpenSSH server.
Note: You should only use your OpenSSH server Linux machine if you are really sure that no one unknown has access to this server. This would be the case, for example, if your machine is a media server on your LAN where you know and trust all the network users and the server does not have internet access. Especially in shared server environments, you should exercise with highly raised caution or better generate the key on a local machine.
To generate a new key pair with ssh-keygen, you need the following command.
ssh-keygen -t rsa -b 4096
The -t parameter here specifies the encryption method. (For SSH version 2 you should use RSA, as in the example, but DSA would also be a valid choice.) The -b parameter specifies the key length in bits.
During the execution of the command you will be prompted for a password. Here it is important to find a good compromise between complexity and the effort for the respective input of the password. (A longer and more cryptic password may be more secure, but it’s also harder to type. And you’ll have to type it at every login!)
Important: Although there is also the option to enter no password, but it is strongly discouraged. If you set up no password, so an attacker, as described in the introduction of this article, is sufficient to log on your server with only the key! If you assign a password, the attacker needs to break this before he can login. This in turn should give you time frame which is big enough to remove the corrupted public key from your server and exchange it with a new one, before the attacker can crack your passphrase/private key.
After generating the key pair, you should have two files now.
id_rsa id_rsa.pub
The file with the .pub extension is your public key and deserves on the server. If not exists, create a folder called “.ssh” in your home directory and copy the public key file into this folder.
sudo mkdir -p ~/.ssh sudo mv id_rsa.pub ~/.ssh
Finally, you have to add your public key to a file called “authorized_keys”. You can do this with the following command.
cd ~/.ssh sudo cat id_rsa.pub >> authorized_keys
Hwo to generate a key pair using PuTTYGen
Those without access to a local Linux computer and those who don’t want to generate the key pair server-side, can for example use PuTTYGen. This is the key generator of the famous PuTTY suite. PuTTYGen you can be download free. PuTTYGen is portable, so installation isn’t needed.
After the start you can choose the length of the key in bits and the encryption method. After that, you have to click on “Generate” to start the key generation. To accelerate the generation, you can drive around randomly with your mouse on the surface of PuTTYGen. The movements are used as random data and included in the calculation process of the key.
If the key is created, you should still create a password for the private key. This protects the key in case of theft as I said. (At least for a time.) Just write the password in the fields “Key passphrase” and “Confirm passphrase” which are visible after the generation of the key.
After setting the password, private and public key can be exported using the two “Save”-buttons. The public key must now be transferred to your OpenSSH server (for example by using a USB stick, SSH/SCP, FTP, etc.).
Once arrived on the server, the key must be written to a file called “authorized_keys”, which should be located in the folder “~/.ssh”. (If that’s your first key, you may have to create the “.ssh” folder.)
sudo mkdir -p ~/.ssh sudo mv id_rsa.pub ~/.ssh
Then add the public key to the “authorized_keys” file.
cd ~/.ssh sudo cat id_rsa.pub >> authorized_keys
Set up the key in your OpenSSH server configuration
In the last step, the configuration file of the OpenSSH server still needs to be adjusted, so that it allows login via key file and forbid login by plain password. Therefore open the sshd_config.
sudo vim /etc/ssh/sshd_config
And change the line that starts with “PasswordAuthentication”, as follows.
PasswordAuthentication no
With this setting, the login by password will be forbidden and so only users with key files can login. Thus, all brute force and password list attacks will be useless.
To apply the changes you have to save and close the sshd_config and then reload the changed settings in the OpenSSH service once. This goes as follows.
sudo service ssh reload
Now the server-side configuration part is complete. In the next paragraphs I’ll show you how to login with OpenSSH console client and PuTTY by use of the private key.
How to logon using OpenSSH and private key
The login with a private key works with both OpenSSH and with OpenSSH for Windows. The required command is almost identical to what I showed you in the first part of the article series. There is still only one additional parameter. The “-i” parameter.
ssh myusername@myip -p myport -i "PathToMyKey"
“myusername” is the name of the account on the SSH server with which you want to sign in.
“myip” can either be the IP address of the server or, alternatively, its host name.
“-p myport” is optional and should be specified if you have changed the port, your SSH server is running on.
“”PathToMyKey”" must be specified depending on the operating system you use. On Windows with backslashes and on Linux with slashes. Examples: Windows => “C:\mykeys\id_rsa”. Linux => “~/mykeys/id_rsa”.
How to logon using PuTTY and private key
To log on using Putty and your own private key, the private key must be specified in the settings of PuTTY. This can be done in the menu item “Connection=>SSH=>Auth”. However Putty needs the key to be in its own PPK format. If your private key has been generated with ssh-keygen you have to convert it first. (If you have already done this you can skip the next paragraph.)
To convert the private key in to the PPK format, we need again the “PuTTYGen” tool. Start it and click on the “Conversions=>Import key” menu item. Then choose your private key file and open it. Using the button “Save private key” you can then save you private key file in PPK format.
If you now have your private key available in PPK format, open PuTTY. In PuTTY load your connection settings or set up some new connection settings. Before you connect to your server, enter the menu and navigate to “Connection->SSH->Auth”. Here you can find a field named “Private key file for authentication:”. Enter the path to your private key in this field. That’s it. When you connect to your server via PuTTY it is using the preset key file for login authentification.
Conclusion
Thus, we were at the end of the three-part article series. I hope you learned maybe the one or other thing. If you still have questions or suggestions for another article, then let me know it in the comments.






