19 March 2012
Removing the Wordpress "god_mode_on" virus from php files
If you open your Wordpress plugins area and you see nothing or almost all the plug-ins missing, then you highly likely have been infected by the "god_mode_on" virus. See here for an in-depth intro on how to fix it. If you have ssh access and you can run perl, here is an one-liner that will remove precisely the infected part of every php file:
find . -type f -name \*.php | xargs perl -i.deletemenow -wpl -e 's/.*god_mode_off.*?\?>(<\?php\s+\?>)?//'
If you fee like removing the backup files created in the process, you should also:
find . -name \*.deletemenow | xargs rm
Note that some hosting companies under "jail ssh" won't allow you to use find. In many cases the same hosting companies will have python enabled so you can use the following script:
#!/usr/bin/env python
import os
def processDirectory ( args, dirname, filenames ):
print dirname
for filename in filenames:
print dirname + "/" + filenamebase_dir = "."
os.path.walk( base_dir, processDirectory, None )
(adapted from here)
and then some grep-ing to create the "hot" list of files to fix. e.g. to remove the deletemenow files:
./myfind.py | egrep '\.deletemenow$' | xargs rm
Other bad things to grep for:
GetMama malware:
find . -name \*.php | xargs grep -l "GetMama"
Padded javascript (be really careful with this one):
find . -name \*.js | xargs grep -l "ua=navigator" | xargs perl -i.deletemenow -wpl -e 's/.*ua=navigator.*//'
08 February 2012
Bookmarklets are really useful
javascript:var%20s=document.createElement('script');s.setAttribute('src',%20'http://jquery.com/src/jquery-latest.js');document.getElementsByTagName('body')[0].appendChild(s);s.onload=function()%20{%20var%20par%20=%20$($("table.ResultTable")[1]).find("tr[bgcolor]").filter(function(ind){%20return%20$.trim($(this).find("td:eq(4)").text())=='%CE%A0'%20});%20var%20gar%20=%20$.map(par,%20function(v,i)%20{%20g=$(v);%20return%20[[%20$.trim(g.find("td:eq(0)").text()),%20$.trim(g.find("td:eq(3)").text()),%20$.trim(g.find("td:eq(2)%20span").attr('title').replace(/\n/g,"%20"))%20]]%20});%20var%20txt="";$.each(gar,%20function(i,v)%20{%20txt+="\t"+v[0]+"\t\t\t\t"+v[0]+"\tALPHA\t\t\t"+v[2]+"\t"+v[1]+"\tEUR\n";%20});$("body").children().remove();$("body").append($("<pre></pre>").text(txt));};%20void(s);
This bookmarklet converts my bank's (Alpha bank) uggly table to a format ready to copy-paste into my incomes spreadsheet. Saves me at least 5 minutes a day :). You might want to get it through a javascript prettifier to see the way it works. Just for reference it has been build on top of the jQuerify bookmarklet.
25 January 2012
Authenticate with cloudservers to the London Rackspace Cloud
If you are using the London Rackspace Cloud, you might notice that once you install the "cloudservers" utility, it won't allow you to login but it will give you this "beautiful" error message instead:
$ cloudservers --username XXX --apikey XXX image-list
Traceback (most recent call last):
File "/usr/bin/cloudservers", line 9, in <module>
load_entry_point('python-cloudservers==1.0a5', 'console_scripts', 'cloudservers')()
File "/usr/lib/pymodules/python2.7/cloudservers/shell.py", line 409, in main
CloudserversShell().main(sys.argv[1:])
File "/usr/lib/pymodules/python2.7/cloudservers/shell.py", line 123, in main
self.cs.authenticate()
File "/usr/lib/pymodules/python2.7/cloudservers/init.py", line 60, in authenticate
self.client.authenticate()
File "/usr/lib/pymodules/python2.7/cloudservers/client.py", line 80, in authenticate
resp, body = self.request(self.AUTH_URL, 'GET', headers=headers)
File "/usr/lib/pymodules/python2.7/cloudservers/client.py", line 35, in request
body = json.loads(body) if body else None
File "/usr/lib/python2.7/json/init.py", line 326, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 360, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 378, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded In order to Quick Fix this, just vi /usr/lib/pymodules/python2.7/cloudservers/client.py and replace the AUTH_URL from auth.api... to lon.auth.api...
#AUTH_URL = 'https://auth.api.rackspacecloud.com/v1.0' AUTH_URL = 'https://lon.auth.api.rackspacecloud.com/v1.0'
That's all! It's a pity London's Rackspace Cloud is not that of a first class citizen yet but I love Rackspace and it does great job in general so I forgive them
09 January 2012
Basecamp asks for another $24 before letting me go
Basecamp is trying to get a few last bucks from me by forcing me to upgrade just to download data and todo lists from a few archived projects.
Recently I realized I'm not really using Basecamp that much and I downgraded to the free version. I was expecting that the functionality of the project would remain the same. This wasn't true. I can't any longer access my archived projects because there is no way to archive the main one. I shouldn't complain... it's on their knowledge base:
Project are hidden but don’t worry – your projects are still in your account. The Free plan allows access to just one project, so you won’t be able to access your other projects until you upgrade to a paid plan again.
But it's not there on the warning message when they let you downgrade. They just mention that you will be able to use only one project which for me means exactly that. That I won't be able to have many active projects simultaneously. I guess that for people who start from a free trial and switch to the paid versions it *might* be obvious but for me that was not the case. This meant that I didn't have the opportunity to backup my todo lists since I guessed I would still be able to switch between projects and the limitation would be JUST what they mention in their comparison table - That I won't be able to have more than one active project at a time.
Quite annoying. I hope they fix this "issue" soon.
12 November 2011
MySQLSyntaxErrorException: Unknown column '...' in 'field list'
MySQLSyntaxErrorException: Unknown column '...' in 'field list'
Man... just check your Datasource. You're probably trying to connect to the wrong databse!
:Z
07 October 2011
Comparison of wordpress membership site plug-ins
Hello,
please note - no affiliate links here (actually no links at all) so I'm objective. Just finished doing some research and I share the results. After doing an initial research I found two key features that a membership plug-in should have for me to be really useful:
a) It has to have built-in affiliate system (so I don't have to buy a separate one - save lots of money there)
b) Has to have the ability to lock users if they share their accounts with other users (login from multiple IPs)
As a bonus I like the plug in to have GetResponce and MailChimp integration (I don't want to send e-mails from my server)
This means that if those two key features are not important for you, this list will highly likely be invalid for you. For example I'm tech savvy enough so that great support, ease of use etc. aren't my top priorities.
#1 DigitalAccessPass (digitalaccesspass.com)
DAP is the best plug-in I’ve seen. I didn’t like their website because initially it didn’t look credible but it’s really fully featured including 2-level affiliate system, extensive integration, supports locking users if they abuse the account and has lots of automation.
#2 Memberwing (memberwing.com)
This is a nice and feature rich plug-in. Their website confuses me a little bit (actually a lot). I can’t figure out what the real difference is between the Pro Unlimited and the TSI edition. I believe they should merge those two (they have the same price anyway). It looks like the “urgent information delivery” must be a priority for some of their customers. Anyway this has almost every feature you will need, but doesn’t have GetResponse integration. If it did, it would be a real pain to choose between this and DAP. I kind of dislike the fact that they have two versions of their video on their youtube channel. His watermarking idea is really cool although by the time you will use it, it will be too late. I would prefer to put the e-mail or the credit card number as a watermark to the protected content.
#3 WP Member Site (wpmembersite.com)
Misses lots of features but it's #2 just because it's excellent value for price. Give it a try - you have little to lose.
#4 aMember (amember.com)
Amember looked great and with a very reasonable price but it had a bad Wordpress installation review on a site. It also has plug-ins for everything and I'm too lazy to figure this whole system out.
#5 WishList (wishlistproducts.com)
Great plug-in in terms of marketing (i.e. their site looks great). The feature list is not that rich after all. It certainly doesn't provide an affiliate program build-in. It claims to be very easy to use and I have a feeling it is. Probably it’s the solution if you want something supereasy.
#6 WpMember (wp-member.com)
Excellent price (specially for single licence) and PCI compliant. These guys look like they have a quality product since they mention security all over the place. Doesn't have an affiliate program build-in though.
#7 MagicMembers (magicmembers.com)
Nice clean website and quite a few features but it has the extra magicaffiliate module that gives the affiliate functionality but then it costs too much (even with the 20% discount they give).
#8 s2Member pro (s2member.com)
This looks good with a bit too many pricing options and it’s really missing the feature list on the main site. You have to go through the list on their wordpress.org plugin page and see the extra features on their main website to figure out what’s going on. That said, it misses the built-in affiliate functionality so it’s out. I also don’t like the fact that it somehow gives a feeling that you need to use their theme to get full advantage of the plug-in. This is not explicitly stated and I might be wrong but I got that feeling somehow.
#9 WPMU (wpmudev.org)
This is a membership site offering a membership plug-in as a product. I don't feel like trusting this site because it seems to be all over the place instead of just doing wordpress membership plugin.
08 September 2011
Bye bye appsumo!!
Guys you are too effective and I lose money because of you. You know..I've been pitching my customers about the whole idea of "targeted advertising" which gives people exactly what they need..the offer they can't resist etc. And yes-now I'm the "victim" of it.You see the deal and you have two options: a) buy or b) be sad that you missed something good and with a potential of infinite ROI if the day had 140 hours. By receiving your e-mail I've lost because either a) or b) are going to make me feel bad. I don't lose when I buy, I lose by the time I open my mail. So I just bought the <latest offer> and decided that no matter if I have the time to watch it or not, I'm going to make it save me at least its price by the first month... by unsubscribing!! Byeeeee! :*
21 July 2011
A 5 step secure Wordpress outsourcing workflow using git
An essential problem many software companies face when outsourcing is that they do not trust contractors. There are two main major security issues that have to be accessed in the scenario. The first is what data is the contractor able to see (what goes out of the boundaries of the company) and the second is how much do we trust the data/source code or whatever the contractor is delivering. A php backdoor can be a single file hidden in a directory and it exposes your database and filesystem to the public. A contractor with just ftp access can easily add it on your website and you would never know.
You can overcome both these problems without having to pay a fortune by employing some processes large companies use but in a "lite" fashion by using git, a staging server and peer reviews. Git is a Decentralized Version Control System that is flexible enough to allow us to design custom workflows specific for our needs. Linus Torvalds, the inventor of git an linux itself explains here (watch the first 2-3 minutes) to Google employees the use of git in order to utilize their natural Network Of Trust to do security.
Let's assume we have a Wordpress site "live" running on a server. The server is running CentOS-6.0 with a standard LAMP stack, Memcached and git core. We want to have a contractor change the layout by changing a few photos and modifying a few paragraphs of text. We can see a secure - low cost workflow in the diagram below.

We assume that all the files for this Wordpress site are in a git repository and a MySQL dump file is also included in that dump. The first step we do is to clone this repository to a contractor's branch. The second step is to run a script that will wipe out sensitive data e.g. reset all Wordpress' user passwords, reset MySQL's host and password configuration, clear any API secrets and remove any membership content, private comments, messages etc. After this step we have a "clean" developer's branch. This branch can be distributed to one or more developers.
The developers do whatever changes they need to do. They might break things but this will take place just in their local development servers. When they are ready we move on to step three and we pull their branch to a staging server. The staging server must be similar to the production server in terms of settings and configuration but it doesn’t have to be as powerful since it won't serve any real traffic. It should also have "dummy" username/password settings since we should be able to just pull from developer's repository and check that their changes have been done correctly.
At this point we are ready to perform some security audits. These will take place by checking the changes in the database (with Toad or similar tool) and the files (with git). The audit signs-off the changes which should be merged manually back to the production repository (step five) and pulled from the production "live" server.
The benefit of using this workflow is that it's fast and it allows us to leverage the tools to do minimal work for each deployment. We can review just the changes during the security audit use git tools to do the merge and enjoy the security of never allowing somebody to play with our live servers nor expose any passwords or content we wouldn't like to.
04 July 2011
ubuntu Fatal error: Class 'Memcache' not found in .. on line .. Call Stack
Search no further. You just have to go back,
apt-get remove php5-memcached
apt-get install php5-memcache
and...
service apache2 restart
Yes, I know it's only 1 little 'd' difference but it can still waste you a few hours! Don't worry - it will stay between the two of us.
04 June 2011
Getting netbeans to have smooth fonts under x11/ubuntu
This really helped me keep working with netbeans under ubuntu because the out-of the box default rendering was hurting my eyes. Apparently you have to set a Java option that modifies some hints for font rendering:
Go into your Netbeans install directory. Look for the etc directory and open the file named netbeans.conf in your favorite text editor.
Add the following to your netbeans_default_options:
Code:
-J-Dawt.useSystemAAFontSettings=lcd
Note that it slows down the system a little bit specially if you work on a remote but nevertheless I prefer it this way.
UPDATE: I reverted it. I prefer it to be tiring than slow!
And it's funny but it looks like my eys addapted!
19 May 2011
The easiest way to have linux under Windows 7 with VirtualBox (+bonus mongodb and python)
It took me quite a while to configure this developer's virtual machine (after struggling for a few hours with the "Host-only adapter" feature so I think it's worth sharing.
Download Virtualbox, install and then create an ubuntu virtual machine (by putting an ubuntu .iso to the virtual DVD Rom).
In the new VM First of all install ssh:
https://help.ubuntu.com/6.06/ubuntu/serverguide/C/openssh-server.html
Then install samba and allow home:
http://www.howtogeek.com/howto/ubuntu/share-ubuntu-home-directories-using-samba/
On the VirtualBox window go to Devices > Network Adapters and just choose Bridged Adapter.
With a single ifconfig you can find your ip and then //ip/username to see your home directory.
Did I mention how easy it is to install mongodb or couchdb on it?
So let's say you install mongodb. Then all you have to do is to follow this cute tutorial (those guys are really clever).
Next step. You install python (if you don't have already) on your host system (Windows). Then you install pip or use easy_install (easy_install pymongo) to install the python mongo extension.
Finally you testing the connection is as simple as this (assuming your virtual host's ip is 192.168.1.7):
C:\Python27>python
>>> from pymongo import Connection
>>> c=Connection('192.168.1.7');
>>> print c
Connection('192.168.1.7', 27017)
>>> print c['test'].users.find_one()
{u'languages': [u'english'], u'_id':
ObjectId('4dd437fbe20bc55e6bbd3e82'),
u'name': u'Cash'} Beautiful instant results. Then you can move on with some more advanced examples. Coder's delight!
16 May 2011
Correcting git's EOLN "features"
Me and my team are using SmartGit for git operations and some of the members were having problems with corrupted scripts with cygwin because git was automaticaly converting LF's to CRLF's. We thought it was SmartGit's problem but after all it turned out to be git's problem.
If you have this problem and you mamke a:
git config --list
you will highly likely see something like this:
core.symlinks=false core.autocrlf=true color.diff=auto color.status=auto color.branch=auto ...
the second line is causing the problem. Just do a:
git config --system --unset-all core.autocrlf git config --system core.autocrlf false
and you will never have this problem again.
02 May 2011
xampp php pear and jetbrains intellij IDEA
Ok, I know that those things should just work... but sometimes they don't. I mean software gets updated all the time and there allways some tweaks to do but in this case there were too many. Worth blogging about.
So... if you get errors like
Error: (E_WARNING) require_once(PHPUnit/Framework.php):
failed to open stream: No such file or directory
PHPUnit is not configured properly
with JetBrains IntelliJ IDEA (an excellent IDE by the way - big up for the out-of the box fast syntax error checking), we open the command prompt and go to
C:\xampp\php
then we type:
pear upgrade PEAR
We get hopefully something newer than pear-1.9.2
then we follow the process from the first post from here: http://forum.kohanaframework.org/discussion/7346/installing-phpunit-on-windows-xampp/p1
2. Type "pear update-channels" (updates channel definitions)
3. Type "pear upgrade" (upgrades all existing packages and pear)
4. Type "pear channel-discover components.ez.no" (this is needed for PHPUnit)
5. Type "pear channel-discover pear.symfony-project.com" (also needed by PHPUnit)
6. Type "pear channel-discover pear.phpunit.de" (This IS phpunit)
7. Type "pear install --alldeps phpunit/PHPUnit" (installs PHPUnit and all dependencies)
We might have to increase the php memory limit in php.ini (I hadn't). Hopefully at the end of this process you have the new PHPUnit in C:\xampp\php\PEAR (you should be able to see Framework\MockObject and Autoload.php in it.
That's it.
Now time for some fun. To enable the features that you can find here: http://www.jetbrains.com/idea/features/php_editor.html
You have to go to follow the last message from here: http://devnet.jetbrains.net/thread/290565 (File | Settings | PHP | Php) and set the xampp path appropriately and check that you have PEAR directory included.

After intellij IDEA automatically updates its includes you will be able to right click on a class and create new Unit tests.

You can then right click on a directory (not the test file) and run all the tests. Don't forget to toggle the "Hide passed" button in order to be able to see the full tree including the passing tests.

26 April 2011
Trading explained
You are driving in a highway and there if fog. It's night and you have your lights turned on.
You can see a few meters. After that it's darkness.
Now, the highway is turning in general left. You can safely assume that it will keep going left.
BUT
If it suddently goes right you should be aware of that.
The "lag" is your reaction to the change of the direction of the street. In order not to have it, you have to go really slowly so that you can react instantly on every change of the road (price). The more you speed up (smooth things out with the MA), the more your lag is going to be.
NOW these are the rules, this is the physics - you can't do a lot about it.
What we are plalying with with several MA's is just the TYPE of the light. This means that some lights are linear and allow us to see usefull & useless things in front of our car. They light with the same intensity all over the street. Some other lights are focusing 10m away but don't really light on your immediate sight. Some other just focus in 1m and they light slightly in 10m but they are in general focused close to the car.
As you can imagine choosing the right light depends on the conditions. The best you can do is automatically choose the right light (kalman, adaptive etc.) according to the conditions of the area you are driving, the speed you are driving, how tired you are etc. This is the best you can make the machine to do for you with MA's.
Now trying to imagine what's beyond the lights is just destructive. You can make some guesses but really beliving them will certainly kill you sooner or later.
22 March 2011
Get crossdomain.xml right with rackspace cloudfiles/amazon s3. etc.
I was working with an interesting configuration of servers a few days ago and flash's security policies turned into horror. Here you will find the correct way to do crossdomain.xml when you have many servers. So let's see what we have:
random.com: The server which hosts *your html* that has the flash embedded in it. This might be any random server
static.mysite.com: The server which hosts *your swf* and is probably using some kind of CDN for distribution
dynamic.mysite.com: The server that provides an XML file to the flash file with e.g. the images for an image gallery
images.mysite.com: The server that hosts your images for your image gallery.
etc.
Now, the only two places you need to have a crossdomain.xml are dynamic.mysite.com and images.mysite.com. In both cases the crossdomain.xml should contain:
<?xml version="1.0" ?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain=" static.mysite.com"/>
</cross-domain-policy>
Notice that it allows access to the server that THE SWF FILE is hosted, NOT the random.com where your html comes from (just saved you a few hours of banging your head against the wall).

Now, you will probably be using a Loader from ActionScript to load your images like this:
var ldr:Loader = new Loader();
var url:String = "http://www.images.mysite.com/my_happy_jpg.jpg";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
This doesn't work but it throws the usual security exceptions (Error #2122). This works:
var ldr:Loader = new Loader();
var url:String = "http://www.images.mysite.com/my_happy_jpg.jpg";
var urlReq:URLRequest = new URLRequest(url);
var context:LoaderContext = new LoaderContext();
context.checkPolicyFile = true;
ldr.load(urlReq, context);
Note that on the other hand if you use URLLoader, it checks for crossdomain.xml by default so you won't have to add an extra LoaderContext.
27 January 2011
02 November 2010
If you can't delete keyboard languages like CH (Chinese), KO (Korean),JP (Japanese)
If you can't Delete keyboard languages CH, KO,JP etc. - that's a common very annoying problem of Windows Seven combined with Microsoft Proofing tools. You might find those languages appearing out of nowhere and there is no way to delete/uninstall them from the language setting. That means that you have to press Alt-Shift a hundred times before you return back to the normal English keyboard. In order to remove all those Asian Languages just remove proofing tools, reinstall with different settings e.g. don't install those languages during proofing tools installation and that's it... you are free!!
25 October 2010
10:20: Started running backups with my Super Backup System.
10:21: I realize that the only think I don't backup is my bookmarks. Let's solve this problem innovately. Subscribed to Delicious, you can find me here
10:25: Run a Directory Size session to see if there are any files in places I'm not aware of
10.56: Another thing I don't backup is the more than 25 Windows Live Writters Blog Accounts I have (don't ask). I install the Import and Export Wizard in order to be able to export and save them.
22 October 2010
Java decompiler saved the morning
This java decompiler saved my morning. I've just finished writing some beautiful code, ready to pack and go and I convinced myself to do some cleanup that included... removing an unused package.
So right click > Shift Delete and then I freeze! I just deleted the wrong folder - forever! I didn't panic. I knew this couldn't be happening to me.
So the only thing I was left with was the compiled .class files in another Eclipse directory. Thank god it was java so the "Fern Flower" de-compiler worked like a charm and saved me a few hours of work. That was close!
P.S. By the way it did excellent job! I haven't realized Java bytecode was so verbose!
26 September 2010
Good training for serious internet marketing weight lifters
About six months ago I took Web CEO university's Professional Internet Marketer certification. After reviewing the last few months I'm wondering how much value did it provide me?
Despite the fact that I've been quite shy and not persistent on using the certificate to promote SEO/internet marketing services, I have to admit that this certificate gave me a strong edge in terms of real knowledge in this hot area.
With a few exceptions like the (quite expensive) "Get Altitude" program, all the internet marketing programs out there are just BAD. The reason is that 9 out of 10 courses out there are delivered by experts on a specific field but there are almost no courses that keep some distance and cover objectively the whole field of internet marketing. Usually the courses I name "BAD" start with something like "You want to be an internet marketer and the most essential part of internet marketing is X" (usually X=traffic)... and then they spend hours explaining how to e.g. build traffic by using a specific methodology.
But this doesn't make you marketer. Exactly in the same way that you can't do serious weight lifting by exercising only biceps, you can't do internet marketing if all you know is traffic or social. In order to do Internet Marketing you have to know everything and exercise to enhance your strengths and hire or partner up with other professionals to eliminate your weaknesses.
This is why I found the content of this course quite valuable. It covered virtually everything which is called internet marketing today.
- Search Engine Marketing
- Social Media Marketing
- Web Analytics
- Bid Management
- Email Marketing
- Affiliate Marketing
By understanding both the depth and the breadth of Internet Marketing I found myself many times laughing in the face of experts that say things like "Social media is the next big thing" and then they start pitching. Try your luck with someone guys!
23 September 2010
Trying to outsource in China makes me realize rights I didn’t know I have!
I was reading about censorship from the Chinese government but I must say it hadn't really touched me up to now. A Chinese Software Engineer is interested in bidding in one of my projects but he can't because he can’t download the file from my (Bluehost) website since his government censors it!!
By:****
Comment:Hi Dimitris,China blocks that site, I know this by using a demo VPN.
Proxy is very hard to find and almost all blocked by the government of China. I tried downloaded about 4M and then got cut off.
They just block everything regardless whether it is "harmful".
I think the only way possible here is that you transfer the file to me with IM (MSN/Yahoo) or email.
Maybe you have better suggestion, and I'm waiting for your reply now.
Sincerely,
****
I've never thought that being able to visit virtually every site is a right that I have by living in a Democratic and free country and there might be tens of countries that this right gets violated. I just wish things were more free in China.
03 September 2010
The perfect mobile office backup system
Ok, I have been postponing this post for a long time but actually this BACKUP SYSTEM just saved me from a real disaster - losing more than 20 hours of work so I decided to finally polish and publish it. Enjoy!
The perfect backup system is a hierarchical one. After trying several systems, the hierarchy I use quite successfully nowadays is this one:

My working set is the documents that I'm working on right now. These are the most valuable data and are usually the LESS PROTECTED ones. This is an interesting paradox of the information industry. The documents you are working on the last few days and you have to deliver tomorrow are probably the most mission critical information you have at any given moment. This is usually the least replicated information which is usually lying in just one laptop or USB drive. This means that it's really easy to get lost because you lose the USB drive or your hard disk breaks or for any other reason. You need to put special effort to backup those documents as soon as they are created by sending them to yourself with an e-mail etc.
On the other hand old documents that have already paid for themselves and are not that valuable anymore usually are replicated all over the place, in USB drives, backup disks, e-mails etc. This not only means a versioning nightmare that makes it difficult to find what you want the time you want it but also it is a waste of disk space. You need to put conscious effort to cleanup, keep tidy and reduce replication of those old and not that valuable data.
My Perfect Backup system solves this problem. I use InSync and Windows scheduling to automatically replicate directories. I have the laptop disk, an external HDD and a backup HDD. On the laptop I have only one directory which is called safe. This directory gets automatically synchronized every 6 hours with the External HDD and the external HDD gets automatically synchronized every day with the Backup HDD. Most of the time I work on things on the safe directory. Also I use windows scheduled tasks to automatically backup Mysql databases (with automysqlbackup and cygwin) and svn repositories directly to the safe. This means that practically with zero effort I have three backups of the things I'm working right now! That's quite safe and effortless!
The second class of documents is what I call reference material. These are documents that you rarely use but if you have them the time you need them they can save you lots of time. This might be some work you did a few years ago, or other piece of information that you rarely use but it has high value under certain circumstances. The problem with this information is that it's usually quite huge and rarely used. I have all this information on the directory reference that gets automatically backed up. There is nothing very exciting about this directory apart from the fact that whenever I have the External HDD with me I can connect it to my laptop and know that I have all the reference material I need.
Other content like music or movies that I have in DVDs and I can recover easily in case I lose them is not mission critical at all. I store them in a directory called bulk. This directory is disposable and in case I lose it I could recover everything from other sources within hours. This directory is quite large and I never back it up. It means quite some savings in terms of space but also in terms of keeping those data organized.
I also developed the habit of delivering by e-mail my products as soon as they get finished which means they are always implicitly backed up on a Gmail server.
As you can see with this backup system you have all the benefits of mobility and at the same time reduce the waste of space and most importantly it's self maintained and flexible. If I delete something it takes about a day till the change propagates from my laptop to the backup disk. This is more than enough time to realize that I did something wrong and recover it. On the other hand I don't keep versioned replicates that would make everything (including search) more complicated and would require huge amounts of space. If I delete something from my safe disk and I believe it's ok for more than a day I'm probably right and this piece of data might rest in peace for ever.
If on top of the backup infrastructure I need security e.g. to protect confidential data that I don't want to be published if my laptop gets stolen I usually put them in encrypted folders. If I wanted something more secure I might want to use something more sophisticated like disk encryption. I'm not doing this right now but I'm sure I would have no trouble combining such security solution with my perfect backup scheme because they are quite vertical.
29 July 2010
One year of being my own boss!
About a year ago I quit my job and started living the e-dream. I am my own boss, I have control of a business and work for rewards. It's an awesome experience and I must admit I've learned many things. I will try to summarize my experience on how this really works.
The biggest difference between working for a company and working for yourself is that in the latter case you as the main employee have to constantly feed a pipeline similar to this:

Every company has a pipeline like that and I as self-employed have to have it and know how wear different hats and operate on all those different modes.
- Marketing means bringing customers to me
- Sales means closing deals with customers maximizing my profit
- Engineering is the middle on which is doing the job and is the only thing I used to do when I was working for a company
- Delivery is packing, testing, documenting and in general adding value to the engineering product in order the customer to accept it and use it
- Payments is actually making those ugly phone calls and sending the emails that ask for money from all those guys who owe you. This used to make me feel quite nervous.
Obviously while working for a company I was exposed only on a very small part of those and I was very weak on the rest. The truth is that the rest is I would say at least equally important as doing the engineering job. This is especially true for marketing. You may find yourself having set-up (and paying) the whole pipeline and having it waiting for The Customer to arrive. If marketing doesn't bring him you have big problem. Marketing has to fight the competition and many times define the requirements.
The second important thing is that it takes time from the time you take a marketing action to the time that money comes in your pocket. I send one morning in December about 30 e-mails (it was my first time and it made me feel very uncomfortable) to some prospects informing them of my services. About a month later one of them contacted me and he was a 1500 euro customer. I got those money on February i.e. 3 months later!
This means that as a small business owner you have to wear different hats and switch constantly between living in the present and foreseeing the future. If you feel that in two months you might be running out of projects, that is the real bottleneck NOW and no matter how loaded with engineering you are, you should stop and start doing marketing. I find sales very easy probably because I have quite some flexibility as an owner and I know the products/services perfectly. Delivery is ok but time consuming an dull. I'm a good teacher so no big problem there. Payments is pain but there are some tricks you can do. The easiest actually is to deliver so much value that the customer wants more from you and wants to have you happy.
In any case this is the summary of my first e-year. I'm wondering what's coming next!
15 July 2010
Running R from Cygwin with RCurl
R is an amazing language and for me it’s the best free substitute to Matlab. On top of that it has a very active community of developers and it has many powerful statistics and financial packages. I needed to run R from within Cygwin and use the RCurl library.
Step 1. Running R from Cygwin
I installed the R language for Windows and of course I wanted to run it from within cygwin. The only thing I really had to do for my convenience is to add the R bin directory to the path by adding the following line to .bashrc:
export PATH="$PATH:/cygdrive/c/Program Files (x86)
/R/R-2.11.0/bin/"
Next time I started Cygwin I was able to run R by just typing
$ R
Step 2. Using RCurl
From within R, the only thing I was missing was the RCurl library:
> require('RCurl')
Loading required package: RCurl
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE,
logical.return = TRUE, : there is no package called 'RCurl'
> getURL("http://www.omegahat.org/RCurl/")
Error: could not find function "getURL"
First we have to choose a mirror. Select the one appropriate for you from the menu.
> chooseCRANmirror()
The following command installs RCurl and automatically resolves the dependency on "bitops" library. It even creates the appropriate directories for you.
> install.packages("RCurl")
Let's load the RCurl library:
> require('RCurl')
And... Voilà it just works!
> getURL("http://www.omegahat.org/RCurl/")
07 June 2010
Tor with cygwin
Tor is an amazing tool for keeping anonymity on-line that allows you to change IP's at will. If you use for more than just (relatively safe) web browsing it you might find the tor-ctrl.sh script quite useful. It allows you to control tor from the prompt. If try to run it on a default Cygwin installation you will have two problems: a) telnet not installed b) xxd not installed. In order to install those two programs you have to choose the a) inetutils and b) vim (!!) packages when you run Cygwin setup. Problem almost solved! Then you will get: xxd: /var/lib/tor/data/control_auth_cookie: No such file or directory. The easiest way to get arround this is to set a password on the settings of Tod from Vidalia Control Panel > Settings > Advanced and then use the -p option of tor-ctrl.sh.
So here we are:
$ curl --socks4a localhost:9050 http://www.whatismyip.org/
81.169.183.122
$ ./tor-ctrl.sh -p "password" -c "signal NEWNYM"
$ curl --socks4a localhost:9050 http://www.whatismyip.org/
77.109.139.87
21 April 2010
Your Articles Directory SEF URL problem
The Your Articles Directory script is an amazing solution for building sites that hold keyword rich articles and some links to websites. It has problem with it's SEF support though. You can enable SEF URLs by going to Site Management > Manage Site Settings > SEF URL and choose Enable. If then you or your customers try to use anything other than English e.g. French, Spanish, German or Greek for the titles, all the "strange characters" will be trimmed out of the url resulting useless URLs. I managed to fix it by repairing the class.sef.php class to add support of what is called Greenglish - Greeklish which is translation of Greek characters to English. I managed to do it quite successfully for Greek but didn't yet have the opportunity to do it for French, Spanish, German or other languages. If you have a website using the Your Articles Directory and you would like to make SEF work please drop me an e-mail on lookfwd {a}t g mail .com and I will give it a go for you.
P.S. This script doesn't encrypt the passwords of users and that's bad because if somebody hacks the site, he can get all the e-mails and the passwords which is a real security hole.
29 January 2010
Toad rulezzz
Have I ever said how unbelievable Toad is? It's amazing. It compares not only shcemas but also data between databases. It supports MySQL and many other major DBs. It even creates diff scripts so you can synchronize them and... it's free!!! Excellent quality software for free, I'm really impressed!
23 January 2010
How to test and write correct code.
For long time (once upon a time when I was writing C++) I was looking for a book on testing and writing absolutely correct code.
There was nothing!
It looks like writing correct code was the black art coming with painful mistakes and long experience. Then I just spotted the reversal:
If you don't write correct code, then you are writing wrong code, which means code that has bugs, which means code that can be exploited.
So if you want to learn good coding and strong applied practical testing you just have to read books on hacking (e.g. this one is one of my favorites). So yes. Have one person in the team trying to crack your own code. Have him to run all the scanners and the other tools that hackers have to spot when you use dangerous API's and apply the methodologies they use to find your bugs (that they can then exploit). This is what you have to do if you want to write perfectly correct code. Write it and then crack it!
If you see the latest 10 bugs you have written, I bet they are more or less similar and I also bet they are all there in every hacking book you may read. Finally if I wanted to give a single tip to someone who wants to write correct code, I would just say this:
Assert everything; arguments, limits. Everything and especially nulls. If you have this little habit, as soon as you make a mistake you will see a bug demonstrating itself and quite close to where it was created. Assertion is also implicit documentation. The #1 code correctness tip is this; Assert everything.
Example... see the difference between this:
void dosometing(Arg[] ar1) {
for (int i = 0; i < 100; i++) ar1[i]++;
}
and this:
void dosometing(Arg[] ar1) {
assert(ar1!=null);
assert(ar1.length >= 100);
for (int i = 0; i < 100; i++) ar1[i]++;
}
The second one will give you an error on spot and telling you something relevant. The first one will give you an error in an irrelevant position. Additionally in most programming languages assert() doesn't consume any run-time resources in release mode but just in debug mode so it comes for free!
Invention of C++
I don't know if it's real or not, but it's so amazing (and so true)! Read it here: Invention of C++
16 January 2010
The big backup adventure
At some moment everybody reaches the point that he can’t afford to lose his files nor a few days of productivity in order to recover them. I want to be mobile which means that I have to store all the files in an external Tera-HDD but every second day I hear a story of somebody telling that his external drive failed. I don’t want to ever experience this nightmare so here is where the big backup adventure starts.
Requirements:
1. Little redundancy: Especially for pictures, videos and documents, having them in many places doesn’t mean just waste of time but also a synchronization nightmare sooner or later.
2. Automatic backup: I want my HDD to be automatically diff-ed and mirrored to another drive maybe every 1-2 hours. I don’t want backup which means I don’t want to have a history of the files/folders (and the redundant space it requires). I manage backup-ing with my normal workflows (e.g. svn). What I really want is just a safety mirror.
So here are the 3 steps:
Step 1: Find where interesting files are.
Nowadays wasting a single minute for less than 100Mb is a waste of time. Just backup the small files and pay a bit of attention to the large ones. But where are the large files? Here I had a clear winner. The software Directory Size helped me to find where all the big files where in order to pay special attention to them.
Step 2: Remove duplicate files e.g. my old documents (backups all over the place), mp3s from i-tunes that have been inserted twice etc..
I tried Delete Duplicate Files and many other duplicate file removers. The most common problem with all those programs is that they couldn’t manage Unicode filenames. A pity, I would guess it’s in the 20% of the requirements that bring the 80% of the customers to handle Unicode correctly and I guess it shouldn’t be that difficult programmatically to implement. Anyway. The clear winner was the Duplicate File Detective which has attractive GUI, handles Unicode correctly and is impressively fast. Good job!
Step 3: Create an exact mirror of one folder to a folder in another external drive.
I tried "Acronis True Image" and it was too heavy and it’s main purpose was to make image files instead of mirroring folders which is what I wanted (I want if a disk crashes to use the other one out of the box, instead of having to restore etc.) Good piece of software but not what I wanted.
I tried MirrorFolder and FolderClone and they had the usual Unicode problems.
PowerFolder was a good one. Very nice program with amazing features a little bit like live mesh. Again overqualified and overpriced I believe but for some businesses it might be gold. I didn’t find it straightforward to backup on the same computer and in order to do what I wanted (Unlimited backup – no net space) I would have to pay more than $100. So no.
The winner was InSync, an amazing piece of software which does exactly what I want and it handles Unicode files correctly. Amazing piece of software and exactly what I needed.
I have to say that each one of this programs costs less than $50 which means that you can have a proper automated backup-mirror system with less than $150. That’s not bad at all (at least for me). Now I can sleep in peace knowing that even if my little Tera-Disk fails (which isn’t exactly science fiction with the amount of usage it suffers), my files will be ready to be used in the Half-A-Terra mirror backup disk.
What an adventure...
14 January 2010
Useful iTunes tricks
iTLU (iTunes Library Updater) rules! The iTLU (iTunes Library Updater) lets you remove orphaned files (songs that actually don't exist on the disk) automatically. If you combine it with a file duplication removal program like Delete Duplicate Files, Duplicate Cleaner or Duplicate File Cleaner you have a complete solution for automatically removing the annoying duplicate mp3's (true-duplicates no matter if they have the same name or not). It's so easy to get some if e.g. you import a directory and it has a playlist file inside. This software solves this problem! Good job!
By the way, if you want to move your library easily and safely, just in iTunes' Edit > Preferences, in the Advanced tab, check "Copy files to iTunes Music folder when adding to library" and "Keep iTunes Music folder organized." Then change the "iTunes Music folder location" and enter the folder of the new location of the library (iTunes will copy a few subfolders there so prefer H:\itunes to H:\). Finally go File > Library > Organize Library, Check "Consolidate library" and ok. Then all your mp3s etc. will be copied correctly to the destination folder. Finally if you want to free up some space go and delete the original folder. Here is an article that describes similar process with some additional background info.
12 January 2010
Interesting article on moving torrent files between different directories
Interesting article on moving torrent files between different directories. It indeed saves a lot of pain. And this binary editor looks cool!
22 December 2009
10 cm of happiness
Ok, today I just moved to Gliwice to start a new day and a new life... the usual stuff. This is the beginning of my adventurous 2-week "holidays"... which like all my holidays includes some... work! I must admit I was a bit unlucky because I arrived here and there was no internet!! After talking to some neighbours, we arranged to have some of their wi-fi. The connection was switching between Poor and Fair. I was googling and the simplest page was taking 3 minutes to download. Back to the internet stone-age (i.e. like one month ago in my home). I was again paralyzed because of low bandwidth.
These are the moments that you usually have some time to think... and what I realized is that the amount of problems computers give you makes it impossible to work without the google next to you giving you the workarounds. For me internet doesn't mean connection. It means support, documentation and problem-solving.
Then I moved my laptop just 10 cm to the left to clean up the table. The shadow of some insulator moved out of the way allowing microwave eye-contact between my laptop and the router... and here we are! Meta-problem solved, and I'm happy again!
18 December 2009
The future of work
Nice presentation, I really agree with everything they say. The future of work is Transparent, Flat, Competitive and on Demand! And it's great!
29 November 2009
Privacy with Word and other MS documents
As you might know, when you save with MS Word or other products, there is quite a few data saved there for you which can be used to identify you. Here are two important documents on how to remove them:
18 December 2008
I love volatility
£10 for 1 minute of betting that the FTSE 100 will go down in the next 5 minutes... and here it is... it goes down and one second before it reverses again... you change your mind... what a pity that you have to watch the index for ages till you get a few good deals like that. The previous two days have been quite smooth... but today it looks like there is something going on... I love volatility!
03 December 2008
Arbitrage opportunities
Even the most well regulated markets will present niches for market experts. Below you can see the same thing for two different prices in the same store (HMV, Cambridge, Lion Yard). In the ground floor it was “on sale” for £10 and on the first floor you could find it with its regular but reduced price for £8! Stavros found this out (he is not just lucky) but most people... would just buy for £10...
![]()
04 July 2008
DSP/control/web applications; the same domain!
I was working on a blog crawler recently, and I got an interesting feeling. I realized that software that has the web as input looks much more like DSP/control applications than traditional desktop applications. There are two easy to identify common points:
a) It never terminates
There are practically infinite number of pages on the web and this means that your application will run for ever. After a certain point you can say that the application has ‘terminated’ in the sense that you can do something with the data it extracted but still you will let your crawler run in order to collect even more data or update the old ones to improve the outputs of your application. It’s exactly the same as DSP/control applications that run for ever and produce useful output. They actually ‘terminate’ when their output is no longer useful or when you update to a better improved engine.
b) Errors are output
In desktop applications error is something that rarely happens. In web applications every second page has some idiom or useless data etc. so errors happen actually all the time and they are worth logging in as much detail as possible. Errors are output of the system that can be used to evaluate the application, track its quality improvement and be used in an ‘outer developer feedback loop’ to improve the application. This is exactly what happens in real time DSP/control applications in great contrast to desktop applications. In a sense DSP/control/web applications are white-listing all the inputs that they can successfully cope with and they error log the rest of them for further investigation.
It is interesting to realise how alike web and DSP/control applications are. It is interesting to think how many other ideas already established from the DSP/control domain could be applied in the web domain and vice-versa!
One more note:
It's incredible how much crap blogs are there, I bet that 50% of the blogs out there have less than 10 posts and also it’s unbelievable how popular are the blogs of people who just swear and nothing else. Just impressive! Search engines are doing quite good job if they can find useful things out of the blogosphere mess.
Synopsys SystemVerilog Verification Methodology Tutorial
So you run the tutorial and you reach lab 7 (the last one) and you want to get coverage results, you run make cov but your system tells you: Error : -dir: argument . is not a compile-time coverage . What do you do? You just edit the Makefile and change the:
directory or a coverage data directory.
cov:
urg -dir .
to:
cov:
urg -dir ./simv.vdb
Done.
19 January 2007
Test Smart
I've spent a few hours testing an almost trivial class. What I ended up with was a 600 line class of which more than the half was the test. But in fact it's even worse. The time I spent writing and debugging the test was more than 3 times more than writing the class itself. And, guess what! It didn't find any bug in the class. Nothing at all. Ok, I know... I get a better understanding of the problem and gain testing experience that will be useful in the future... but who cares? I could have written an excellent test for another, more interesting class and hopefully it would reveal some hidden aspects of the problem that I've overlooked.
The reason for this "failure" was yet another time that I didn't listen to my feelings. From the very beginning I trusted that class but unfortunately I started chasing a mouse I had no sign of.
The rule from now on is simple: Test Smart, listen to your intuition!
08 January 2007
ls - like List recursively with size and full path
Do you want to list all files on current directory and subdirectories?
Do you want to list them with full path?
Do you also want to have their sizes printed?
To make the long story short, this is *an* answer:
#!/bin/sh
ls -RlAQ | awk -v PATH=`pwd` '{ \
if ($1 ~ /.*:$/) \
path = substr($1,3,length($1)-4); \
else \
if ($0 ~ /^-/) \
printf("%s\t%s%s/%s\n", $5, PATH, path, \
substr($0, match($0,"\".*\"")+1, RLENGTH-2) \
) \
}'
[For improvements see comments]
16 December 2006
Funny tests!
02 November 2006
IQ tests
I can't understand why most IQ tests don't provide the right answers. It is important to see your mistakes in order to understand what they actually expect. For example the IQtest.dk doesn't provide the correct answers.
The right answers are:
D F B G A H B E H A
C F B D H E F C E D
G A B H B A H G E A
D E G G C F H F B
and the maximum IQ in their range is 145:
30 October 2006
No (fake) comments
I use b2evolution as blog and of course every day hundreds of spam-bots try to post fake comments advertising their stupid customers. For a long period I had the comments disabled but now I decided it's time for a better workaround. I show the image of a cat and I ask what animal is it. I think I'm safe until image recognition systems become dangerously intelligent.
How to do it to your b2evolution blog:
-
In file: htsrv/comment_post.php
After this line:param( 'author', 'string' );
Insert this:param( 'animal', 'string' );
Before this line:if( $error = validate_url( $url, $comments_allowed_uri_scheme ) )
Insert this:
if( strtolower($animal)!=="cat" ) {
errors_add( T_('Wrong confirmation answer!') );
} -
In file: skins/_feedback.php
After this line:<input type="checkbox" class="checkbox" name="comment_cookies" ...
Insert this:
</div></fieldset>
<?php form_text( 'animal', $animal, 40, 'What animal is
this?', 'Confirmation question.', 100, 'bComment'); ?>
<fieldset> <div class="label"></div>
<div class="input"> <img src="<?php
imgbase() ?>cat.jpg" width="105"
height="97" alt="cat" /></div>
<span class="notes"> </span> <div> - Finally put a cat image (cat.jpg) in the img directory.
Obviously you can customize it to show anything from foods to cars and it's very effective because it's custom! If it was in an official b2evo release it would have been already exploited by some bot.
29 October 2006
Java Speaklet
Over the years, JAVA-ers have developed their own dialect that makes them easily identifiable. For example a java developer gets back home and says: "JHI JHoney I'm JHome"!
Every sentence they form must contain as many J's as possible and that's not difficult since almost all their terms start with J. e.g.
J2EE, J2ME, J2SE, JAAS, JAI, JAIN, JAR, JAXB, JAXM, JAXP, JAXR, JAX-RPC, JAX-WS, JBI, JCA, JCE, JCP, JDBC, JDJ, JDL, JDO, JDOM, JFC, JHI, JIUL, JMF, JMI, JMS, JMX, JNDI, JPDA, JRL, JSR, JSSE, JTA, JXTA
This sometimes causes problems like:
- I think we should use JAXB
- You mean JAXP or JAXM?
- Are you kidding?.. It's clear from the context that I mean JAXR.
They also have ninJa-like cheers like: Jato, jakarta, jetty, jaminid, Jini, Jena, jo!
And of course they create cute tiny little things like: applets, midlets, servlets, pagelets, portlets, mobilets, scriptlets, coinlets, weblets, pdalets, streamlets...
What a great world to live in!
19 October 2006
Perl kick start

There has been a lot of time since last post. This is an indication that a lot of things have happened!
Anyway, these are some links to get you started with this wonderful language; Perl.
An overview of some basic features: Perl Tutorial: Start
Develop www applications within minutes: libwww-perl cookbook
Your favorite data structures perlified: Data Structures
30 January 2006
Andy and john will shut you down!
Hey it is Andy and john the directors of MSN, sorry for the interruption but msn is closing down. this is because too many inconsiderate people are taking up all the name (eg making up lots of different accounts for just one person), we only have 578 names left. If you would like to close your account, DO NOT SEND THIS MESSAGE ON. If you would like to keep your account, then SEND THIS MESSAGE TO EVERYONE ON YOUR CONTACT LIST. This is no joke, we will be shutting down the servers. Send it on, thanks. WHO EVER DOES NOT SEND THIS MESSEAGE, YOUR ACCOUNT WILL BE CLOSED AND YOU WILL COST £10.00 A MONTH TO USE. SEND THIS TO EVERYONE ON YOUR CONTACT LIST. NOW YOU KNOW WHAT TO DO. PLEASE DO NOT FORWARD THIS or REPLAY. COPY THE WHOLE EMAIL. GO BACK TO YOUR INBOX AND CLICK ON NEW. AND PASTE THANK YOU FOR YOUR ATTENTION
When I first saw this spam message, I expected it would fade within hours and I would never see it again. It's completely crappy! Amazingly enough it didn't fade but now, a week later I recieve it at least two times/day!
It seems that most people don't really know who owns MSN or even worst they are unsure about how big company Microsoft is. Anyway, I think that the reason for the widespread of this spam is that the way it talks fits exactly what most people think technical people talk like. If the spam claimed to be by Mr. G. W. Smith, the CEO of MSN nobody would forward it. "Andy and john" the two lonely computer freaks that "direct" MSN could publicly send a syntacticaly incorrect draft e-mail, could ommit proper capitalization, could use imperative form, could shut down your account without mercy but feeling wicked happy for doing what has to be done, could ask money for providing services that previously were free and could give so many useless details that someone had to follow step by step in order to save his computer!
I'm sure that the above description fits exactly the idea that most people have about technical people.
21 December 2005
Linux quick answers
How to format DOS FAT filesystems
fdisk (to create partitions)
mkdosfs -c /dev/sdb1
[Linux filesystems]
Basic SAMBA setup
Suggested reading: Using Samba, Second Edition by O'Reilly
If you would like your remote host to like this:

you only have to write these at your smb.conf file.
[global]
workgroup = mshome
server string = Linux
netbios name = Box
To make SAMBA work, don't forget to add users... smbadduser -a root:root
Automake, Autoconf
Using Automake and Autoconf with C++
Autobook
Install TouchKit Touch Screen
Touchkit driver installation requires:
- sharutils
- make
- tcl
- tk
Additionally for support for USB:
- XFree86-devel(xdevel)
- gcc
- glibc-devel
- kernel-source
Resources:
Drivers for almost any Linux distribution
Installation and user manuals
Apache: "Warning: Failed opening..."
Remember, Apache doesn't run as root or any other user. So be carefull to set the permitions of files in htdocs in such a way that apache can read them. Otherwise you may encounter errors like this:
Warning: Failed opening '/srv/www/htdocs/example.php' for inclusion (include_path='.:/usr/share/php') in Unknown on line 0
RAM size
Find out how much RAM a system has: cat /proc/meminfo (cat /proc/meminfo | grep MemTotal)
Operating system version
Find out which operating system are you using: uname -a
Turn off monitor
Turning Screensavers and Monitor Power saving on/off
Google search
> 1) setterm -blank 0
> 2) setterm -powersave off
> 3) disable BIOS power management
> 4) disable APM support in kernel
Retrieve the size of a folder
simple: ls -sh
recursive: du -sh
Many opperations in a single shell command
mount /mnt/cdrom; cp -R /mnt/cdrom/* /backups/; eject
Subsequent commands executed only if previous don't fail: /bin/false && echo Hello world
Conditional execution i.e. && and ||
Bash tutorials
http://www.justlinux.com/nhf/Programming/Bash_Programming_Cheat_Sheet.html
Redirecting:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html
Remote Desktop
Remove beep from exceed's terminal: int .cshrc append "xset -b" [Hummingbird]
Setting up SuSE for remote desktop applications XDMCP:
You have to set DISPLAYMANAGER_REMOTE_ACCESS="yes" and DISPLAYMANAGER_ROOT_LOGIN_REMOTE="yes" in /etc/sysconfig/displaymanager
[1 2]
Wireless SuSE
http://portal.suse.com/sdb/en/2002/11/wavelan.html
http://www.novell.com/products/linuxpackages/professional/wireless-tools.html
http://vowe.net/archives/004538.html
Do you want on-line installation of RPMs? (e.g. your linux box doesn't have anything but an ethernet cable)
Use the following as source media (ftp)
server: ftp.suse.com or ftp.gwdg.de
folder: pub/suse/i386/9.2/
Any valid mirror will include the "content" and "directory.yast" files on the root directory.
Everything you need to make linux libraries
Advanced finds
Find a file with certain properties and text inside...
find ./ -type f -maxdepth 1 \( -name '*.cpp' -o -name '*.h' \) -exec grep 'FileTemplate.h' {} \; -print
http://www.athabascau.ca/html/depts/compserv/webunit/HOWTO/find.htm
http://www-128.ibm.com/developerworks/aix/library/au-unix-find.html
04 December 2005
Movies I've seen
Une liaison pornographique (1999) [Really clever script - it happens all the time]
In the Mood for Love - Fa yeung nin wa (2000) [Excelent Chinese drama]
The Cell (2000) [Shhhh-Booo thriller with average ending]
Experiment, Das (2001) [Excellent and before its time]
Shrek (2001) [Nice comedy, expressive animation]
Original Sin (2001) [Incredible picture and nice plot]
S1m0ne (2002) [Nice end, interesting sci-fi]
The Bourne Identity (2002) [Nice adventure]
Code 46 (2003) [Strange sci-Fi]
Calendar Girls (2003) [Cute]
The Cat in the Hat (2003) [Nice comedy and picture]
Good Bye Lenin! (2003) [Interesting]
Dogville (2003) [Incredible!]
Paycheck (2003) [Very good pure Sci-Fi; nice action flow and some new ideas well presented]
The Edukators - Fetten Jahre sind vorbei, Die (2004) [Amazing script-excellent ending]
Diarios de motocicleta (2004) [Nice picture]
2046 (2004) [Remake of "In the Mood for Love" a little bit boring]
Saw (2004) [Amazing thriller, very clever script]
Collateral (2004) [Clever thriller, very well shoted scenes]
After the Sunset (2004) [Very light Ocean's Twelve clone]
The Village (2004) [Nice but should be better balanced on time and have better ending]
Mr And Mrs Smith (2005) [Nice comedy]
Sin City (2005) [Strange thriller]
The Island (2005) [If it had half the budget it would be 10 times better]
Charlie and the Chocolate Factory (2005) [For -not so happy- kids]
Madagascar (2005) [Nice animation comedy]
Harry Potter and the Goblet of Fire (2005) [I was expecting more]
Sahara (2005) [Amazing picture, a little bit of everything]
A Lot Like Love (2005) [Cute]
28 November 2005
Points equally distributed on a sphere
I wanted to draw a sphere using OpenGL and in order to do so, I needed a set of points. The easiest way of creating points on a sphere is of course to take some fixed angles phi and theta and start sampling over them... Boring! The major drawback of this technique is that the level of detai varies over the surface of the sphere. Near the north and the south pole we have maximum detail while near the ecuador we have minimum detail.
The greatest solution would be to "sample" points equally distributed over the surface of the sphere which means that each point must have exactly the same distance from each one of its adjacent points.
In fact the most relative site I've found on the web is this one.
A non efficient implementation includes the creation of random point cloud and then the movement of points in order to achieve equal distances.
26 September 2005
C# Windows Networking Library
This is a wraper class for some of the Windows Networking Functions in C#. It warps WNetUseConnection and WNetCancelConnection2 with which you can mount samba drives under Windows. It uses Pinvoke and defines flag and error constants. It's not something amazing but I needed it and there was nothing similar on the web. If you need it too here it is!
24 August 2005
Quick Hibernate
Windows' hibernation is a really cool facility that saves a lot of time and effort. For some unknown reason, it has been placed in a way that isn't ergonomic. One can access it "easily" with the keyboard (Ctrl+Esc, Up, Enter, h) but there is no easy way to reach it if you want to use only mouse. "Is there any PC without a keyboard?" you may reasonable ask. The answer is yes and at least from my experience I can tell two cases:
a) You have a PC with a touch screen and you don't have a keyboard at all.
b) You have a laptop with external screen and external keyboard. Laptop's keyboard is covered by the bended screen and the external keyboard lies on the floor. You are too lazy to bend and lift the keyboard over the floor in conjunction with the fact that it's too late (early) and you want to make as little noise as possible.
So, it would be desirable to have a way to hibernate such a system with a single click. This is Quick hibernate. A small (5k) utility that you click and immediately hibernates your system. No dialogs, no questions, no warnings. Just single-click hibernation! ![]()
The first version used the WindowsController class from mentalis.org. It should be mentioned that they provide a lot of useful open source classes. By using that class, the application was as complex as this single line: WindowsController.ExitWindows(RestartOptions.Hibernate, false);. The problem is that a C# program requires the .NET framework. If you don't have it, it would be a complete waste of time to install it just and only for running this application.
In order to overcome this problem and additionally, because I liked to use a free development environment, I rewrote it in x86 assembly ![]()
! File's size reduced, execution speed increased (a lot) but most importantly there is no need for any additional software to run this program anymore. I used MASM32 to build this mini-app and everything you need to compile and possibly extend the program yourself can be found in this zip file.
I hope anyone who downloads and uses this utility, to enjoy quick and easy hibernation!
21 August 2005
Samba 3, SuSE 9.2 console and Greek
When you bootstrap a SuSE 9.2 system internationalization works fine and you can use Samba and other features without any concern about code pages and character sets. This is because these new verions of SuSE and Samba, are using Unicode under the scenes to make everything truly multilingual.
But what happens if you have some disk volumes that have been used with older Samba-SuSE versions?
Because previous Samba versions did not do any charset conversion, characters in filenames are usually not correct in the UNIX charset but only for the local charset used by the DOS/Windows clients.
The solution is to use the convmv utility that you can download from here. Its documentation can be found here.
For example if the some mp3's names were based on the greek (iso-8859-7) charset you should write:
convmv -f iso-8859-7 -t utf-8 --notest *.mp3
This will convert their filenames to the utf-8 format and they will appear correctly with Samba 3 and so on. If you feel like converting them back to iso-8859-7 from utf-8 you can simply write:
convmv -f utf-8 -t iso-8859-7 --notest *.mp3
The above solution works fine as long as you DON'T want to use the same disk volume with other OSs at the same time (e.g. older versions of SuSE). If for any reason you don't want to convert the filenames on the filesystem there must be a way to make Samba 3 work like its older counterparts.
Unfortunatelly adding:
character set = ISO8859-7
client code page = 737
under the [global] section in /etc/samba/smb.conf won't work anymore as both attributes have become obsolete. The new attributes that make this piece of magic are:
display charset = ISO8859-7
unix charset = ISO8859-7
dos charset = CP737
and should be placed at the same place ([global] section in /etc/samba/smb.conf).
This way you will be able to see filenames with codepage based format under Samba 3.
Note: If the filesystem doesn't natively support utf-8 you may have to convert the whole filesystem. Try this.
Another problem that you are likely to encounter is that these filenames won't appear correctly in the console. One possible solution is to go to yast2 - System - /etc/sysconfig editor - System - Enviroment - Language and change the RC_LANG paramter to "el_GR.ISO-8859-7". You may also have to change the ROOT_USES_LANG from "ctype" to "yes" in order the language change to affect the root user as well. (You can perform the same changes by editing the /etc/sysconfig/language).
A less global approach will be to enter these on the console you want to use with Greek:
export LC_ALL=el_GR.ISO-8859-7
setfont iso07u-16 -m trivial
echo -en "\033(K"
In practice the first line is enough to solve the problem. Perhaps you would like an even more complete-complex script like the one which can be found here. Some additional information can be found here.
Note: Changing LC_ALL will result in a global change of the language (e.g. yast2's text will be in Greek). This is really cool but in case you don't like it (e.g. you have been used to English), you can change LC_CTYPE instead of LC_ALL:
export LC_CTYPE="el_GR.ISO-8859-7"
Note 2: If you don't want to write these variables each time you start a console, you could add them to a .profile file in your user acount. (e.g. /root/.profile for root user).
I'm sure that using the information presented above, you will be able to solve most of the problems regarding Greek and other language's support on SuSE and new versions of Samba.
19 August 2005
.NET optimization paradox reveals coding patterns for next generation computing
Which one is faster? This:
Point prevp = affine.transform(points[0]);
for (int i = 1; i < points.Length; i++) {
thisp = affine.transform(points[i]);
g.DrawLine(pen, thisp.X, thisp.Y, prevp.X, prevp.Y);
prevp = thisp;
}
or this?
Line[] lines = new Line[points.Length-1];
Point prevp = affine.transform(points[0]);
for (int i = 1; i < points.Length; i++) {
thisp = affine.transform(points[i]);
lines[i-1] = new Line(prevp, thisp);
prevp = thisp;
}
foreach (Line l in lines) {
g.DrawLine(pen, l.start.X, l.start.Y, l.end.X, l.end.Y);
}
Note: Affine.transform in both cases is something like this:
public Point transform(Point p) {
return new Point(
((mcos * p.X + msin * p.Y) * m_scale) + m_offset.X,
((-msin * p.X + mcos * p.Y) * m_scale) + m_offset.Y );
}
As the more suspicious of you have guessed, the second one is faster. More surprisingly, it's not slightly faster but it runs 33-40% faster than the first version. I can't explain the difference nor how it occurred to me to implement the second version and compare them. A first order analysis shows that the first approach is much more efficient than the second one.
I believe that .Net or the hardware itself (Intel's PXA255 processor on Mio 168 PDA), has some optimized version of the second for loop for drawing directly from arrays of points on memory. But this still doesn't explain such a performance gain.
The only satisfactory explanation is that the first version is too complex to be effectively optimized by the compiler - hardware.
a) The compiler may not dare to inline the transform function in the first case. Transform function consists of some mathematical (MAC) operations that can be performed quickly and in conjunction with array-pointer operations by using the hardware addressing modes of the processor. By adding the DrawLine invocation you prevent the inlining of Tranform and this adds the overhead of function call that is comparable with the execution time of the function.
b) Less efficient use of processor's MAC pipeline. By inserting the DrawLine function between subsequent MAC operations the MAC pipeline that can process up to two MAC operations simultaneously gets broken and this reduces overall performance.
A software engineer has to refer to the Optimization Guide of Intel XScale© Core in order to find more ways to create efficient code.
Even thought this paradox may seem to be extremely hardware specific it's not. All modern processor architectures share common attributes like caching, pipelining, advanced addressing modes, branch prediction and independent MAC modules (often more than one). Even though it's thought that these things concern only the compiler and some crazy assembly optimizers working on Microsoft's libraries, this is not true. Modern computer architectures and the upcoming parallel computing revolution introduce some new coding patterns that have to be learnt by everyone who wishes to write efficient code, no matter how high-level the programming language he uses is.
The trend to implement commonly used software constructs like "for loops in conjunction with array operations and simple mathematics" in the hardware in order to increase performance changes primary forces while coding.
Writing long functions that "do the job" with multi-level for loops, if nesting and infinite number of function calls has been the preferred way of coding of the last century. Compilers tended to support this style by giving their best efforts to optimize them by inlining, loop unrolling and other tricks. So, "Take a piece of data and do as many as possible with it". This is the coding style of the first example.
Programming seems to move to another perspective nowadays. By using extremely fast software primitives and pipelining in the software layer, the efficiency is dramatically improved. So, "Take the data as a whole, do something simple with it and put it back. Then take the result and do something else". This is the coding style of the second example. (It seems that Matlab guys win the bet). Reconfigurable computing will also give an extreme boost in this kind of programming because it's the only way to utilize the extreme reconfigurable processing power.
In conclusion, expect to see LISP-PROLOG-SQL-(concurrent)VHDL - like code segments inside your procedures in the near future and be prepared for a huge change on your way of thinking.
25 July 2005
The AVR Gas Meter
Today Gas has become very expensive. This makes anyone wonder more than ever, how much does an everyday trip cost? Ordinary gas indicators on the front panel, give some information which is limited to a rough value on arbitrary units. This is not enough for me, so I started the project of a Gas Measure instrument that can be easily calibrated and give a direct indication of the total amount of Euros that lie inside your reservoir.

Its use is very simple. It gets the (analog) signal that drives the analog panel instrument and converts it to a digital indication. So far it looks like an ordinary voltmeter. In fact it is quite different; Before you go to the gas station you press the reset button. The instrument resets its value to zero Euros at that moment. After the gas station you press the button that corresponds to the money you paid (10 - 20 - 30€). After this, the instrument is calibrated and shows the amount of money you have at any given time. By calculating the difference between the moment you left from a place and when you arrived in another you can find out how much the trip costs. (Indication is more accurate if you measure while the engine is in the same conditions of heat e.g. cold - before you turn it on and the roads have equivalent slopes e.g. you park in the same place).
As one can easily imagine, this project has nothing interesting from an engineering perspective. It's implemented with an AVR processor: ATMega8. Perhaps it seems an overkill to use such a powerful uC to achieve such an easy task. We selected this uC because of these reasons:
- A/D Converter: It's the smallest MegaAVR with ADC.
- IOs: That's why I haven't used a TinyAVR. I should then use a shift register to create the necessary I/Os. Using a TinyAVR wouldn't even give me a significant cost reduction (even on a large scale production)!
- Easy programming: That's why I didn't use a PIC uC. I can program AVRs a lot easier and in system by using At-Prog! It's as easy and faster than programming a PIC using bootloader. These high programming voltages of PICs are really annoying.
- Embedded USART: I wanted to log the values of the Gas during a trip using my PDA and the GPS tracking software I've made. So I wanted a UART and it's very nice to have it hardware instead of implementing it in software on a TinyAVR.
- Reduced Bill Of Materials: I didn't believed it in the beginning (- and i left some extra space on the PCB for a crystal) but this internal RC oscillator works out of the box and without the need of programming any fuses. You just plug it into the PCB and it runs at 1MHz - 1MIPS (and is stable enough). Bye bye expensive quartz crystals!
So, that's why I chose ATMega8. While this uC is wonderful the whole project still hadn't something interesting enough to become true. In order to make it more interesting, I've made some important decisions:
Hardware

-
Design PCBs by hand, on the fly, without even a complete schematic prior the design. Perhaps it's the last time in my life I design a PCB this way!

-
Put as many SMD devices as I could! So in this design you will find no through-hole resistors, transistors and diodes.

-
Use some cool green double 7-segment displays I've found in my closet.

- Break the design to two PCBs in order to be able to mount the whole circuit in a piece of V-shaped aluminium.

Software
- I used the avr-gcc compiler instead of Atmel's AVR studio. By using libc I could complete the software within less than an hour. - Boring!
- Of course the processing power of ATMega8, its internal hardware 2-cycle multiplier and avr-gcc make you think of using floating point and go home early. With a sampling rate of 2 Hz there would be no difference in the performance of the whole system. Of course I could try to lessen the power consumption of the system but who cares? It may be the weakest load of my car's power supply. I decided to use fixed point arithmetic in order to make things harder. NOTE THAT AVR-GCC'S INT is just 2 bytes long while LONG is 4 bytes long.
- After all these and in order to make the project even more interesting, I decided to use a Real Time Operating System!
More precisely 4k out of the 8k of AVR's FLASH was given to the FreeRTOS. Obviously there was no reason to use a RTOS for this little project. I just found a great opportunity to get over my OS-o-phobia, with a low risk and deadline free project. In fact I feel much more comfortable now and I would like to note:
- The transition from traditional programming to an RTOS is very easy. You just take your old single threaded application and make it a task. You have something up-and working within minutes. Then you have plenty of time to find out how RTOS's facilities could have made your life easier.
- One thing I used to fear about RTOS's (perhaps because of the non Real Time OSs I use) was that via this multitasking thing I would loose control over time. e.g. I wouldn't be able to make a function run at a specific interval because other tasks may be running at that moment. In fact this is completely wrong. For functions that must be invoked really frequently, there is still the solution of hardware timers, ISRs and everything other I used to use before. The advantage of using an RTOS is that you have very accurate control over functions that must be invoked less frequently. With software timers or blockAndWait facilities of RTOS's one can be sure that something will be exactly on time without strange hacks and custom timer prescaler implementations. This really saves a lot of development time and makes development process much easier and less error prone. Because many details are being handled transparently by the RTOS you may easily become a perfectionist and find yourself working on, for example, the user interface which in other cases would just be a luxury.
- The final great benefit of using an RTOS is that it gives you the confidence that with just a few modifications you can have the application running on any other platform the RTOS supports. This is really great because it gives you the flexibility to start developing on an expensive platform but releasing the product in a less expensive one. By being open source, FreeRTOS gives you the ability to remove unused features in order to fit it in a smaller uC.
You can download the complete source code, .hex and .eep files here.
25 June 2005
Beta or Beta testing?
I was thinking how stupid it is to make software available and let end - users find bugs on it. I recalled that this was named beta testing but in fact I didn’t knew the exact meaning of the word. This made me visit Wikipedia which stated that "the beta version of a product still awaits full debugging or full implementation of all its functionality, but satisfies a majority of the requirements". A note in this definition took me to this ZDNet article. My fears were verified. Actually beta testing was so stupid that in order to make it seem meaningful, they use it improperly.
Lets wonder, what does the "beta test" actually test? The software or the whole business model of the company - the whole idea? I think it's very clever to have this innocent single - word term in the title of your product that declines any responsibility till you make millions out of it.
This way...
- If customers complain they get limited support because, after all it's just a beta.
- If customers don't complain and you make money, you remove the beta and you are successful!
- If customers don't complain but you don't make as much money as you expected then this is a real problem, but in case of betas, you still have many choices like a) letting it be beta for ever (and by fixing marketing "bugs" try to make it really work) b) making it a final release in which you are going to invest the least money you can, c) trying to sell it or even better... d) making it open source! This way, your company will get fancy and advertise while at the same time blur the failure of the product. After all who is going to blame a thousand of developers spread around the world for the failure of a project?
As one can easily see, this "beta" cycle has nothing to do with software engineering and the key concept to understand the difference, is that in regular beta testing, the functionality should be fixed and only (software) bugs should be fixed.
If a product (e.g. an on line community) doesn't seem to make enough money to pay for the web servers needed to make the system fail less frequently, THIS DEFINITELY IS NOT A SOFTWARE BUG.
Why does Google let us look into their lab if they don't think their products are somehow ready? After all they do look ready enough to me, so why don't they release them? Maybe because if I zoom into Greece more than a specific level with Google Maps, it doesn't download any tiles. Is this a software bug or I just gave these tiles another "hit" which if exceeds a specific threshold, they may buy these extra orthophotos? There is a clean diverse between a software bug and a marketing plan. If these things are really betas, I don't thing their developers should care on the number of hits or users as long as they have a constant stream of bug reports. Even more, they should care to be easy for the user to report bugs and maybe some additional debug info. Do you thing this is the case?
The new meaning of "Beta" is "no responsibility".
So is it a problem, and if so, what can be done?
The first thing is to recognize that testing is a process that is completely lab related. There is no one more adequate to test the software than the ones who developed it. They know exactly what is the program being "afraid of", how to push it to the edges and where possible bugs may lie. I'm not an expert developer and yet I have that feeling that something is wrong when something is wrong even if the program seems to respond right. If a company would like to make a program more stable it just has to add another "free testing month". Developers of one team could test the functionality of another team. I can't understand why general users can push the product harder than developers. Are developers less demanding than ordinary users? Even more does it cost less to process the feedback from hundreds of irrelevant people than true engineers that know exactly what they are talking about? I don't think so. So beta testing should be beta testing and should be done from a small group of high-demanding and specialized users who could be developers and managers from within the company.
Now, about marketing "beta" tricks. I believe that users are now mature enough to understand that a piece of software (especially a web service) is constantly under development. There is nothing bad in this even more if you know it. The basic difference that makes Google and other modern companies use the "beta" trick is that they don't sell their services as products but they do money indirectly. As a result they hate numbers and versions although I'm sure they use plenty of them internally. It's no good to them to release version 5.0 that has additional features over 4.0 because nobody is going to upgrade! They use the "beta" trick to grant limited support, imply that some final version may be better and of course be able to market it more flexibly by testing many strategies since it's not a complete product yet.
I think that it's time to introduce a new term for these kind of software or services in order to clean things up. Of course, I am not responsible to do this but I'm sure that in the near future, software community will do it. It may just be the world "beta" that when referenced alone will mean this kind of software marketing and when referenced as "beta testing" will mean the testing phase. We will see.
24 June 2005
Programming Embedded Systems in C and C ++
When I bought this book, I paged through it and got angry. I saw near the end a "Hello world" example, and even worst, implemented with one of the most complex ways, including the use of an operating system. Ok, I thought, I know many better ways to make every embedded system say "Hello world", I put it in a shelf and tried to convince myself that it would pay itself as a good looking – nice titled O-Reilly book.
After about half a year, I wanted to read something light to relax... My eye fell on this book. Ok, I though, let's see how one can write a whole book about "hello world". I started reading the Memory chapter (one of the best written of this book) and got amazed! He described techniques of memory checking that I couldn't imagine myself before. It also described CRC checks for Flashes and EEPROMs. I decided to give this book another try
After reading the first five "introductory" chapters, I proceeded to the eighth chapter which used to talk about Operating Systems. This chapter was also very nice. Its intention was to make the reader get over his OS-o-phobia. I still thing that using an OS is the best way to #import a hundred bugs with a single line of code... But, Ok, he made me consider the use of an (expensive and extensively tested) OS more seriously for large projects and more importantly made me realize that I've already successfully used well designed embedded operating systems, not only in PCs (Linux) but also in the TINI environment. So it partially succeeded its purpose.
The next interesting chapter was the last one. It presents some optimization tricks. I have already used most of them but it's still nice to see them organized and presented in a single chapter that one can read when he is really stucked and needs inspiration.
This book is best suited for readers that know how to develop in C and C++ for Personal Computers and would like to move into embedded development. All the other categories will find many chapters trivial and maybe some chapters very difficult to understand (one must know C internals and what, in practice, do memory mapped peripherals mean to understand why "gProcessor.pPCB->timer[2].count = 0;" works specially when Processor and PCB structures are not presented in the whole book)!
The writer seems to be stressed not to present more code than is really needed. Perhaps sometimes he exaggerates a little and doesn’t present essential code but in most of cases he is just fair. This book could easily be turned to yet another 600 pages mammoth book if the writer presented every single line of code (or in appendix) and commented it in detail. I think it was a right decision to make this book as compact as it is.
As a conclusion, this book is a well organized book that summarizes many years of experience. When you read it you feel like you have a conversation with a experienced embedded systems engineer. That's what it is and I thing it deserves the money.
20 June 2005
Excel Tips
Excel is a powerful spreadsheet and data analysis tool. Because it's too easy when you start working with it, most people don't care keep learning it and end up using no more than a few of its basic features. Here are some nice MS Excel Tips. Among them the "Setting Non-scrolling Rows/Columns" technique that I've been searching for a long time! (Microsoft put the freeze command in wrong menu. I was expecting to find this functionality in View or Format menu).
Some other features that can be useful for an advanced user are the use of array functions (the ones that are being entered with Ctrl+Shift+Enter), web and database queries. I've also found very usefull the Frequency function although it isn't so widely known.
All these are nice tips and tricks that don't require VBA. If one needs even more functionality than Excel provides with its build-in dialogs, commands and functions, the book "Excel Hacks: 100 Industrial-Strength Tips and Tools" from Oreilly is an excellent starting point.
28 April 2005
My longest living Windows XP setup
My longest living Windows XP setup (6/9/2003 12:30PM - 28/4/2005 3:15AM) died today...
It was installed on my laptop and suffered many pains like Oracle 9i with spatial extensions, Apache-php-mySQL, MS SQL server, CorelDRAW, Visual Studio .NET and even worst, Borland JBuilder, Oracle's JDeveloper, TogetherSoft's Together, viruses, service packs, buggy drivers and many more! How much worse could it get?
Despite all these, Windows XP remained stable and with reasonable performance for more than 19 months! Congratulations to the software leader Microsoft for delivering such an excellent product!
27 April 2005
Debug port of TINI
Another useful feature of Dallas' JAVA powered TINI is its debug port. In a JAVA program you can use static methods dump and hexDump of com.dalsemi.system.Debug class to write to this port. You will find this port more useful when you write native libraries (.a51 assembly files) because you have no terminal to write there! The functions that you can invoke via assembly are: Info_SendString, Info_SendTwoHex, Info_SendCRLF, Info_Send1152, Debug_DumpDataPointer(1,2), Debug_DumpBA, Debug_DumpCurrentRegisterBank(,0,1,2,3). Imagine how precious insight can these functions give you when you debug native libraries.
Setting up the debug port isn't as easy as one would expect! When you send some data to the debug port, none of the two serial connectors will provide any useful signal. Debug port singals are available on connector J6. You can see where it is in the picture below.

Read the Application Note 614 "Diagnostic Port for the TINIs400" to find out how to create a serial connector for the debug port. If you don't read it carefully (like myself) you won't notice a short but important sentence: "As a final step, load tini_debug_400.tbin instead of tini_400.tbin". You should load the debug version of the TINI400 Runtime in order to activate debug functions (you will note TINI stick's LED blinking, because it shares the same pin with debug port). Then you can open a HyperTerminal at 115200, 8-N-1 and receive the precious debug data!
:: Next Page >>





