<!-- Search Pubget -->
<center>
<form action="http://pubget.com/search" method="GET">
<input value="UTF-8" name="ie" type="hidden">
<input value="UTF-8" name="oe" type="hidden">
<table bgcolor="#FFFFFF"><tr><td>
<a href="http://pubget.com/">
<img alt="Pubget" src="http://assets0.pubget.com/images/powered_by_pubget.gif"
border="0" align="absmiddle"/ /></a>
<input maxlength="255" value="" name="q" size="25" type="text">
<input value="Pubget Search" name="btnG" type="submit">
</td></tr></table>
</form>
</center>
<!-- Search Pubget -->
Sunday, August 23, 2009
Added search Pubget directly from my blog
If you want to try a search on Pubget, you can right from here now. Also, if you want to add the code to your blog or libguide, please feel free!
Wednesday, July 22, 2009
New Wet Lab Wiki up at MIT
There is a new science focused wiki available here:
OpenWetWare
It is a place for Wet Lab researchers to host and share information. It also provides some easy linking methods to Papers through Pubget.
OpenWetWare
It is a place for Wet Lab researchers to host and share information. It also provides some easy linking methods to Papers through Pubget.
Friday, July 10, 2009
I like coffee
Caffeine Reverses Cognitive Impairment and Decreases Brain Amyloid-beta Levels in Aged Alzheimer's Disease Mice. From a new paper published: J Alzheimers Dis 17(3):661-80 (2009)
...We have recently shown that Alzheimer's disease (AD) transgenic mice given a moderate level of caffeine intake (the human equivalent of 5 cups of coffee per day) are protected from development of otherwise certain cognitive impairment and have decreased hippocampal amyloid-beta (Abeta) levels due to suppression of both beta-secretase (BACE1) and presenilin 1 (PS1)/gamma-secretase expression.
...We have recently shown that Alzheimer's disease (AD) transgenic mice given a moderate level of caffeine intake (the human equivalent of 5 cups of coffee per day) are protected from development of otherwise certain cognitive impairment and have decreased hippocampal amyloid-beta (Abeta) levels due to suppression of both beta-secretase (BACE1) and presenilin 1 (PS1)/gamma-secretase expression.
Thursday, July 02, 2009
Setup of MySql on OSX for Rails
You would think this would be as easy as "sudo gem install mysql" but it is not. After installing the MySql community server, you need to install via this command:
After that, you will be in business.
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
After that, you will be in business.
Tuesday, April 28, 2009
Real Companies Have Espresso Machines
Pubget just installed its first espresso machines. Matt, Chris, Ryan, Ramy and I will now have an endless supply of high quality espresso to keep us going.
Tuesday, April 07, 2009
Pubget is a Featured Resource at UCSF
Pubget is now a "Featured Resource" on the UCSF Library Page.
Thanks to all that have sat in on the meetings and worked with us at UCSF.
Thanks to all that have sat in on the meetings and worked with us at UCSF.
Sunday, March 22, 2009
The only way to search domains
I have been using Bust A Name to search domains for a while.
It allows you to play with meaningful words to your business to try and put them into a .com or other domain.
It allows you to play with meaningful words to your business to try and put them into a .com or other domain.
Tuesday, March 03, 2009
Download all papers from Firefox within Pubget
We have just put up a new Firefox extension to allow downloading all PDFs for offline use.
http://pubget.com/pubget.xpi
To use this you need:
1. Pubget account (which is free);
2. Firefox (we have tested both OSX and Windows); and optionally
3. University or Hospital Library Access support by Pubget to get access to Journals.
http://pubget.com/pubget.xpi
To use this you need:
1. Pubget account (which is free);
2. Firefox (we have tested both OSX and Windows); and optionally
3. University or Hospital Library Access support by Pubget to get access to Journals.
Pubget via Google Reader
This is a quick way to subscribe to a number of journals and keep updated on all the latest research in your area.
Not only are you kept up to date, but also connected directly to the full text paper through your university library.
Not only are you kept up to date, but also connected directly to the full text paper through your university library.
Tuesday, February 17, 2009
Double the Difference minus labor cost
We just booked a hotel in Miami through Hotwire for $209 per night.

However, once we found out who the booking was through, we decided to double check the price. As it turned out, booking directly through the hotel, was cheaper:


So, after researching their "double the difference" guarantee, we filled out their form to a link with the booking.
The next day, we got an email back rejecting the claim because it was an employee price.

Am I too cynical, do I think Hotwire is just trying fob us off hoping we will give up and not bother with the claim? After a quick google search for "hotwire double rate guarantee", the 4th link seems to indicate this is not the case:
Hotel "Best rate guarantee" programs, My experiences..... (2nd comment)
Time will tell - is this going to be another small claims experience?

However, once we found out who the booking was through, we decided to double check the price. As it turned out, booking directly through the hotel, was cheaper:


So, after researching their "double the difference" guarantee, we filled out their form to a link with the booking.
The next day, we got an email back rejecting the claim because it was an employee price.

Am I too cynical, do I think Hotwire is just trying fob us off hoping we will give up and not bother with the claim? After a quick google search for "hotwire double rate guarantee", the 4th link seems to indicate this is not the case:
Hotel "Best rate guarantee" programs, My experiences..... (2nd comment)
Time will tell - is this going to be another small claims experience?
Monday, February 16, 2009
Added The New Friend Connect Bar
I just added the friend connect bar down the bottom of my blog! Enjoy all the social network goodness that it displays!
Tuesday, February 03, 2009
Pubget made the MIT library cool list
Courtney Crummett has recently added Pubget to the MIT library libguide's cool tool section.
The libguides are a way that MIT librarians can provide resource links and tips to help students and faculty get the most out of the MIT library.
As mit.pubget.com links directly into the MIT Library holdings, it can help users get right to the PDF full text from a PubMed/Medline search.
See:
http://libguides.mit.edu/medicine
http://libguides.mit.edu/biology
http://libguides.mit.edu/bioinfo
The libguides are a way that MIT librarians can provide resource links and tips to help students and faculty get the most out of the MIT library.
As mit.pubget.com links directly into the MIT Library holdings, it can help users get right to the PDF full text from a PubMed/Medline search.
See:
http://libguides.mit.edu/medicine
http://libguides.mit.edu/biology
http://libguides.mit.edu/bioinfo
Harvard Catalist Profiles
I just found a new project at Harvard based on the Catalyst CTSA grant. It is a social network for researchers.
If you look at Dr. Ramy Arnaout's Profile, you can see the similar people as well as a place for him to maintain his publications.
In IBM we had a similar system called Blue Pages and this looks very similar for the research space instead of the enterprise.
If you look at Dr. Ramy Arnaout's Profile, you can see the similar people as well as a place for him to maintain his publications.
In IBM we had a similar system called Blue Pages and this looks very similar for the research space instead of the enterprise.
Labels:
harvard,
profiles,
research,
science,
social networking
Monday, February 02, 2009
Not to die thanks!
An American was knocked unconscious in a serious accident while traveling in Australia. The ambulance took him to a local hospital for treatment.
While he finally woke up he asked the nurse, "Was I brought here to die?"
"No," said the nurse. "You were brought in here yesterday."
While he finally woke up he asked the nurse, "Was I brought here to die?"
"No," said the nurse. "You were brought in here yesterday."
Monday, January 19, 2009
Human genomes as email attachments
A new paper by Scott Christley, Yiming Lu, Chen Li and Xiaohui Xie is available and talks about additional compression abilities available at the genome level.
They identified 4 ways to reduce the size:
1. Only use the number of bits needed;
2. Store relative instead of absolute positions;
3. Generalize variations and store the variations; and
4. Store non-random repeats as such.
If I get some time, I would really love to try out the code they provide in the article.
Human genomes as email attachments
They identified 4 ways to reduce the size:
1. Only use the number of bits needed;
2. Store relative instead of absolute positions;
3. Generalize variations and store the variations; and
4. Store non-random repeats as such.
If I get some time, I would really love to try out the code they provide in the article.
Human genomes as email attachments
Friday, December 19, 2008
Pubget: Vreeman RC. Festive medical myths. BMJ 337:a2769 (2008)
Many holiday hazards are as just myths. A review in the current issue of the BMJ cites some of your fears that can scientifically be crossed off any holiday worry list.
Pubget: Vreeman RC. Festive medical myths. BMJ 337:a2769 (2008)
Pubget: Vreeman RC. Festive medical myths. BMJ 337:a2769 (2008)
Thursday, December 18, 2008
Bill Gates makes $1000/minute ... really?
I just came across a really dodgy get rich quick ad from google.

However, according to Forbes, he has been one of America's biggest billionaire losers where he actually just lost $12.3 billion in the last 11 months.
So, if there where 335 days between January and December 2008, and there are 86400 seconds in every day, this means he actually lost $422/second or just over $25k/minute.
Compared to that, I am actually doing just fine - no need to get rich quick if that is the benchmark :)

However, according to Forbes, he has been one of America's biggest billionaire losers where he actually just lost $12.3 billion in the last 11 months.
So, if there where 335 days between January and December 2008, and there are 86400 seconds in every day, this means he actually lost $422/second or just over $25k/minute.
Compared to that, I am actually doing just fine - no need to get rich quick if that is the benchmark :)
Thursday, December 11, 2008
Yet another reason to exercise
From this paper:
Exercise-induced suppression of acylated ghrelin in humans
it shows that exercise actually suppresses your appetite.
"In conclusion, this study demonstrates that plasma acylated ghrelin concentration is reduced during an acute bout of tread- mill running, and this lends support for the role of acylated ghrelin in appetite suppression during and immediately after exercise."
Exercise-induced suppression of acylated ghrelin in humans
it shows that exercise actually suppresses your appetite.
"In conclusion, this study demonstrates that plasma acylated ghrelin concentration is reduced during an acute bout of tread- mill running, and this lends support for the role of acylated ghrelin in appetite suppression during and immediately after exercise."
Wednesday, December 10, 2008
When it comes to vaccines - why take more?
It seems that only half does flu shots are need according to this study published in Archives of Internal Medicine.
Half- vs Full-Dose Trivalent Inactivated Influenza Vaccine (2004-2005): Age, Dose, and Sex Effects on Immune Responses. Arch Intern Med 168:2405 (2008)
Conclusions: Antibody responses to intramuscular half- dose TIV in healthy, previously immunized adults were not substantially inferior to the full-dose vaccine, particularly for ages 18 to 49 years.
Half- vs Full-Dose Trivalent Inactivated Influenza Vaccine (2004-2005): Age, Dose, and Sex Effects on Immune Responses. Arch Intern Med 168:2405 (2008)
Conclusions: Antibody responses to intramuscular half- dose TIV in healthy, previously immunized adults were not substantially inferior to the full-dose vaccine, particularly for ages 18 to 49 years.
Monday, December 08, 2008
Live close to your friends and hope they are happy
It seems such common sense, but so does a lot of things once they are studied. Here is a really interesting paper on the dynamics of how happiness spreads through your social connections.
To me, the summary seems to be to live close to your friends and family and make them happy. If you do, you increase your chances of happiness also.
Dynamic spread of happiness in a large social network
This also follows on from other work that shows the spread of obesity, smoking, and other health effects.
To me, the summary seems to be to live close to your friends and family and make them happy. If you do, you increase your chances of happiness also.
Dynamic spread of happiness in a large social network
This also follows on from other work that shows the spread of obesity, smoking, and other health effects.
Thursday, December 04, 2008
Pubget now on Solr
The latest version of Pubget has been rolled out and it is now based on its own search index. It has over 18 million medical and scientific papers index with over 6 million PDF paths ready for use.
The index is now Solr based and thus uses a new lucene based query syntax. To search only open access articles, you can use the query string access:open or alternatively you can limit your results by institution (e.g. access:ucsf, access:harvard, access:mit, etc).
I have been really impressed with Solr and its new 1.3 distributed sharding feature. It has allowed the use of low cost machines, amazon ec2, and s3 services.
The index is now Solr based and thus uses a new lucene based query syntax. To search only open access articles, you can use the query string access:open or alternatively you can limit your results by institution (e.g. access:ucsf, access:harvard, access:mit, etc).
I have been really impressed with Solr and its new 1.3 distributed sharding feature. It has allowed the use of low cost machines, amazon ec2, and s3 services.
Thursday, November 06, 2008
Send a card to President Obama
Monday, November 03, 2008
Mysql and Ruby on Rails with OSX Leopard
To get mysql working on leopard. Run:
then
It is a hack, but got it to compile for me.
sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
--with-mysql-include=/usr/local/mysql/include
then
cd /usr/local/mysql/lib
sudo mkdir mysql
sudo cp libmysqlclient.15.dylib mysql/libmysqlclient.15.dylib
It is a hack, but got it to compile for me.
Tuesday, July 22, 2008
Fishing on the weekend - loads of fun
Sunday, July 20, 2008
Amazon S3 down again
Here is the thread on their forum:
http://developer.amazonwebservices.com/connect/thread.jspa?threadID=23285&start=0&tstart=0
It is making some of my sites look bad as I chose to put all the css and images on S3 so they would be severed up in a distributed fast manner. However, that speed is not being appreciated right now as it is not working.
My task this week will be to design a backup plan or move the css and images.
UPDATE: I have a backup plan now - which is nice. Amazon is also back up after 7 hours of downtime so I have turned off the backup service. One positive thing is that I now have a backup plan that can be turned in within minutes.
http://developer.amazonwebservices.com/connect/thread.jspa?threadID=23285&start=0&tstart=0
It is making some of my sites look bad as I chose to put all the css and images on S3 so they would be severed up in a distributed fast manner. However, that speed is not being appreciated right now as it is not working.
My task this week will be to design a backup plan or move the css and images.
UPDATE: I have a backup plan now - which is nice. Amazon is also back up after 7 hours of downtime so I have turned off the backup service. One positive thing is that I now have a backup plan that can be turned in within minutes.
Monday, April 28, 2008
Simple email alert error page.
Mongrel, Apache, mod_proxy and Rails do go very well together. However, there are times when it can break down. While you can rely to some degree on monitoring tools, if a user is given an error page, it is nice to know as soon as it happens.
One good way to do this, have the error page, trigger an email alert letting you know some basic information so that you can debug and figure out what has gone wrong.
When mod proxy cannot connect to the mongrel cluster, it will return a 503 error page. Apache lets you specify this to be a cgi script so that you can bounce them to a cgi error page that packages up the environment and emails it to an administrator.
Here are 4 steps to follow to use this technique:
Step 1: Write a cgi error document
Step 2: Place it in your script alias path and set it as the error document for 503 errors
Step 3: Allow it to run (chmod a+x error.pl)
Step 4: Tell modd proxy to leave /cgi-bin scripts alone
One good way to do this, have the error page, trigger an email alert letting you know some basic information so that you can debug and figure out what has gone wrong.
When mod proxy cannot connect to the mongrel cluster, it will return a 503 error page. Apache lets you specify this to be a cgi script so that you can bounce them to a cgi error page that packages up the environment and emails it to an administrator.
Here are 4 steps to follow to use this technique:
Step 1: Write a cgi error document
#!/usr/bin/perl
use strict;
use CGI;
my $query = new CGI;
my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = "Reply-to: REPLYEAMAIL\@REPLYDOMAIN.com\n";
my $subject = "Subject: Apache Error Page\n";
my $content = "SERVER_SOFTWARE = " . $ENV{'SERVER_SOFTWARE'} . "\n";
$content = $content . "SERVER_SOFTWARE = " . $ENV{'SERVER_SOFTWARE'} . "\n";
$content = $content . "SERVER_NAME = " . $ENV{'SERVER_NAME'} . "\n";
$content = $content . "GATEWAY_INTERFACE = " . $ENV{'GATEWAY_INTERFACE'} . "\n";
$content = $content . "SERVER_PROTOCOL = " . $ENV{'SERVER_PROTOCOL'} . "\n";
$content = $content . "SERVER_PORT = " . $ENV{'SERVER_PORT'} . "\n";
$content = $content . "REQUEST_METHOD = " . $ENV{'REQUEST_METHOD'} . "\n";
$content = $content . "HTTP_ACCEPT = '" . $ENV{'HTTP_ACCEPT'} . "\n";
$content = $content . "PATH_INFO = " . $ENV{'PATH_INFO'} . "\n";
$content = $content . "PATH_TRANSLATED = " . $ENV{'PATH_TRANSLATED'} . "\n";
$content = $content . "SCRIPT_NAME = " . $ENV{'SCRIPT_NAME'} . "\n";
$content = $content . "QUERY_STRING = " . $ENV{'QUERY_STRING'} . "\n";
$content = $content . "REMOTE_HOST = " . $ENV{'REMOTE_HOST'} . "\n";
$content = $content . "REMOTE_ADDR = " . $ENV{'REMOTE_ADDR'} . "\n";
$content = $content . "REMOTE_USER = " . $ENV{'REMOTE_USER'} . "\n";
$content = $content . "CONTENT_TYPE = " . $ENV{'CONTENT_TYPE'} . "\n";
$content = $content . "CONTENT_LENGTH = " . $ENV{'CONTENT_LENGTH'} . "\n";
my $to = "To: YOUREMAIL\@YOURDOMAIN.com\n";
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $content;
close(SENDMAIL);
print "Content-type: text/html\n\n";
print <
Step 2: Place it in your script alias path and set it as the error document for 503 errors
...edit your httpd.conf file...
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
ErrorDocument 503 /cgi-bin/error.pl
Step 3: Allow it to run (chmod a+x error.pl)
Step 4: Tell modd proxy to leave /cgi-bin scripts alone
...insert before your RewriteRule that proxies requests...
RewriteCond %{REQUEST_URI} !^/cgi-bin
Tuesday, April 22, 2008
Pubget is on the iPhone

For those Doctors, that love their iPhone, you can now run your Pubmed and Pubget [latest] searches and still get to the PDF right away.
You can read more about it on the pubget blog, or visit pubget.com/mobile on your iphone.
Friday, April 04, 2008
Pubget Blog Launched
I have launched a new blog on Pubget.
http://pubget.blogspot.com
I will be keeping this updated with the latest features, events and news for Pubget. If you are in medical/biological research or practice and you use Pubmed - this new service will save you time. Check it out, it is currently working for open access articles as well as licensed ones for MGH, MIT or Harvard users.
http://pubget.blogspot.com
I will be keeping this updated with the latest features, events and news for Pubget. If you are in medical/biological research or practice and you use Pubmed - this new service will save you time. Check it out, it is currently working for open access articles as well as licensed ones for MGH, MIT or Harvard users.
Monday, March 10, 2008
Wednesday, March 05, 2008
Thursday, February 28, 2008
Friday, February 15, 2008
Amazon S3 outage
Recently I had moved all my resources over to Amazon's S3. This morning, I woke up to a system wide outage that has beeing going on since at least 6:30am EST.
I was able to change all the asset code back to locally hosted by changing the "config.action_controller.asset_host" configuration setting and now all is working just fine.
Last year I lost a few Amazon EC2 instances and vowed to always have a backup plan that involved my colocated rack we could drive to. Although I have seen outages there, they have never lasted more than an hour. They also involved something that I could control and make reduntant going forward. With S3, there is not much you can except wait or have a backup plan.
Backup plans are fine for things like hosted assets but would be much harder where you have integrated customer data. Imagine if all your hosted attachments were in S3, there would be no way around an outage unless you mirrored the attachments in real time locally. That would involve paying twice for bandwidth and thus obviate all the savings with the S3 system.
I predict this will be big news and make a lot of people who relied n S3 think some serious thoughts about how they will structure their data going forward.
update 11am: There is talk the issue is resolved but it seems slow and it looks like there still might be some issues. To play it safe, I will keep the backup plan in place for another day to see what happens.
I was able to change all the asset code back to locally hosted by changing the "config.action_controller.asset_host" configuration setting and now all is working just fine.
Last year I lost a few Amazon EC2 instances and vowed to always have a backup plan that involved my colocated rack we could drive to. Although I have seen outages there, they have never lasted more than an hour. They also involved something that I could control and make reduntant going forward. With S3, there is not much you can except wait or have a backup plan.
Backup plans are fine for things like hosted assets but would be much harder where you have integrated customer data. Imagine if all your hosted attachments were in S3, there would be no way around an outage unless you mirrored the attachments in real time locally. That would involve paying twice for bandwidth and thus obviate all the savings with the S3 system.
I predict this will be big news and make a lot of people who relied n S3 think some serious thoughts about how they will structure their data going forward.
update 11am: There is talk the issue is resolved but it seems slow and it looks like there still might be some issues. To play it safe, I will keep the backup plan in place for another day to see what happens.
Monday, February 11, 2008
Pubget now available to Harvard/Partners
The fastest way to search science! If you are at Harvard or one of its affiliated hospitals, you can sign up now at pubget.com.
Shopping List
Grains
Make sure any whole-wheat products you buy are labeled 100% whole wheat.
Brown rice
Steel-cut oatmeal
Whole-grain or oat breakfast cereal (Cheerios, Kashi cereals, Grape Nuts)
Whole-grain pizza dough/crust
Whole-wheat or whole-grain bread
Whole-wheat pasta
Whole-wheat pitas or tortillas
Canned/Jarred Items
Black beans
Olives
Sun-dried tomatoes (not in oil)
Tomato sauce (no added sugars)
Tomatoes: whole, crushed, or diced
Unsweetened fruit
Vegetable or chicken stock/broth (low-salt)
White beans
Dried Fruits and Nuts
Nuts should be raw, rather than roasted or salted.
Almonds
Dried cranberries and apricots
Pistachios, chopped
Raisins
Walnuts and hazelnuts
Condiments and Spices
Balsamic vinegar
Canola oil, regular and spray-on
Chocolate, dark (not milk) with at least 70% cocoa
Cinnamon and nutmeg
Extra-virgin olive oil
Honey
Low-sodium soy sauce
Mustard
Real maple syrup
Red pepper flakes
Turmeric or curry powder
Wine vinegar
Refrigerated Items
Eggs
Feta cheese, low-fat
Milk, skim or low-fat soy
Orange or grapefruit juice (100%) with pulp
Part-skim mozzarella cheese
Yogurt with active cultures (probiotic), low-fat
Sour cream, low-fat
Poultry/Fish
Chicken breast halves, skinless and boneless
Chicken thighs, skinless
Deli meat, sliced and skinless (not processed cold cuts)
Salmon fillets, skinless
Whole fish or fillets: trout, tilapia, snapper, or sea bass
Frozen Food
Blueberries and raspberries, frozen and unsweetened
Fruit sorbet
Vanilla frozen yogurt, nonfat or low-fat
Health Foods
Chia seed
Flaxseed
Soy protein powder
Fruits and Vegetables
Stock up on plenty of fresh fruits and veggies from each color group, but don’t buy more than you’ll be able to eat in a week. Fruits and vegetables lose their nutrient goodness when they sit around.
Blue/Purple:
Blueberries, blackberries, plums, eggplant
Orange/Yellow:
Carrots, sweet potatoes, squash, mangoes, pineapple
Red:
Tomatoes, cherries, cranberries, red peppers, red apples
Yellow/Green:
Avocados, broccoli, spinach, kiwifruit, lemons, limes
White/Green:
Garlic, onions, bananas, mushrooms
Make sure any whole-wheat products you buy are labeled 100% whole wheat.
Brown rice
Steel-cut oatmeal
Whole-grain or oat breakfast cereal (Cheerios, Kashi cereals, Grape Nuts)
Whole-grain pizza dough/crust
Whole-wheat or whole-grain bread
Whole-wheat pasta
Whole-wheat pitas or tortillas
Canned/Jarred Items
Black beans
Olives
Sun-dried tomatoes (not in oil)
Tomato sauce (no added sugars)
Tomatoes: whole, crushed, or diced
Unsweetened fruit
Vegetable or chicken stock/broth (low-salt)
White beans
Dried Fruits and Nuts
Nuts should be raw, rather than roasted or salted.
Almonds
Dried cranberries and apricots
Pistachios, chopped
Raisins
Walnuts and hazelnuts
Condiments and Spices
Balsamic vinegar
Canola oil, regular and spray-on
Chocolate, dark (not milk) with at least 70% cocoa
Cinnamon and nutmeg
Extra-virgin olive oil
Honey
Low-sodium soy sauce
Mustard
Real maple syrup
Red pepper flakes
Turmeric or curry powder
Wine vinegar
Refrigerated Items
Eggs
Feta cheese, low-fat
Milk, skim or low-fat soy
Orange or grapefruit juice (100%) with pulp
Part-skim mozzarella cheese
Yogurt with active cultures (probiotic), low-fat
Sour cream, low-fat
Poultry/Fish
Chicken breast halves, skinless and boneless
Chicken thighs, skinless
Deli meat, sliced and skinless (not processed cold cuts)
Salmon fillets, skinless
Whole fish or fillets: trout, tilapia, snapper, or sea bass
Frozen Food
Blueberries and raspberries, frozen and unsweetened
Fruit sorbet
Vanilla frozen yogurt, nonfat or low-fat
Health Foods
Chia seed
Flaxseed
Soy protein powder
Fruits and Vegetables
Stock up on plenty of fresh fruits and veggies from each color group, but don’t buy more than you’ll be able to eat in a week. Fruits and vegetables lose their nutrient goodness when they sit around.
Blue/Purple:
Blueberries, blackberries, plums, eggplant
Orange/Yellow:
Carrots, sweet potatoes, squash, mangoes, pineapple
Red:
Tomatoes, cherries, cranberries, red peppers, red apples
Yellow/Green:
Avocados, broccoli, spinach, kiwifruit, lemons, limes
White/Green:
Garlic, onions, bananas, mushrooms
Monday, January 28, 2008
My Default CentOS Setup
This script will probably only be valid for a week, but I thought I would share my ideas on a good CentOS 5 (64bit) install with Ruby on Rails, MySQL and Apache that will work with a capistrano deployment from subversion:
yum -y update
yum -y install ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs ruby-devel mysql mysql-devel mysql-server mysql-admin subversion httpd svn
togglesebool httpd_can_network_connect
cd /tmp
wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
tar -xvf rubygems-1.0.1.tgz
cd rubygems-1.0.1
ruby setup.rb
gem install rails json rfacebook acts_as_ferret capistrano mongrel mongrel_cluster pdf-toolkit actionmailer actionpack actionwebservice activerecord activeresource activesupport acts_as_taggable acts_as_versioned ferret google4r calendar mysql sources vpim mime-type --include-dependencies
#Fedora 8 also wants
yum -y install rubygem-mongrel gcc ruby-mysql
yum install gd gd-devel zlib-devel openssl-devel
gem install gem_plugin daemons capistrano --include-dependencies
gem install mongrel mongrel_cluster railsmachine --include-dependencies
gem install --version=2.7 mysql -- --with-mysql-config=/usr/bin/mysql_config
or
yum -y install ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs ruby-devel mysql mysql-devel mysql-server mysql-admin subversion httpd svn rubygem-mongrel gcc ruby-mysql gd gd-devel zlib-devel openssl-devel partimage
gem install -y rails -v=2.0.2
gem install json rfacebook acts_as_ferret capistrano mongrel mongrel_cluster pdf-toolkit actionmailer actionpack actionwebservice activerecord activeresource activesupport acts_as_taggable acts_as_versioned ferret google4r calendar mysql sources vpim mime-type ferret mime-types solr-ruby ruby-openid mechanize pdf-toolkit mongrel mongrel_cluster railsmachine bio --include-dependencies
I tried to make it as silent and complete as possible so that I could let the computer do all the work.
Thursday, January 24, 2008
Mysql Master to Master Replication
This will setup two Amazon EC2 CentOS 5 machines to cluster replicate all their MySQL databases.
Server 1: /etc/my.sql
Server 2: /etc/my.sql
Restart /etc/init.d/mysql restart on both servers.
Then run the following SQL on...
server 1:
server 2:
Server 1: /etc/my.sql
#replication
server-id=1
log-bin=mysql-bin
binlog-ignore-db=mysql
binlog-ignore-db=test
#information for becoming slave.
master-host =
master-user = replication
master-password = slave
master-port = 3306
Server 2: /etc/my.sql
#replication
server-id=2
log-bin=mysql-bin
binlog-ignore-db=mysql
binlog-ignore-db=test
#information for becoming slave.
master-host =
master-user = replication
master-password = slave
master-port = 3306
Restart /etc/init.d/mysql restart on both servers.
Then run the following SQL on...
server 1:
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST='10.253.15.15',MASTER_USER='replication',MASTER_PASSWORD='slave';
START SLAVE;
GRANT ALL PRIVILEGES ON *.* TO 'replication'@'' identified by 'slave';
server 2:
MASTER_HOST='10.253.65.221',MASTER_USER='replication',MASTER_PASSWORD='slave';
STOP SLAVE;
show slave status\G;
GRANT ALL PRIVILEGES ON *.* TO 'replication'@'' identified by 'slave';
You should then be able to create and remove databases on either servers and it will replicate to the other.
I tried to use "load data from master" but it only worked on very simple data. On large sets, it was better to use mysqlhotcopy (perl script that came with mysql on centos)
On CentOS, you first need to export the mysql directory in the /etc/exports file like this:
var/lib/mysql 10.253.15.15(rw,no_root_squash)
and then run:
exportfs -r
then on the machine with the tables, you run:
mkdir /tmp/mounted_mysql_directory
mount -o vers-3 10.253.65.221:/var/lib/mysql /tmp/mounted_mysql_directory
Now that you have the directory exported and mounted, you can hot copy the files from server 1 to server 2:
mysqlhotcopy --addtodest --resetmaster --resetslave -u root -p yourdatabasename_development /tmp/mounted_mysql_directory
The resetmaster and resetslave are important here. MySQL will keep an index in the replication log where it thinks its master is and where it is as a slave. After I copy the database over, I want them to start fresh. So, from here you can look at the master status on server 1 and master status on server 2 to get these indexes. then you can run CHANGE MASTER TO with an extra parameter:
MASTER_LOG_POS=98;
if the index was 98. This will then get them both in sync and ready to accept further transactions to apply.
You can also skip a given number of replication transactions using:
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = N;
just be careful what you skip.
Coming from a Notes/Domino background, this idea of replicating transactions was a little new. Notes, will keep a sequence number for each record and keep the data in sync. It does not matter how the data got into its current state, it will just do its best at keeping the data replicated (using sequence numbers and time stamps as needed).
MySQL is more transactional based. The documents talk about the my.cnf parameters like "binlog-ignore-db" will act as a filter for how transactions get written to the replication log. To a Notes person, this seems a little inefficient. It means to keep the data in sync, you have to run the exact same transactions on each server (even if the operations are repetitive and act on the same records). In Notes, it will be able to skip ahead to the final state rather than going through each transaction to get to the final state. MySQL has no such ability.
As a result, MySQL cannot just sync itself if you run into problems. This is also true when you add a member to the cluster or replace a failed one. To get things in sync again, you really have to think it through and make sure you lock tables as needed, get the data the same with copy tools like mysqlhotcopy and let the transactions start again on the cluster when you know it is ready.
I would also expect this would have a different scalability path than Notes - if your bottleneck is the amount of transactions you are getting, then adding additional replicas may not help in MySQL where it would in Notes.
Wednesday, January 16, 2008
Upgrading to rails 2.0.2
There were just a few too many cool features in 2.0 that I wanted so I have taken the plunge in a project. I did wait for 2.0.2, so it is not really bleeding edge - but I feel nice and up to date.
The process was fairly straight forward even though I knew I used a lot of plugins and deprecated methods. I had to perform the following to get it working:
After restarting the server, users will get a warning about cookies. However, this is a small price to pay for cookie based sessions.
The process was fairly straight forward even though I knew I used a lot of plugins and deprecated methods. I had to perform the following to get it working:
- gem install rails
- script/plugin install svn://errtheblog.com/svn/plugins/classic_pagination
- script/plugin install http://svn.rubyonrails.org/rails/plugins/in_place_editing/
After restarting the server, users will get a warning about cookies. However, this is a small price to pay for cookie based sessions.
Thursday, December 27, 2007
bellasante of boston
I tried to make a booking for my wife and a friend's wife yesterday for a spa treatment. So, I called the concierge to book it in for friday afternoon. The problem was they seemed very busy and I didn't know what to order or which location would be best. I didn't mind either Lexington or Wellesley but the concierge seemed in a rush so made me pick one right away. Then I was told after picking Wellesley there was nothing on the day I wanted.
I really felt like they were too busy to deal with me and decided the best way was to get off the phone as quickly as possible and try again with another concierge or spa. After replying to a few "contact us" forms for a site I am working on, I thought I should at least let them know the feedback to see if indeed they are too busy or if it was just a bad time and I got the wrong concierge. In any case, I filled out their web form only to find it was a "post" action to "#" and didn't actually go anywhere.
They seem to have a lot of "best of boston" awards so the spa part might be nice - it just seems that half the challenge is to get to that part.
Wednesday, December 05, 2007
Jack Cards on the WSJ.
One of the startup web sites we have been working on and hosting at ProjectLounge, was reviewed by the Wall Street Journal. I am looking forward to taking the site to the next level - but a review like this is certainly a good start for the site. It is full of good suggestions and a positive conclusion.
"I think its system would be welcomed by many people looking for good-quality, well-designed cards that catch the eye. It saves users the hassle of last-minute trips to the card store, and still lets greeting cards keep their personal touch, which is what makes them such a permanent fixture in our lives."
"I think its system would be welcomed by many people looking for good-quality, well-designed cards that catch the eye. It saves users the hassle of last-minute trips to the card store, and still lets greeting cards keep their personal touch, which is what makes them such a permanent fixture in our lives."
Monday, November 19, 2007
Fire Truck Photos
This morning we saw a Fire Truck visit our street - no fire or anything exciting. However, I did capture some photos.
Tuesday, August 28, 2007
Friday, August 24, 2007
Sunday, July 29, 2007
Mount ssh/sftp drives into OSX
Dealing with a server that is hosted requires a stronger level of security. This typically means no ftp or file sharing is allowed. However, ssh is secure and you can even prevent passwords and use rsa keys.
However, all this security does not mean you cannot mount a drive using OSX. Using the MacFuse at google, you can mount a remote ssh/sftp drive with a hostname, username, password (or rsa key) and path.
Steps:
1. Download and install MacFuse from the link
2. Restart your OSX (it does some low level magic that makes writing mounted disks easier)
3. Download and copy the sshfs into your Applications from the link.
Now that you have it download, you can run the sshfs application and connect to your disk.
If you do use an RSA key or the like, you will need to first connect via the command line so that the host gets to be trusted and then it will work fine from there on.
However, all this security does not mean you cannot mount a drive using OSX. Using the MacFuse at google, you can mount a remote ssh/sftp drive with a hostname, username, password (or rsa key) and path.
Steps:
1. Download and install MacFuse from the link
2. Restart your OSX (it does some low level magic that makes writing mounted disks easier)
3. Download and copy the sshfs into your Applications from the link.
Now that you have it download, you can run the sshfs application and connect to your disk.
If you do use an RSA key or the like, you will need to first connect via the command line so that the host gets to be trusted and then it will work fine from there on.
Tuesday, July 17, 2007
DIIOP NotesException: Server access denied
The R5 settings in the server document still play a part in how DIIOP handles permissions in 7.0.2. The getFirstDatabase function in DbDirectory, will return "Server access denied" if the "Allow HTTP clients to browse databases" is not set to "Yes" on the R5 Basics tab under HTTP Internet Protocols in your Domino server document.
Saturday, July 14, 2007
Customized iPhone ringtone
One the the missing features of the iPhone is not being able to select our own ringtone. Well, thanks to this web site, I was able to upload my own mp3 file as a ringtone and it worked.
It is not as easy as other phones but still possible with a little instructions.
It is not as easy as other phones but still possible with a little instructions.
Monday, July 02, 2007
Outlook Permissions for ICS files
A user recently got the error: "Can't create file: calendarevent.ics. Right-click the folder you want to create the file in, and then click Properties on the shortcut menu to check your permissions for the folder."
After some serching, it is not really a permission problem but rather when you install certain Microsoft Small Business products, the OutlookSecureTempFolder key in the registry is changed from "..\Temp\..." to "...\Temporary Internet Files\...".
To fix this, have your system administrator, go into the registry and change the HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security registry key OutlookSecureTempFolder value from "...\Temporary Internet Files\..." to "...\Temp\..." and you should be able to open ICS events from QuickPlace or any other service again.
After some serching, it is not really a permission problem but rather when you install certain Microsoft Small Business products, the OutlookSecureTempFolder key in the registry is changed from "..\Temp\..." to "...\Temporary Internet Files\...".
To fix this, have your system administrator, go into the registry and change the HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security registry key OutlookSecureTempFolder value from "...\Temporary Internet Files\..." to "...\Temp\..." and you should be able to open ICS events from QuickPlace or any other service again.
Thursday, June 28, 2007
Christmas come early?
Quickr has shipped early and after installing it and the latest fixes from "fix central", I have started the process of picking through the new features.
I have tested our existing themes and they all seem to work just fine so far and with a little more testing, I think we will be safe to upgrade some servers.
I have to say well done to Satwik and his team for getting QuickPlace team buzzing like it was 1999.
I have tested our existing themes and they all seem to work just fine so far and with a little more testing, I think we will be safe to upgrade some servers.
I have to say well done to Satwik and his team for getting QuickPlace team buzzing like it was 1999.
Saturday, June 23, 2007
It is all happening on the 29th
On the 29th of June, there will be so many things to do, I won't know what to do with myself.
1. Quickr 8 Launches;
2. iPhone is released; and
3. Sicko comes out.
I am sure there will be lots more happening that day, but these are things I have actually been waiting for and anticipating.
This week, I have been very busy sorting out some Windows Vista issues with QuickPlace 7 as well as a ruby on rails development project for jackcards. I am also in the process of installing a NAS for domino which so far indicates 2 to 4 times increase in our current IO performance.
So, if I have been a little quiet lately, I apologize and will be a little more sociable soon (even if it is just to show off an iPhone if I get the courage to buy one).
1. Quickr 8 Launches;
2. iPhone is released; and
3. Sicko comes out.
I am sure there will be lots more happening that day, but these are things I have actually been waiting for and anticipating.
This week, I have been very busy sorting out some Windows Vista issues with QuickPlace 7 as well as a ruby on rails development project for jackcards. I am also in the process of installing a NAS for domino which so far indicates 2 to 4 times increase in our current IO performance.
So, if I have been a little quiet lately, I apologize and will be a little more sociable soon (even if it is just to show off an iPhone if I get the courage to buy one).
Monday, June 11, 2007
Rational Climate Change Argument
Rational Climate Change Argument
This is basically the same as Pascal's Wager with some key differences. These are that Pascal was based on religion where this is actually based on science. However, it is a very good use of a truth table
This is basically the same as Pascal's Wager with some key differences. These are that Pascal was based on religion where this is actually based on science. However, it is a very good use of a truth table
Friday, June 01, 2007
Ruby on Rails Domino Active Record
I have been using this class for a while that allows some ActiveRecord like features for IBM Lotus Domino databases.
An example use would be:
It currently uses the OLE/COM bridge to get to domino so only will work on windows at this stage. The next step would be to compile it with the NotesAPI to allow it to work on all platforms.
The model source code is here (I do not maintain this anymore but happy for others to take it on under LGPL):
An example use would be:
class Contact < DominoRecord
attr_accessor :email_address, :first_name, :last_name
validates_presence_of :first_name, :last_name, :email_address
validates_format_of :email_address, :with =>
/^\s*(?:(?:[^,@\s]+)@(?:(?:[-a-z0-9]+\.)+[a-z]{2,}\s*(,\s*|\z)))+$/i,
:message => "must be a valid email address",
:on => :create
@@database_name = "contacts.nsf" #your database here
@@server_name = 'www/projectlounge' #your server here
end
It currently uses the OLE/COM bridge to get to domino so only will work on windows at this stage. The next step would be to compile it with the NotesAPI to allow it to work on all platforms.
The model source code is here (I do not maintain this anymore but happy for others to take it on under LGPL):
require 'win32ole'
class DominoRecord
attr_accessor :form
def save
@document = @@database.CreateDocument
form = self.class.to_s.downcase
@document.ReplaceItemValue "form", form
self.instance_variables.each do |inst|
field_name = inst.sub(/[@]/, '')
field_value = self.instance_variable_get(inst)
@document.ReplaceItemValue field_name, field_value.to_s
end
@document.Save(true, false)
end
def save!;
save
end
def update_attribute; end
def new_record?; end
include ActiveRecord::Validations
@@session = nil
@@database = nil
@@database_name = nil
@@server_name = nil
def [](key)
instance_variable_get(key)
end
def self.find(*args)
options = extract_options_from_args!(args)
validate_find_options(options)
case args.first
when :first then
@document = find_initial(options)
when :all then find_every(options)
else
@document = find_from_ids(args, options)
end
record = self.new
@document.Items.each do |item|
record.send(item.Name.downcase + "=", item.Text) unless ["document", "errors"].include?(item.Name)
end
record
end
def DominoRecord.human_attribute_name(attribute_key_name)
ActiveRecord::Base.human_attribute_name(attribute_key_name)
end
def initialize(attributes=nil)
unless @@session
@@session = WIN32OLE.new('Lotus.NotesSession')
@@session.Initialize
end
@@database = @@session.GetDatabase(@@server_name,@@database_name) unless @@database
unless form == nil
fields = @@database.GetForm(form).Fields
else
fields = @@database.GetForm(self.class.to_s).Fields
end
fields.each { |field| self.class.__send__(:attr_accessor, field) }
return if attributes.nil?
attributes.each do |k, v|
send(k + "=", v)
end
end
def finalize
@@session.Finalize
end
def session
@@session
end
def database
@@database
end
def document
@document
end
def attributes=(attributes)
return if attributes.nil?
attributes.stringify_keys!
multi_parameter_attributes = []
attributes.each do |k, v|
send(k + "=", v)
end
end
def self.method_missing(method_id, *arguments)
unless @@session
@@session = WIN32OLE.new('Lotus.NotesSession')
@@session.Initialize
end
@@database = @@session.GetDatabase(@@server_name,@@database_name) unless @@database
if match = /find_by_([_a-zA-Z]\w*)/.match(method_id.to_s)
@view = @@database.GetView($1)
puts arguments
@document = @view.GetDocumentByKey(arguments[0])
record = self.new
@document.Items.each do |item|
record.send(item.Name.downcase + "=", item.Text) unless ["document", "errors"].include?(item.Name)
end
record
else
super
end
end
private
def self.find_initial(options)
#not working
end
def self.find_every(options)
#not working
end
def self.find_from_ids(ids, options)
#not working
end
def self.find_one(id, options)
if result = @@database.GetDocumentByUNID( id )
result
else
raise RecordNotFound, "Couldn't find #{name} with ID=#{id}#{conditions}"
end
end
def self.find_some(ids, options)
result = find_every(options)
if result.size == ids.size
result
else
raise RecordNotFound, "Couldn't find all #{name.pluralize} with IDs (#{ids_list})#{conditions}"
end
end
def self.extract_options_from_args!(args) #:nodoc:
args.last.is_a?(Hash) ? args.pop : {}
end
VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset,
:order, :select, :readonly, :group, :from ]
def self.validate_find_options(options) #:nodoc:
options.assert_valid_keys(VALID_FIND_OPTIONS)
end
end
Monday, May 14, 2007
Allow selections not in list (for the web)
One of the neat options with drop down selections in Notes, is the ability to let people type an option that is not in the list. This helps build dynamic lists.
Here is some javascript to use to get this working on the web:
You can either put this in an included javascript file or wrap it directly inline.
Then you can call it using the onchange event for your selection field:
Where "New Group" is the text you want to trigger the prompt for the text and "Please enter new group" is the prompt you want to display.
Here is some javascript to use to get this working on the web:
function changed(el, cmp, pmt){
if(el.options[el.selectedIndex].value==cmp) {addoption(el, pmt);}
}
function addoption(el, pmt){
var txt=prompt(pmt,'');
if(txt==null) {return;}
var o=new Option( txt, txt, false, true);
el.options[el.options.length]=o;
}
You can either put this in an included javascript file or wrap it directly inline.
Then you can call it using the onchange event for your selection field:
onchange="changed(this, 'New Group', 'Please enter new group:')"
Where "New Group" is the text you want to trigger the prompt for the text and "Please enter new group" is the prompt you want to display.
Monday, April 23, 2007
A week into Linked In
A customer recently sent me an email to join linked in, a social networking "business" site. It seems myspace is more for music fans, facebook for college or recent graduates where linked in is more for professionals.
The differences are certainly there in the UI. For instance, in facebook, you can say if a linked friend "hooked up" with you whereas there is no option for this in linked in. I guess it still goes on, but it is not something you would publish as it has little business benefit and does not make you look very professional.
I was surprised how many IBM'ers were already on the network and thank those who have linked to me. The purpose is to find connections, so I thought I would give it a little test.
The test worked. I have managed to find one lost friend through our xhtml developer. I worked with David Wyss for a while around the QuickPlace redbook and he had seemingly vanished. I had asked a few common contacts (IBM) what happened to him but they didn't know. When I searched through linked in, it found a connection through Australia (where I was looking in Switzerland) and it came through a non-IBM source (where I looked through IBM'ers). So, it seems we were not very far from each other after all - there was always 2 degrees of separation all this time and we just didn't know.
The differences are certainly there in the UI. For instance, in facebook, you can say if a linked friend "hooked up" with you whereas there is no option for this in linked in. I guess it still goes on, but it is not something you would publish as it has little business benefit and does not make you look very professional.
I was surprised how many IBM'ers were already on the network and thank those who have linked to me. The purpose is to find connections, so I thought I would give it a little test.
The test worked. I have managed to find one lost friend through our xhtml developer. I worked with David Wyss for a while around the QuickPlace redbook and he had seemingly vanished. I had asked a few common contacts (IBM) what happened to him but they didn't know. When I searched through linked in, it found a connection through Australia (where I was looking in Switzerland) and it came through a non-IBM source (where I looked through IBM'ers). So, it seems we were not very far from each other after all - there was always 2 degrees of separation all this time and we just didn't know.
Sunday, April 08, 2007
Change custom field names in QuickPlace
If you have a custom form in quickplace and then change a field name, it will not go through and update all the pages that have been created by this form.
So, for instance, if you create a form that has a field called "categories" and want to change it to "category", here is an agent that will loop through all the documents in this room and all its inner rooms using recursion.
So, for instance, if you create a form that has a field called "categories" and want to change it to "category", here is an agent that will loop through all the documents in this room and all its inner rooms using recursion.
'category correction:
Option Public
Option Declare
Dim server As String
Dim placename As String
Dim s As notessession
Sub fixcategory(roompath)
Dim roomdb As NotesDatabase
Dim roomview As notesview
Set roomdb = s.GetDatabase(server, roompath)
If roomdb.IsOpen = False Then
Call roomdb.Open(server, roompath)
End If
Dim roomindex As notesview
Set roomindex = roomdb.GetView("System\Index")
Dim page As notesdocument
Set page = roomindex.GetFirstDocument
While Not(page Is Nothing)
'Work through all documents
page.c_category = page.GetItemValue("c_categories")
Call page.Save(True,False)
Set page = roomindex.GetNextDocument(page)
Wend
Set roomview = roomdb.GetView("System\Subrooms")
Dim doc As NotesDocument
Set doc = roomview.GetFirstDocument
While Not (doc Is Nothing)
Dim iroomtitle As String
Dim iroomfile As String
iroomtitle = doc.GetItemValue("h_Name")(0)
iroomfile = doc.GetItemValue("h_LocDbName")(0)
Print "Working on: " + iroomfile
Call fixcategory("quickplace/"+placename+"/" + iroomfile)
Set doc = roomview.GetNextDocument(doc)
Wend
End Sub
Sub Initialize
Set s = New notessession
placename = "test_place" 'Your place name
server = "www/projectlounge" 'Your server name
Print "Starting in a room"
'you can change this to main.nsf if you need
Call fixcategory("quickplace/"+placename+"/PageLibrary85257279005D300B.nsf")
End Sub
Tuesday, April 03, 2007
Rediscovering an ibm.com treasure
While digging up an old email from 2004 for someone, I found that my signature once contained a link to the IBM culture clash web site.
It does have some good information and for those that have traveled to some of these countries, it certainly can bring back some memories.
It does have some good information and for those that have traveled to some of these countries, it certainly can bring back some memories.
Monday, March 26, 2007
AJAX state_select
After downloading the state_select plugin for rails.
I put in a little extra work to make the state select AJAX updated.
The address form looks like:
Where the AJAX calls into a partial form:
I have posted to their blog to see if the state_select could be updated so there was no translation needed between the "country" from select_country and the "country" parameter passed into the state_select. It would be also nice to return a text field if there is no state list for the given country.
This would mean the partial code would just be:
I put in a little extra work to make the state select AJAX updated.
The address form looks like:
<%= state_select 'address', 'state', country='US' %>
...
<%= country_select 'address', 'country' %>
<%= observe_field :address_country, :frequency=>0.5,
:update=>"state_select",
:url=> {:action=>'state_select', :only_path=>false},
with=>"'country=' + encodeURIComponent(value)" %>
Where the AJAX calls into a partial form:
<% if params[:country] == "United States" %>
<%= state_select 'address', 'state', country='US' %>
<% elsif params[:country] == "India" %>
<%= state_select 'address', 'state', country='INDIA' %>
<% elsif params[:country] == "Canada" %>
<%= state_select 'address', 'state', country='CANADA' %>
<% elsif params[:country] == "Australia" %>
<%= state_select 'address', 'state', country='AUSTRALIA' %>
<% elsif params[:country] == "Spain" %>
<%= state_select 'address', 'state', country='SPAIN' %>
<% elsif params[:country] == "Uganda" %>
<%= state_select 'address', 'state', country='UGANDA' %>
<% elsif params[:country] == "France" %>
<%= state_select 'address', 'state', country='FRANCE' %>
<% elsif params[:country] == "Germany" %>
<%= state_select 'address', 'state', country='GERMAN' %>
<% else %>
<%= text_field 'address', 'state', :class=>"text" %>
<% end %>
I have posted to their blog to see if the state_select could be updated so there was no translation needed between the "country" from select_country and the "country" parameter passed into the state_select. It would be also nice to return a text field if there is no state list for the given country.
This would mean the partial code would just be:
<%= state_select 'address', 'state', params[:country].uppercase %>
Thursday, March 22, 2007
Importing zip codes
This entry will show you how to quickly import zip codes into your database. From there, they can be used with AJAX lookups or verification.
Step 1: Download the zips.txt into your RoR (rails) db directory or some other place.
http://www.census.gov/tiger/tms/gazetteer/zips.txt
Step 2: Generate the table in MySQL
Step 3: Generate the model
Step 4: Run this import code
You can then monitor the table size and wait for it to grow to 29k+.
Step 1: Download the zips.txt into your RoR (rails) db directory or some other place.
http://www.census.gov/tiger/tms/gazetteer/zips.txt
Step 2: Generate the table in MySQL
CREATE TABLE zip_codes (
id INTEGER NOT NULL AUTO_INCREMENT
, zip CHAR(5)
, state CHAR(2)
, town VARCHAR(50)
, population INTEGER
, PRIMARY KEY (id)
);
Step 3: Generate the model
ruby script\generator scaffold zip_code
Step 4: Run this import code
require 'csv'
CSV.open("#{RAILS_ROOT}/db/zips.txt", "r") do |row|
zip = ZipCode.new
zip.zip = row[1]
zip.state = row[2]
zip.town = row[3]
zip.population = row[6]
zip.save!
end
You can then monitor the table size and wait for it to grow to 29k+.
Tuesday, February 13, 2007
4th Grade Math Problem
A friend's 4Th grade child was given this problem a few days ago as homework. I found it really hard - not sure how it could be solved without a computer (but maybe someone knows the answer).
I have an answer and my working in the comments and welcome other solutions people might have.
So, if you want a tease, don't click on the comments until you have a go. I don't want to taint your thinking with my brute force attack.
Where the letters are numbers from 0 to 9 excluding 3. Find the values for each letter that would make this true:
show + tight = coach
I have an answer and my working in the comments and welcome other solutions people might have.
So, if you want a tease, don't click on the comments until you have a go. I don't want to taint your thinking with my brute force attack.
Saturday, February 10, 2007
I just watched the secret
I just watched the secret today. It is a motivational movie that talks about positive thinking. I was really into motivational tapes/books and talks when I was in high school and early university. After that, I focused more on technology and computers than my personal mental state.
I like the idea that positive thinking can bring you anything you want but I tend to be more pessimistic these days. Having said that, I do believe that you can achieve more with positive thinking than you can with negative thinking - so I am happy that I watched the movie and I am going to be a little more positive in my day to day life.
So in that light, I wanted to list some of the items I am grateful for:
* my loving wife;
* good health;
* close friends and family;
* successful internet business;
* experience and friends at IBM/IRIS;
* ability to travel;
* cognitive skills; and
* the Irish (what's not to love about the Irish)
This list is far from inclusive - but it certainly covers the major topics.
Part of the positive thinking aspect is to also be grateful for what is going to happen in the future and believe it will happen. For me this would include:
* the above list 100 times over;
* brilliant solution to global warming
* peace through humanity towards others
* faster than light speed engines to travel to other worlds
* teleportation
* dramatic improvements in medicines that allows anyone to live as long as they like (this is a good one for all the agnostics)
Enjoy! .. and now back to the technology and computers :)
I like the idea that positive thinking can bring you anything you want but I tend to be more pessimistic these days. Having said that, I do believe that you can achieve more with positive thinking than you can with negative thinking - so I am happy that I watched the movie and I am going to be a little more positive in my day to day life.
So in that light, I wanted to list some of the items I am grateful for:
* my loving wife;
* good health;
* close friends and family;
* successful internet business;
* experience and friends at IBM/IRIS;
* ability to travel;
* cognitive skills; and
* the Irish (what's not to love about the Irish)
This list is far from inclusive - but it certainly covers the major topics.
Part of the positive thinking aspect is to also be grateful for what is going to happen in the future and believe it will happen. For me this would include:
* the above list 100 times over;
* brilliant solution to global warming
* peace through humanity towards others
* faster than light speed engines to travel to other worlds
* teleportation
* dramatic improvements in medicines that allows anyone to live as long as they like (this is a good one for all the agnostics)
Enjoy! .. and now back to the technology and computers :)
Thursday, February 08, 2007
QuickPlace 8/Quickr Screenshots
Satwik has posted a blog entry with a link to the Quickr screenshots. These were shown at LotusSphere 2007 and should be available mid year as part of the product. It looks really nice and will allow people to do a lot more within a Quickr.
PDF link with screenshots
PDF link with screenshots
Friday, January 26, 2007
Very positive LotusSphere 2007
I am traveling back from LotusSphere 2007 and am very excited about Notes 8, Quickr (QuickPlace 8), and Lotus Connections (Ventura/Activities). I have been to a few LotusSpheres over the years and this was my first that I was not there from IBM or Iris. The positive energy around Notes 8, Quickr and Portal Express reminded me of when I did my first QuickPlace talk. The Notes developers and my old team were getting beaten up in the meet the developers lab about all the bugs and feature requests - where I was in the QuickPlace lab soaking up all the positive energy and excitement from the business partners and guests. This year, the positive energy was there for the Notes 8 client developers to enjoy.
The Ask the Developers section at the end was the most telling for me. Although there was a fair share of difficult questions, it was so positive to hear everyone preface their questions with admiration for the work and effort the development teams had put into Notes 8, Quickr and Connections.
The proof will be when the code is shipped and people start to adopt the composite application model for delivering applications. It will give IBM customers and partners a really powerful way to extend and deliver value.
The Ask the Developers section at the end was the most telling for me. Although there was a fair share of difficult questions, it was so positive to hear everyone preface their questions with admiration for the work and effort the development teams had put into Notes 8, Quickr and Connections.
The proof will be when the code is shipped and people start to adopt the composite application model for delivering applications. It will give IBM customers and partners a really powerful way to extend and deliver value.
Wednesday, January 10, 2007
Running Domino on an Amazon Elastic Cloud
I was recently accepted into the Amazon EC2 limited beta and was able to create my first instance following the getting started tutorial.
As they currently have no support operating systems for Domino, I asked Daniel Nashed which he thought was most like the supported system. He suggested the CentOS as he has run 4.3 but not 4.4.
I then loaded up that instance using the Amazon tools. It is a very raw image without a web server but came up very quickly. After that I downloaded and installed Domino for Linux to the machine.
I had to authorize the domino port and remote setup port for my machines:
Then, I created the notes user:
Uploaded the latest rc_domino script and then ran the server in listen mode:
The server complained about a missing library (/opt/ibm/lotus/notes/latest/linux/tunekrnl: error while loading shared libraries : libstdc++.so.5: cannot open shared object file: No such file or directory), so I had to install this via yum:
This resolved the startup problem, and the Domino setup ran as normal.
I have the server up at:
http://domu-12-31-33-00-03-6c.usma1.compute.amazonaws.com/
(I will probably take the server down after LS2007).
It seems to run as you would expect from 1.7GHz with 1.75Gb RAM. When I pull the statistics through the admin client, it looks perfectly healthy and I can create databases as you would normally.
For the money, it works out at about $73/month (10c/hour) for a small server plus bandwidth and storage. It is in a totally different league to AIX LPARs (you scale by adding more instances rather than making your current instance larger) but for a small business is it a really good alternative to running your own domino server. Looking after a rack in a colocation facility is a lot of work and Amazon gives the technical users a cheap alternative here.
As they currently have no support operating systems for Domino, I asked Daniel Nashed which he thought was most like the supported system. He suggested the CentOS as he has run 4.3 but not 4.4.
I then loaded up that instance using the Amazon tools. It is a very raw image without a web server but came up very quickly. After that I downloaded and installed Domino for Linux to the machine.
I had to authorize the domino port and remote setup port for my machines:
ec2-authorize default -p 1352
ec2-authorize default -p 8585
Then, I created the notes user:
useradd notes
Uploaded the latest rc_domino script and then ran the server in listen mode:
server -listen
The server complained about a missing library (/opt/ibm/lotus/notes/latest/linux/tunekrnl: error while loading shared libraries : libstdc++.so.5: cannot open shared object file: No such file or directory), so I had to install this via yum:
yum install compat-libstdc++-33
This resolved the startup problem, and the Domino setup ran as normal.
I have the server up at:
http://domu-12-31-33-00-03-6c.usma1.compute.amazonaws.com/
(I will probably take the server down after LS2007).
It seems to run as you would expect from 1.7GHz with 1.75Gb RAM. When I pull the statistics through the admin client, it looks perfectly healthy and I can create databases as you would normally.
For the money, it works out at about $73/month (10c/hour) for a small server plus bandwidth and storage. It is in a totally different league to AIX LPARs (you scale by adding more instances rather than making your current instance larger) but for a small business is it a really good alternative to running your own domino server. Looking after a rack in a colocation facility is a lot of work and Amazon gives the technical users a cheap alternative here.
Monday, January 01, 2007
QuickPlace Clustering over a Wide Area
I have started to experiment with wide area clustering of QuickPlace 7.0. In QuickPlace 8, it will use more Web 2.0 technologies and libraries such as Dojo. The impact of this will mean the QuickPlaces will become more chatty (more smaller and lighter requests). As a result, any latency issues might become more noticeable. To make the most of this, having your QuickPlace server as close as possible, will make the place much faster.
Once I can sort out any clustering issues, the next stage is to use directional dns from Neustar. This will direct the user to the closest server to the users location. For Australian users, this will be Sydney (latency of 20ms instead of the current 300ms), West Coast USA will be San Francisco (10ms instead of 80ms) and East Coast will keep hitting our main servers in Somerville, MA (10ms or less from New York). So far the Australian server is keeping up with the load and the West Coast should be online soon. I hope to have the world wide cluster working before LotusSphere 2007.
Once I can sort out any clustering issues, the next stage is to use directional dns from Neustar. This will direct the user to the closest server to the users location. For Australian users, this will be Sydney (latency of 20ms instead of the current 300ms), West Coast USA will be San Francisco (10ms instead of 80ms) and East Coast will keep hitting our main servers in Somerville, MA (10ms or less from New York). So far the Australian server is keeping up with the load and the West Coast should be online soon. I hope to have the world wide cluster working before LotusSphere 2007.
Friday, November 17, 2006
How to compile NotesAPI programs without buying visual studio on Windows XP
Download and install:
1. Microsoft Visual C++ Express (GUI not needed to compile)
http://msdn.microsoft.com/vstudio/express/visualc/
2. Run Windows Update if needed
3. Microsoft Platform SDK for Windows Server 2003
http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&DisplayLang=en#filelist
4. Download and extract the Lotus C API Toolkit
http://www-128.ibm.com/developerworks/lotus/downloads/toolkits.html
5. Download the nmake program and copy this to your c++ bin directory
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084
(may already come with c++ express)
6. Create batch files that simplify your build (put these in a directory in your path)
FILE: mk.bat
CONTENTS:
nmake /f mswin32.mak /a
FILE: setenv.bat
CONTENTS:
"D:\Program Files\Microsoft Visual Studio 8\VC\vcvars32.bat"
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.bat"
set LIB=d:\notesapi\lib\mswin32;%LIB%
set INCLUDE=d:\notesapi\include;%INCLUDE%
set PATH=d:\lotus\domino;%PATH%
FILE: w32.bat
CONTENTS:
"D:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.Cmd" /RETAIL
7. To use the compiler
1. Start a Visual Studio 2005 Command Prompt
2. Run the commands:
a) setenv
b) w32
3. Change to the d:\notesapi\samples\basic\intro
4. run the batch file "mk"
...and you should then be able to compile NotesAPI programs.
1. Microsoft Visual C++ Express (GUI not needed to compile)
http://msdn.microsoft.com/vstudio/express/visualc/
2. Run Windows Update if needed
3. Microsoft Platform SDK for Windows Server 2003
http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&DisplayLang=en#filelist
4. Download and extract the Lotus C API Toolkit
http://www-128.ibm.com/developerworks/lotus/downloads/toolkits.html
5. Download the nmake program and copy this to your c++ bin directory
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084
(may already come with c++ express)
6. Create batch files that simplify your build (put these in a directory in your path)
FILE: mk.bat
CONTENTS:
nmake /f mswin32.mak /a
FILE: setenv.bat
CONTENTS:
"D:\Program Files\Microsoft Visual Studio 8\VC\vcvars32.bat"
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.bat"
set LIB=d:\notesapi\lib\mswin32;%LIB%
set INCLUDE=d:\notesapi\include;%INCLUDE%
set PATH=d:\lotus\domino;%PATH%
FILE: w32.bat
CONTENTS:
"D:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\SetEnv.Cmd" /RETAIL
7. To use the compiler
1. Start a Visual Studio 2005 Command Prompt
2. Run the commands:
a) setenv
b) w32
3. Change to the d:\notesapi\samples\basic\intro
4. run the batch file "mk"
...and you should then be able to compile NotesAPI programs.
Saturday, November 11, 2006
Paris in November
We arrived in Paris after 7 weeks in Geneva. It was memorial day here and we had a perfect view of the ceremony from the hotel. The TGV was the perfect way to travel and we missed the strikes that seem to happen each November. Here are some photos we posted...
Sunday, October 29, 2006
Leukerbad for the weekend
Wednesday, October 25, 2006
Making the AIX shell more friendly
To make the standard korn shell more friendly, you can edit your .profile with the following settings:
Note, to get control in vi ctrl-v (keep this down when typing the next character).
This will now give you the use of the up and down arror keys as well as the backspace key for editing commands. This much easier than using ctrl-h and all the standard keystrokes.
set -o emacs
stty erase ^?
alias __A='^P"
alias __B='^N"
alias __C='^F"
alias __D='^B"
Note, to get control in vi ctrl-v (keep this down when typing the next character).
This will now give you the use of the up and down arror keys as well as the backspace key for editing commands. This much easier than using ctrl-h and all the standard keystrokes.
Tuesday, October 24, 2006
Changing a database replica id on AIX
There has been a utility floating around to change a Lotus Notes database's replica id for some time. I recently migrated a company to AIX 5.3 from another platform to run Domino 7.0.2. Here is a simple HOWTO get up and running to compile with the Notes API on AIX 5.3.
Upload the NotesApi tool kit from the Lotus Developer Domain (under toolkits).
Uncompress and extract the tar file to /yourmount/notesapi
Make sure the notes user owns these files and any links
chown –r notes:notes /yourmount/notesapi
Create a link under /opt/ibm/lotus
cd /opt/ibm/lotus
ln -s /yourmount/notesapi notesapi
chown notes:notes notesapi
Change to the notes user with their profile
su - notes
Create a script to set all the environment variables
server:/home/notes$ cat setenv
#!/usr/bin/ksh
LOTUS=/opt/ibm/lotus; export LOTUS
NOTES_DATA_DIR=/yourmount/domino/data; export NOTES_DATA_DIR
Notes_ExecDirectory=$LOTUS/notes/latest/ibmpow; export Notes_ExecDirectory
PATH=$PATH:$NOTES_DATA_DIR:$Notes_ExecDirectory; export PATH
Source the file before running any compilations
server:/home/notes$ . setenv
compile the intro sample as a test
cd /yourmount/notesapi/sample/basic/intro
make -f aix.mak
You can now compile any notesapi program.
The chrepid.c example is available for download here:
chrepid.c
chrepid make
chrepid compiled program
Upload the NotesApi tool kit from the Lotus Developer Domain (under toolkits).
Uncompress and extract the tar file to /yourmount/notesapi
Make sure the notes user owns these files and any links
chown –r notes:notes /yourmount/notesapi
Create a link under /opt/ibm/lotus
cd /opt/ibm/lotus
ln -s /yourmount/notesapi notesapi
chown notes:notes notesapi
Change to the notes user with their profile
su - notes
Create a script to set all the environment variables
server:/home/notes$ cat setenv
#!/usr/bin/ksh
LOTUS=/opt/ibm/lotus; export LOTUS
NOTES_DATA_DIR=/yourmount/domino/data; export NOTES_DATA_DIR
Notes_ExecDirectory=$LOTUS/notes/latest/ibmpow; export Notes_ExecDirectory
PATH=$PATH:$NOTES_DATA_DIR:$Notes_ExecDirectory; export PATH
Source the file before running any compilations
server:/home/notes$ . setenv
compile the intro sample as a test
cd /yourmount/notesapi/sample/basic/intro
make -f aix.mak
You can now compile any notesapi program.
The chrepid.c example is available for download here:
chrepid.c
chrepid make
chrepid compiled program
Thursday, September 07, 2006
Monday, September 04, 2006
First Surf Lesson

Although I was born in Hawaii, today was my first ever surf lesson and I really enjoyed it. Thanks to Learn to Surf Noosa.
Sunday, September 03, 2006
Saturday, September 02, 2006
Noosa

We are having a nice weekend away in Noosa. This was taken in Nooseville at the Noosa Pacific resort.
Monday, August 14, 2006
Retrospective Spam Filter
As a good spamcop user, I like to report all the spam that slips through the black lists and filters. That way, making sure the network admins know about any open relays they might have while building the black lists. However, a lot of spam comes through over night and I get a full inbox in the morning. When I report most of these, they have already been black listed. So, I thought it would be best to write a script that would check to see if these had already been listed and filter based on this. This way, even if the spam slipped through the black list on the first try, eventually it would be listed and filtered out of the inbox after the fact. This code seems to be working well for my inbox so I thought I should share it for all Lotus Notes and Ruby users:
require 'win32ole'
require 'socket'
@application = WIN32OLE.new('Notes.NotesSession')
def check_file(server, mail)
@database = @application.GetDatabase(server, mail)
@database.Open(server, mail) unless @database.IsOpen
@view = @database.GetView('($InBox)')
dnsbls = %w{bl.spamcop.net cbl.abuseat.org}
count = @view.TopLevelEntryCount
count.times do |index|
doc = @view.GetNthDocument(index+1)
spamdocs = []
doc.GetReceivedItemText.each do |t|
start = t.split(/[()]/)
start[1] =~ /(\d+).(\d+).(\d+).(\d+)/
dnsbls.each do |dnsbl|
begin
var = Socket.getaddrinfo "#$4.#$3.#$2.#$1.#{dnsbl}", 0
puts var[0][2]
if var[0][2] =~ /127.0/
puts "Access denied for #{start[1]} by #{dnsbl}"
spamdocs << doc
end
rescue
end
end
end
spamdocs.each do |doc|
doc.RemoveFromFolder("($InBox)")
doc.PutInFolder("($JunkMail)")
end
end
end
check_file('www/projectlounge',"mail/iconnor.nsf")
Saturday, August 12, 2006
Happy birthday and anniversary Dowds

We went out to Ecco for dinner with the Dowds to celebrate 38 year anniversary and Tack's birthday.
We all had a wonderful night and thanks to the staff at Ecco for making it such a pleasant night.
Saturday, July 22, 2006
Installing Ubuntu on a Dell PowerEdge without a CD drive
I recently purchased a very basic DELL in Australia. In the USA, it is impossible to buy a DELL server without a CD ROM and after buying a few there for various reasons, I did not think to ask when ordering the one on the phone. Well, let me assure you, no other CD drive I could get my hands on would actually work and the support staff at DELL were of no help. I even managed to get a DELL CD from a friends PC but it would not work in the server either - the server was just too fussy.
Before sending it back, I thought I would give it one last shot and purchased a 1GB USB key from a local computer dealer. Then downloaded a ubuntu ISO for a CD install. After a few trial and errors and searching on the internet, I think I have the actual instructions to get it working. Although, I am no linux kernel hacker, here goes:
1. Download the ISO that you want (in my case ubuntu 6.06 desktop)
2. Download the syslinux tool for windows (syslinux latest)
3. Optional USB format utility (from HP)
4. Copy the CD contents to your USB device
5. Unzip the syslinux and run it against your USB drive (syslinux.exe -f F:) from the win32 directory of syslinux
6. Copy these files to the root of the USB
7. Then edit the syslinux.cfg so that the vmlinux and initrd.gz now point to the root
e.g.
8. Eject the USB and you can now boot from it as soon as you go into the BIOS settings on the DELL server (F2 at boot) and set the boot order to allow the USB device to boot as a priority
Before sending it back, I thought I would give it one last shot and purchased a 1GB USB key from a local computer dealer. Then downloaded a ubuntu ISO for a CD install. After a few trial and errors and searching on the internet, I think I have the actual instructions to get it working. Although, I am no linux kernel hacker, here goes:
1. Download the ISO that you want (in my case ubuntu 6.06 desktop)
2. Download the syslinux tool for windows (syslinux latest)
3. Optional USB format utility (from HP)
4. Copy the CD contents to your USB device
5. Unzip the syslinux and run it against your USB drive (syslinux.exe -f F:) from the win32 directory of syslinux
6. Copy these files to the root of the USB
vmlinuz (kernel binary) from "casper\vmlinuz"
initrd.gz (initial ramdisk image) from "casper\initrd.gz"
syslinux.cfg (SYSLINUX configuration file) rename and copy from "isolinux\isolinux.cfg"
7. Then edit the syslinux.cfg so that the vmlinux and initrd.gz now point to the root
e.g.
DEFAULT /casper/vmlinuz
GFXBOOT bootlogo
GFXBOOT-BACKGROUND 0xB6875A
APPEND boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram
rw quiet splash --
....Becomes....
DEFAULT vmlinuz
GFXBOOT bootlogo
GFXBOOT-BACKGROUND 0xB6875A
APPEND boot=casper initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram
rw quiet splash --
8. Eject the USB and you can now boot from it as soon as you go into the BIOS settings on the DELL server (F2 at boot) and set the boot order to allow the USB device to boot as a priority
Monday, July 10, 2006
Disposable email, spamcop and a trap
I will never be afraid to give out my email address again. Well, maybe not my actual address, but I will give away my sneakemail address. This service (http://sneakemail.com), will allow you to generate a random looking email address like "a9svgun0211@sneakemail.com" that you can safely give out. It is a disposable address that you can use to sign up for a given site, tag it for that purpose and then if you get any spam from that site, delete the address.
However, I have recently taken this one step further. I have created a spamtrap address that will automatically report spam to spamcop and blacklist the IP address of the hosting servers. So, instead of deleting the address, I simply re route it to the spam trap and increase the power of the blacklist.
Requires tools:
1. Sneakemail (free accounts available)
2. Spamcop reporting account
3. Automatic report account - the trap account (Thunderbird Reporter or Lotus Notes reporter )
Then you can use your disposable email addresses as you need and have them divert to the spam trap if they start to get spammed.
However, I have recently taken this one step further. I have created a spamtrap address that will automatically report spam to spamcop and blacklist the IP address of the hosting servers. So, instead of deleting the address, I simply re route it to the spam trap and increase the power of the blacklist.
Requires tools:
1. Sneakemail (free accounts available)
2. Spamcop reporting account
3. Automatic report account - the trap account (Thunderbird Reporter or Lotus Notes reporter )
Then you can use your disposable email addresses as you need and have them divert to the spam trap if they start to get spammed.
Friday, June 30, 2006
Brisbane in the morning
Wednesday, June 28, 2006
LotusScript to restore removed QuickPlace
This is a LotusScript button that the QuickPlace SU administrator can run on a server to restore a QuickPlace that has been removed with QPTool. It goes through and changes all the titles of the place back to their original one before being marked as [Pending Deletion].
Dim s As notessession
Dim server As String
Dim placename As String
Sub Click(Source As Button)
Set s = New notessession
placename = "yourplacename"
server = "yourserver/projectlounge"
Print "Starting in main room"
Call restoredb(placename, "quickplace/"+placename+"/main.nsf")
End Sub
Sub restoredb(roomtitle, roompath)
Dim roomdb As NotesDatabase
Dim roomview As notesview
Set roomdb = s.GetDatabase(server, roompath)
If roomdb.IsOpen = False Then
Call roomdb.Open(server, roompath)
End If
roomdb.Title = roomtitle
Print "Set title: " + roomtitle
Set roomview = roomdb.GetView("System\Subrooms")
Dim doc As NotesDocument
Set doc = roomview.GetFirstDocument
While Not (doc Is Nothing)
Dim iroomtitle As String
Dim iroomfile As String
iroomtitle = doc.GetItemValue("h_Name")(0)
iroomfile = doc.GetItemValue("h_LocDbName")(0)
Print "Working on: " + iroomfile
Call restoredb(iroomtitle, "quickplace/"+placename+"/" + iroomfile)
Set doc = roomview.GetNextDocument(doc)
Wend
End Sub
Sunday, June 25, 2006
RoR authentication with IBM Notes/Domino
This is a very simple authentication system for a Ruby on Rails server in the same internet domain. It will allow you to get back the username of the person hitting your server provided they already have authenticated with an IBM Lotus/Domino or Websphere server that uses multi-server based session authentication.
IBM Domino/Websphere authentication works by placing an encrypted cookie for a given domain. There are a number of ways to find out what this cookie means.
For instance, you could either:
1. Decrypt the cookie using the secret key in the domino directory; or
2. Pass that cookie along to a live domino server and get back the username.
In this example, we are going to use the second option. This means we take that cookie and then pass it to an IBM server to check the authentication.
The cookie is stored in as LTPA token. Here is the ruby on rails code:
On the domino side, you just need to create a database and then a page within the database that has a field returning @username().
This will then return the full username. If you are using QuickPlace for instance, you will get back something like "CN=user/OU=placename/OU=QP/O=certifier" and you can deal with this as you like in your ruby code.
IBM Domino/Websphere authentication works by placing an encrypted cookie for a given domain. There are a number of ways to find out what this cookie means.
For instance, you could either:
1. Decrypt the cookie using the secret key in the domino directory; or
2. Pass that cookie along to a live domino server and get back the username.
In this example, we are going to use the second option. This means we take that cookie and then pass it to an IBM server to check the authentication.
The cookie is stored in as LTPA token. Here is the ruby on rails code:
require 'open-uri'
module DominoAuthenication
public
# accesses the current user from the session.
# overwrite this to set how the current user is retrieved from the session.
# To store just the whole user model in the session:
#
# def current_user
# session[:user]
# end
#
def current_user
if session[:user]
@current_user ||= session[:user]
else
begin
tokenstring = "LtpaToken="
tokenstring = tokenstring + cookies[:LtpaToken] if cookies[:LtpaToken]
OpenURI.open_uri('http://[your domino server here]/[your database]/[some page that returns the username]',
"Cookie" => tokenstring) do |http|
@current_user = http.read.strip
end
#rescue
end
end
end
end
On the domino side, you just need to create a database and then a page within the database that has a field returning @username().
This will then return the full username. If you are using QuickPlace for instance, you will get back something like "CN=user/OU=placename/OU=QP/O=certifier" and you can deal with this as you like in your ruby code.
Wednesday, June 14, 2006
Ruby Skype Bot
Here is a very simple Ruby Script that will reply to anything anyone says to you.
It requires the Skype ActiveS dll to be registered. The ActiveS site does not have the dll in the latest MSI so, I was able to download it here and make it available for people to register.
require 'win32ole'
oSkype = WIN32OLE.new('SKYPEAPI.Access')
puts "Version: #{oSkype.Version}"
oSkype.Connect()
puts "Getting events"
ev = WIN32OLE_EVENT.new(oSkype, '_IAccessEvents')
ev.on_event('ChatMessageReceived') do |msg|
to = msg.MessageFrom.Handle
puts "#{to} said: #{msg.Body}"
if to != oSkype.CurrentUserHandle
response = "OMG, I can't believe you just said '#{msg.Body}'"
oSkype.SendMessage(to, response)
end
end
# infinite loop to keep the script alive
loop do
WIN32OLE_EVENT.message_loop
end
It requires the Skype ActiveS dll to be registered. The ActiveS site does not have the dll in the latest MSI so, I was able to download it here and make it available for people to register.
Monday, June 12, 2006
Being stalked by click torrent girls

In the past few weeks, I have been in Dublin Ireland, Cork Ireland, London UK, Bad Homburg Germany, Dubai UAE, Sydney Australia and Brisbane Australia and have connected to a torrent web site in each location to catch up on my shows.
I know it is probably not the best way to get TV shows, as is shown by the quality of advertisers that support their site. However, click torrent has to take the cake here.
In each of these location, it has show the exact same girls as "in my area" that want to meet me. Same photo, same clothes, same girls - just the names and locations change. If I didn't know better, I would have thought these women are traveling around the world stalking me under different aliases. For instance, in Germany, they had German names and were staying in the same place "Bad Homburg" - a small town near Frankfurt that has one main shopping street and not much going on (sorry but the toscana pizza place is very nice mind you).
However, how dishonest can this advertising get and how ignorant do they think the male population is? These girls are not in my area, are not wanting to meet me, and have nothing to do with the shows I am downloading. I am not the biggest fan of the google adwords but at least I am not getting totally lied to in a spam like manner.
Saturday, June 10, 2006
Ruby on Rails: Open source project collaboration
ProjectLounge Lite is a ruby on rails based project collaboration tool. It has calendars, tasks list (with Gantt view), document sharing and member management. There is a hosted version at http://www.projectlounge.com and also the full source code is available for download and use under LGPL.
read more | digg story
read more | digg story
Friday, June 09, 2006
ProjectLounge Lite released to open source
It has been a few months coming, but we have finally released all our code into the glory of LGPL open source. The open access SVN repository is open and available for anonymous read access. If anyone wants to contribute code, please contact me with what you want to add.
The svn URL is svn://svn.projectlounge.com/open/light and I will be updating a project home page soon.
There is also going to be a simple one click install via the Instant Rails framework.
If all this code seems a little too much, you can see a hosted version at: http://www.pllite.com/projects/new to create your own project there. The access code is currently "pl124" but this will change to a captcha eventually.
The next few weeks will see a lot more development, so please if you are interested in contributing to an open source project that helps people get out of email and collaborate online about projects, please let me know.
The svn URL is svn://svn.projectlounge.com/open/light and I will be updating a project home page soon.
There is also going to be a simple one click install via the Instant Rails framework.
If all this code seems a little too much, you can see a hosted version at: http://www.pllite.com/projects/new to create your own project there. The access code is currently "pl124" but this will change to a captcha eventually.
The next few weeks will see a lot more development, so please if you are interested in contributing to an open source project that helps people get out of email and collaborate online about projects, please let me know.
Tuesday, June 06, 2006
Cool Tip to Beat Procrastination
A "life hack" tip for how to stop being a procrastinator. The basic idea is to just do the task for 10min to get over the procrastination urge. I will try this with my next task ... right after I read through my blogbridge :)
read more | digg story
read more | digg story
Monday, June 05, 2006
Web 2.0 Has Corporate America Spinning
The array of new tools that foster online collaboration -- and could revolutionize business and we have a blog entry here about it read more | digg story
Friday, June 02, 2006
Projectlounge has a new blog
I will be contributing to that as well as this blog. This will still remain my random thoughts and travels. However, all thoughts related to online collaboration technology will start to be posted there. The Projectlounge online collaboration blog should be interesting to those of us who don't really like email and prefer to collaboration in a real system that was designed for it.
Wednesday, May 31, 2006
To MacBook Pro or not?
Two people I trust have just taken the dive into the MacBook Pro world. Sami Shalabi and Will Raabe. They have both promised updates on their thoughts and how much they use them. Will tends to love his toys and will test out all the latest gadets I am sure. Sami is more the hard core coder and if Sami likes it, I know it will be a very good development machine (fast compiles and eclipse j2ee friendly).
If both of these people still love it in a month, then it will be almost impossible for me to resist ditching my 2 month old Dell and getting one.
If both of these people still love it in a month, then it will be almost impossible for me to resist ditching my 2 month old Dell and getting one.
Tuesday, May 30, 2006
5 countries in a week
We have arrived in Australia now and hope to stay for a while. In the last week we have been in Bad Homburg Germany, Dublin & Cork Ireland, London UK and then Dubai UEA on the way to Sydney Australia. It will be good to be a little more settled and less "homeless" for the release of ProjectLounge Lite. We go to Brisbane this weekend and hope that will be the last of the flights for a while.
Having, just complained about flights, I was really impressed with Emirates for their service. Coming back to Australia did not really feel "proper" by not getting on Qantas. However, the combination fare from travelmood could not be beat on price. The economy sector from London to Dubia was only 6 hours and I did notice the extra 2 inches leg room over BA/QF. They even give out hot towels. However, when it came to the lounge in Dubai and the Business service to Sydney I was very impressed.
If they can keep up the prices, I am not sure I would fly anything else on long hauls to Australia. They even had an espresso machine on board to get me going before landing - they really thought of everything.
Having, just complained about flights, I was really impressed with Emirates for their service. Coming back to Australia did not really feel "proper" by not getting on Qantas. However, the combination fare from travelmood could not be beat on price. The economy sector from London to Dubia was only 6 hours and I did notice the extra 2 inches leg room over BA/QF. They even give out hot towels. However, when it came to the lounge in Dubai and the Business service to Sydney I was very impressed.
If they can keep up the prices, I am not sure I would fly anything else on long hauls to Australia. They even had an espresso machine on board to get me going before landing - they really thought of everything.
Wednesday, May 17, 2006
Reporting Spam to SpamCop from Lotus Notes
Here is a very simple agent to report a select email or emails to spamcop's quick reporting service. You will need a spamcop account and access to quick reporting.
It uses a new r6 feature of lotusscript to get the received header information so that spamcop will know exactly where the email came from at each hop. This is important as they use this for their black lists so that the correct servers are blocked while the innocent receiving servers are not.
It is also important to list your allowed hosts with spamcop so that if it routes through some of your servers then these will not be treated at open relays.
Like this article? Digg it!
It uses a new r6 feature of lotusscript to get the received header information so that spamcop will know exactly where the email came from at each hop. This is important as they use this for their black lists so that the correct servers are blocked while the innocent receiving servers are not.
It is also important to list your allowed hosts with spamcop so that if it routes through some of your servers then these will not be treated at open relays.
Sub Initialize
Dim s As New notessession
Dim dc As NotesDocumentCollection
Dim db As notesdatabase
Dim doc As notesdocument
Set db = s.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
While Not(doc Is Nothing)
Dim text As String
text = ""
Forall t In doc.GetReceivedItemText
text = text + "Received: " + t + Chr(10)
End Forall
Forall it In doc.Items
If it.name <> "Received" Then
text = text + it.name + ": " + it.text + Chr (10)
End If
End Forall
Dim mail As notesdocument
Set mail = db.CreateDocument
mail.form = "memo"
mail.subject = "Spam to report"
mail.body = text
Call mail.Send(False, "spam@uce.gov")
Call mail.Send(False, "quick.[yoursecretkeyhere]@spam.spamcop.net")
'You can then save or just delete it here
doc.RemoveFromFolder("($junkmail)")
Call doc.Save(True, False)
Set doc = dc.GetNextDocument(doc)
Wend
End Sub
Like this article? Digg it!
Thursday, May 04, 2006
Rails acts_as_threaded Plugin
Left a comment on the acts_as_threaded plugin page as a warning to someone using it that wants to use proper ids for their tables.
If you end up using a guid for the table primary key and root_id, it you need to enclose the "#{self[root_column]}" with quotes. If you don't the sql will get broken by the hyphens in the id.
Otherwise, it works well even when you combine it with guid self generating 36 char ids.
Lines with root_column will change from something like this:
self.class.update_all( "#{left_col_name} = (#{left_col_name} + 2)", "#{scope_condition} AND #{root_column} = #{self[root_column]} AND #{left_col_name} >= #{right_bound}" )
to become something like this:
self.class.update_all( "#{left_col_name} = (#{left_col_name} + 2)", "#{scope_condition} AND #{root_column} = '#{self[root_column]}' AND #{left_col_name} >= #{right_bound}" )
If you end up using a guid for the table primary key and root_id, it you need to enclose the "#{self[root_column]}" with quotes. If you don't the sql will get broken by the hyphens in the id.
Otherwise, it works well even when you combine it with guid self generating 36 char ids.
Lines with root_column will change from something like this:
self.class.update_all( "#{left_col_name} = (#{left_col_name} + 2)", "#{scope_condition} AND #{root_column} = #{self[root_column]} AND #{left_col_name} >= #{right_bound}" )
to become something like this:
self.class.update_all( "#{left_col_name} = (#{left_col_name} + 2)", "#{scope_condition} AND #{root_column} = '#{self[root_column]}' AND #{left_col_name} >= #{right_bound}" )
Subscribe to:
Posts (Atom)







