SubClosure

{ Don't Repeat Yourself ! }

Browsing Posts in General Programming

just rediscovered my good old friend yoxos for downloading customized eclipse packages.
http://eclipsesource.com/en/yoxos/download-yoxos-5/

It allows to save profiles for installing the same eclipse configuration across multiple computers which saves heaps of time.

Have you tried to create a paypal button and pass a return URL to paypal that includes some paramters and experienced that paypal will only return visitors to your main page, ignoring your GET parameters ?

something like:

<input type=”hidden” name=”return” value=”http://www.mypage.com/index.php?display=thankyou”>

will not work unless you also specify this parameter:

<input type=”hidden” name=”rm” value=”2″>

this will instruct paypal to post its own parameters as POST and keep your parameters as GET.

Or as explained in the Paypal documentation:

“a value of 2 means: the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted”

Hope this will help someone.

If you want a secure channel when visiting unencrypted websites you can use an ssh port forwarding to tunnel all
browser traffic through ssh.

ssh -D localhost:5555 username@yourserver.com

Then configure your browser to use manual network settings and
enter localhost and port 5555 as SOCKS host.

use the following command to install time zone description tables into a MySQL server on a LINUX system.

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

you can then run ‘SET time_zone’ queries, e.g.  SET time_zone = “Pacific/Auckland”

This is very easy to do.
Assuming the database on the remote server runs on the standard mysql port 3306, the following command will establish the tunnel.

ssh username@remoteserver -L2000:localhost:3306

If successfully logged in through ssh, you can then connect your mysql client to port 2000 on your local machine and
will be able to use the remote database just as if it was running on your local computer. The good thing – all traffic will be encrypted by ssh.

obviously the L2000 means the port to be used on your local machine and 3306 is the port that will be used on the remote machine.

Note you can also add -f paramter to the ssh call:
ssh -f username@remoteserver -L2000:localhost:3306
if you want ssh to run in the background.

Ever had to choose a new secure password but couldn’t think of anything and ended up using the same old insecure password as always?

Well here is the solution. It comes in form of a little Unix/Linux programm, called pwgen. It automatically generates difficult passwords that are designed to be easily memorized by humans.

This Flex Application is a frontend for pwgen. You can use it to generate as many passwords as you like.

If you use ant to build and deploy your application,
the scp task comes in quite handy to automatically upload you project to the production server.

In your ant build.xml file you can add a line like this to your target

<scp file=”${zipfile}” todir=”${server.username}:${server.password}@${server.name}:” trust=”true” />

Where ${zipfile}, ${server.username}, etc are properties that where earlier declared
e.g. <property name=”server.name” value=”192.168.0.1″ />

The ant scp task depends on an external library that can be found here.
You need to download the jsch-0.1.42.jar and copy it into your eclipse ant library folder

e.g. /Applications/Adobe\ Flex\ Builder\ 3/plugins/org.apache.ant_1.7.0.v200706080842/lib/

(on mac I had to copy this file to ~/.ant/lib to work )

Important! You need to restart Flex Builder after that.

After that you can run your ant target and the zip file will be uploaded to your server through scp

I have recently found an awesome thread on software comments.

It made me laugh out loud a few times, even though I was in a very bad mood that day.

Some of these comments are just hilarious. Sooo funny.

Check it out

http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered

In order to view and edit Mantis Tasks directly from Eclipse or Flex Builder
you need to install the Mylyn Plugin for eclipse first:

http://www.eclipse.org/mylyn/

Then install the Mylyn – Mantis Connector:

https://github.com/Mylyn-Mantis/mylyn-mantis

To add your mantis repository click on Window->Other Views in Eclipse.
Select the Mylyn Folder and add task list and task repositories.

Then go to the task repository view, right click and choose to add a new repository.

Now the trick is to enter the right URL to your Mantis service file.
Its normally found under http://yourdomain.com/mantis/api/soap/mantisconnect.php (since mantis 1.1.0)

If that’s done you can add a query by choosing a project and a filter (needs to be set up on the mantis web interface first) .

Now you can view and change your mantis tasks in the task view.

By default User Registration is enabled after a fresh Mantis Installation.
Everyone can easily create an account.

From the documentation its not so clear how to disable it and there is no obvious option in the mantis admin interface either.

To actually disable it, you have to open the file  config_inc.php
in the mantis root Dir and add this line:

$g_allow_signup = OFF;

Get Adobe Flash player