Posts

Hacking Tips

You have an encrypted Password and you want to find what it is A good practice is to encrypt a password using a one way encryption, then when the user uses his password, you just encrypt it with the same algorithm and compare the stored encrypted value to the new value, if they are the same then he user entered the right password. Having the password as encrypted strings is a good measure of security, if you want to find the original password then it is not simple as the encryption works one way only. But still, in order to find the original password you can try the following: Throw the hashed string to google - you will be amazed Dumb brute-force , by hashing every keyboard sequence using a computer algorithm, the problem with this one is that it is very CPU intensive and it might take a verrrry long time Dictionary attack , doesn't use random keys, but uses real words in order to try and guess the password - this is a much faster method, but if the password wasn...

Run your Java app as an EXE

My current task is deploying my JavaFX app as an EXE application Why? Because, unfortunately, "jar" files aren't looked upon (by windows) as executables which one should only double click in order to run, as if jar files are less legitimate than exe applications. This is not fair! People don't like running java applications because they need then to install a Java Virtual Machine, but they forget that in order to run those precious C# applications they need to install the .NET virtual machine, because windows does that automatically with windows updates so it is treansparent, but fundamentally they are the same, both need a virtual machine installed (JRE for java and .NET for .net apps), and a file association in order to run. Well, as I won't change the world (although I would love to see microsoft having a JRE installed using microsoft [optional] updates), I searched for a solution which will enable me to "convert" my jar file to an E...

Technical list of things to do to create a new PODCAST

You want to start your own Podcast?  Here is my technical list of steps for you Recording hardware is highly advised: Blue Yeti microphone with a pop filter is a good choice Recording software: Audacity to record, edit and finally export as mp3 Save the mp3 file using 56kb bitrate for human voice best size/quality ratio Save the mp3 on a dedicated server for best long term results or just throw it unto your hosting service for quick and dirty results (if you ever become very popular, your hosting might tell you to pay for the bandwith) Create a wordpress site for your podcast , where each show will have a link to your mp3 file somewhere in it Use the  Seriously Simple Podcasting plugin for much nicer podcasting look in your site After recording and publishing a show or two, submit your podcast RSS feed to: The biggest podcast sites - Manually All the other smaller sites - automatically

Sync / Backup files

Backing up my pictures/music/software etc is an issue i think about from time to time but never got to implement a method of doing ... till now. Motivation ? Obviously, this is very important, so even if a disaster occurs, I will still be able to retrieve my data. Where should I backup to ? To the cloud! - if I will backup to somewhere else it can also be destroyed in the case of disaster. But also to an external harddrive as some of the data is huge, and too big for the cloud (unless I will pay a monthly fee). Backup / Sync method Define which data will be backed up to the cloud (documents, source code etc) - these folders will be copied to the cloud directory What should be backed up to an external drive (pictures, music, videos etc) - these folders will be copied to the external drive (scheduled to one which is always connected, and manually to another which will be connected only for this purpose once a month then will be put back to the attic) Use a S...

Web Crawler / Spider Features

Let's build a web spider / crawler Features Multithreaded (else network will slow it to a crawl) Work with proxies Manage Robots .txt (disable or change agent) Resumeable (in case of a crash it should continue where it stopped) Politeness (wait at least X milliseconds before connecting the same domain) Binary crawling (be able to parse PDFs etc) Configurable stop conditions like: MaxDepth, MaxNumOfPages, MaxSize? Be able to crawl https Evade spider traps Heed redirects (status code 3xx) Normalize URLs (so it won't crawl same page twice) Configurable shouldVisit (Page page, URL url) which will enable the user to focus the crawler on specific pages (regexp of suffix) specific domain etc SIMPLE API (disable all advanced features) Use third party libraries for: URL Normalization, Robot management, PageFetcher, Multithreaded framework, Frontier DB, Page Parser (Tika for binary) Enable the user to grab and whatever he wants with the visit (Page page)  (Op...

What should we Unit Test

Unit tests should be done wisely (Note: I suggest reading my previous post about Mocks before this one) It is easy to fall into the unit test biggest pitfall - dumb unit tests. What is the recipe for a popular unit-test pitfall ? Assume unit tests are very important Test everything verify every method call Get 100% coverage Yes, the above is bad. The most obvious problem you will find yourself struggling with will be failing tests regularily, and changing the tests to pass those failure points. That is the direct opposite target we want to achieve from unit tests. Upgrading of a unit test happens, but it shouldn't happen too much unless you specifically changed code in order to change the business logic. When a test fails, it should point to a problem with the code not with the test. Why do we fall to this pitfall ? Because we: Create unfocused unit tests  We test all the easy things instead of testing the important things We te...

Mocking in a mock-shell (oops... nut-shell)

Mocking is a term used to describe a wide array of types, which is inaccurate. Well, now that everyone uses it as a general term, I assume it is ok to have one word to rule them all, but still, just for the sake of accuracy I will post here a short explanation. When doing mocking today, we usually use a mocking framework eg: Mockito etc... This framework allows the developer to mock an object for testing (or any other) purposes. Why mock ? Why will we want to mock an object instead of using the original one ? Maybe the original one is very complex Maybe the original one demands resources we don't want to mess with Maybe using the original one can have a restriction on our code Other things... So we want to use mocks. What can we do with them ? Sometimes we want to construct an object which needs an other object in it's constructor's argument list, we will just mock that argument and send it to the constructor - quick and easy. S...