Posts

Showing posts from 2015

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 amazedDumb 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 timeDictionary 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't a word or word…

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 EXE file.

Why Not…

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 choiceRecording software: Audacity to record, edit and finally export as mp3Save the mp3 file using 56kb bitrate for human voice best size/quality ratioSave 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 itUse the Seriously Simple Podcasting plugin for much nicer podcasting look in your siteAfter recording and publishing a show or two, submit your podcast RSS feed to:The biggest podcast sites - ManuallyAll 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 directoryWhat 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 Sync tool to mirror the designat…

Web Crawler / Spider Features

Let's build a web spider / crawler

Features Multithreaded (else network will slow it to a crawl)Work with proxiesManage 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 httpsEvade spider trapsHeed 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 etcSIMPLE 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) (Optional) pluggable Jsoup for the output?(Option…

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 importantTest everythingverify every method callGet 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 thingsWe test implementation instead of testing the business logic Let m…

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.
Sometimes we want to mock an object and make …

Mailing List Managers

Requirements Subscription form in my site which will collect emails and enable me to manage my mailing list with the following features: Will have a nice form which I can tweak and insert into my HTML code to collect emails in my siteHave multiple groups of emailsBlast emails to any specific group(Nice to Have) Will read RSS and send emails upon update of RSSWill be able to drip emails for each subscriber according to the time on my listUser management (add / delete/ import / export etc)(Nice to Have) eMail templates(Nice to have) Nice backend GUI

Main Obstacle Email provider might block me as a spammer
This obstacle can be worked around by having a good scheduling dripper etc (but this is only a partial solution).
Best solution is to have a provider (costs money) which will white list and drip the emails using the best intervals.

Paid solutionsaWeber - quite expensive, might be good for very large lists MailChimp - Free for first 2000 subscribers (but some features are disabled) MadMim…

GUI in Java Revisited (2015)

Which GUI framework should I use for my Java application ?
Brief History: AWT -> SWT -> Swing
When I had to choose which IDE gives me the best Swing WYSIWYG builder Brief History:
Eclipse crappy builder -> Netbeans Matisse -> Google's Windows Builder (donated to Eclipse)

All of the above were my conclusions till 2014, but much had changed, HTML5 is rising with many many 3rd party frameworks Jquery MVC frameworks, JavaScript server side frameworks etc.
In the Java scene, Oracle has introduced JavaFX several years ago but it wasn't built specifically for forms, and it had it's labor aches.

Nowdays, JavaFX has matured much, Oracle has pushed Swing aside and introduced a very nice WYSIWYG form editor for JavaFX, and HTML5 isn't a myth but a very live framework.


So what are my conclusions? Html5 sounds great, but I need some more straight forward out-of-the-box html5 with Java solution instead of a bunch of 3rd party Javascript libraries which should integrate wi…

Build a simple & cheap arcade machine

I want another machine at my home which will be dedicated to games
These are my requirements Many different games without the hassle of installing and setting them up (console emulator)Cheap machine (console emulator, probably not one of the newer ones like ps2 and up)Joysticks (several bucks at eBay)Multiplayer supportWireless controllers (so the kids won't damage the machine when they pull the controllers)Nice launcher (So each game will be presented nicely)Launcher could scrape online databases for the details on every gameWifi support (optional, as I can connect to RJ45 once and get all of the scraping done)HDMI outputCommunity support
After some digging I think I can get the best results with Android or Rspberry PI.

I think there is better support for the Raspberry machines, so I went on the Raspberry PI B+.

So I need the following:  Buy Raspberry PI b+ with a simple case (latest version) (about 45$ with shipping etc)OS (linux distribution customized for radpberry)Buy Bluetoot…