Archive for the ‘web’ Tag
SSL and Java (ciak 2)
Last time we spoke about accessing a site via HTTPS using the pure Sun way.
Today, we see the same problem, solved with the apache HttpClient libraries. This library require a keystore specified in the code. In order to generate a keystore, you will have to download a certification file as described in the previous post and then create a keystore using the keytool program. I don’t remember well how to create a new keystore with the required certificate via keytool (I did’t write it down), but reading the help of the program it should be something like:
keytool -importcert -alias <my_alias_certificate> -file <path_to_the_cer_file> -keystore myKeystore.ks
where myKeystore.ks is the name of the file containing the keystore. The pros of using this approach is that you can provide a .ks file among with the program, in a location desired and the program will use it, avoiding post-installation procedures to register the certificate on each jvm.
So, assuming to have our keystore into a sub-directory certs the code for using the site is in the pdf as usual.
[CakePHP] Alias in the url. Take 2
Some days ago, I posted about having dynamic URL aliases with cake-php 1.1.18. In that post I used the AppError object trapping the missingAction error.
When I was ready for production environment, during tests I wondered that the AppError is ignored when core debug level is set to 0. While I’m asking about the utility of this behavior, I asked in the list and searched for a solution.
One solution could be to take the __construct method from the ErrorHandler, removing the Configure::read() test and paste it into the AppError::__construct() without calling the parent::__construct(). But in this way if some new feature, fixes, etc. is distributed within that method you’ll probably miss it until you monitor each release.
Finally I opted for useing the routes.php file mapping each action and then mapping the “missing action” to the controller::view() action and the manage the code inside it. Here is a PDF with an extract of the code.
[Script-Fu] webify
Finally I entered also the Script-Fu world. For the photography school I’m attempting I had to deliver to my teacher about 350 photos. posting them i JPG full resolution would have been raving. So I though to my self, why don’t learn a bit of script-fu and do a script for Gimp that will convert a directory of JPG into others JPG of smalles size?
I know I could have searched for something already done but I wouldn’t have learned Script-Fu/scheme.
This is my first script. I surely have not followed conventions and surely it could have been done better. Maybe there will be a time when I will improve it. For now it’s it and it’s working for my tasks.
The script will take a single JPG or all JPGs in a Directory, resize it to a custom size (by long image side), default 800px, convert it to 72dpi and save it with a different name. Leave a color version or a quick conversion to grayscale. This last one is useful in order to have a look for an entire set if it looks better in color or B&W.
However here is the source code (pdf) to copy and paste into an scm file.
Leave a Comment
Comments (1)

Leave a Comment