Tuesday, September 6, 2011

Here some tools that can be useful to performance test your AJAX web application

Everything on the internet change so fast, I'm sure the minute I will post this other better tools may show up, but for 9/2011, those tools may help you out finding performance issues on your AJAX web application.

  • Chrome Developer Tools - Chrome Developer Tools is a Chrome browser plugin that allows inspection of the DOM tree, HTML, CSS, request timeline, JavaScript execution, and has many other fine features.
  • Firebug - Firebug is a Firefox browser plugin that provides much of the same functionality as the Chrome Developer Tools.
  • FireCookie - FireCookie is a plugin to Firebug that allows detailed inspection of browser cookies.
  • Page Speed - Page Speed is a plugin for Chrome and Firefox browsers that provides detailed analysis and recommendations around Web 1.0 best practices.
  • YSlow - YSlow is a plugin for Chrome and Firefox browsers that provides detailed analysis and recommendations around Web 1.0 best practices. In spite of significant overlap, we tested with Page Speed and YSlow, because they provide different perspectives and, in certain cases, different opinions.
  • Speed Tracer - Speed Tracer is a Chrome browser plugin that analyzes JavaScript execution and AJAX operations.
  • Fiddler - Fiddler is an HTTP sniffer that provides detailed information about every request and response that goes through the network.
Have fun...

Tuesday, June 1, 2010

How to fix a corrupted Outlook meeting reminders

I had one of my meeting reminders that just would not go away, causing my iPhone to quickly run out of batterie... I tried to go in the webmail server and remove that meeting and no luck, it keep coming back... Here what my IT dep told me to do and it did fix the issue:

The easiest way to try to get rid of corrupt reminders is by closing Outlook and reopening it using the /cleanreminders switch. To do this, press Windows key + R to open the Run dialog. Then type: outlook /cleanreminders in the field and press Ok. Make sure there is a space between outlook and the /

I believe our Exchange Server is 2005, and I had this issue with Outlook 2007 & Outlook 2005...


Wednesday, May 27, 2009

How to backup your computer online (Mac or Windows)

After looking around for a good way to backup my data outside of my house, I found Mozy.com, the price if reasonable and it's super easy to use on Mac or Windows. You get 2GB free of charge so you can give it a try without having to spend any money. I setup a free account for my wife computer, backing up all of her Microsoft office documents and few folders. If you like to give it a try click on this link: https://mozy.com/?ref=HW5U9L this will give my wife an extra 256MB to her account ;-) Mozy charge 4.95$/month for unlimited data, if you sing up make sure you don't push all of your data on the same month, well assuming you have more data to backup then your bandwidth cap from your internet provider, they pretty much all have one now. I'm with Comcast and my cap is 200GB per months... Regardless of the cap, it may take you few weeks or even months to upload all of this data to mozy... I have a pretty good upload speed of ~250kb/sec and Mozy is telling me it will take me around 5 to 10 days to upload 100GB

I also looked at Amazon s3, http://aws.amazon.com/s3/, very cool stuff, I use it for work, but you paid $0.15 per GB / month. 100GB would cost me 15$ per month plus I would have to paid for the Data Transfer $0.17 per GB transferred... so Mozy definitely beat this...

The last one I looked at was DropBox (http://www.getdropbox.com/pricing) This is more like a share folder that get sync up on the internet. Could be useful if you have multiple computer, that dropbox folder will get replicated between all of your computers that is setup with your DropBox folder... You can't do this with Mozy... Still more expensive, 10$ per months for 50GB

One more thing about Mozy, Mozy charges $4.95 per computer that is running the software, but you are allow to backup mounted drive, so you can mount the drives of all your computers and back them up, the way it work, is if a file is no longer on your computer for over 30 days or if you have not mapped the drive for 30 days, they delete it from the mozy server.

If you find something better, please let me know

Friday, October 3, 2008

How to map s3fs drive on an EC2 ubuntu server

Install the appropriate libraries

apt-get update 
apt-get -y install libfuse-dev libfuse2 libc6-dev make pkg-config gcc build-essential libcurl3-dev libxml2-dev libfuse-dev

Download the packages

mkdir –p /mnt/work/downloads  
cd /mnt/work/downloads  
wget http://downloads.sourceforge.net/fuse/fuse-2.8.0-pre1.tar.gz?modtime=1215728006&big_mirror=0  
wget http://s3fs.googlecode.com/files/s3fs-r177-source.tar.gz

Install fuse

cd /mnt/work  
tar xfz downloads/fuse-2.8.0-pre1.tar.gz   
cd /mnt/work/fuse-2.8.0-pre1/  
make install

Install s3fs

cd /mnt/work   
tar xfz downloads/s3fs-r177-source.tar.gz
cd /mnt/work/s3fs/   
make install

Link the fusermount to /usr/sbin (for rc.local purposes)

ln –s /usr/local/bin/fusermount /usr/bin/fusermount

Mounting your s3 folder

This assume that you have the folder /myfolder in your s3 account.

mkdir -p /mnt/s3buckets/myfolder 
s3fs -o allow_other myfolder /mnt/s3buckets/myfolder/ -o use_cache=/tmp/s3fs_cache -o accessKeyId=YOURACCESSKEYID -o secretAccessKey=YOURSECRETACCESSKEY
Note: If you trust your server and the users that has access to your /etc, you can create a file /etc/passwd-s3fs which contains just your Amazon ID and secret key separated by ":", e.g: YOURACCESSKEYID:YOURSECRETACCESSKEY). Next you can add the mount cmd into your rc.local file... everytime you boot you will see the mount s3 folder...

Tuesday, March 18, 2008

How to create a Linked Server to hitseft (Microsfoft Server 2005)

You can find good information here (http://msdn2.microsoft.com/en-us/library/aa259589(SQL.80).aspx)

Under, Object Explorer of (Microsfoft SQL Server Management Studio) go to:
Server Objects - Linked Servers
Right click on Linked Servers and select - New Linked Server...

My situation is very simple, I have multiple server with 2 databases, some of the database are replicated to the other server. I have a store proc that need to be call the same way on both server, but one of my server host the replicated copy (read only) of my db so the sp need to write to the other one. That need to work the same way on both server

MYLINKSERVERNAME.myDBName.dbo.my_store_prod_name NULL, 'Tester', ' HELLO WORLD '

Server_A and Server_B both contain the link server name: MYLINKSERVERNAME, and both links, point to Server_A.

Tuesday, February 5, 2008

Join SQL Update


Don't know about you but I've wondered on occasion whether or not it's possible to do a join update in Oracle and SQL Server as I've seen done in mySQL. For those who've never seen an update join, here's one to illustrate:

Old school:
update invc_item
set feed_id =
(select max(feed_id)
from calls
where invc_item_id = invc_item.invc_item_id)
where feed_id = 0
and exists
(select *
from calls
where invc_item_id = invc_item.invc_item_id
and feed_id > 0)

As you can see in the example, this SQL re-queries calls twice - once for the update and once for the where.

Update join:
update i
set i.feed_id = c.feed_id
from invc_item i, calls c
where i.feed_id = 0
and c.invc_item_id = i.invc_item_id
and c.feed_id > 0

Much simpler, far more efficient, and once you get the hang of it - less prone to error when doing these sorts of updates.

I'm not sure whether or not you have to use the table aliases as I did. Haven't tested without. This is how it was illustrated in the documentation I found.

Now for the bad news... SQL Server (the toy wannabe database) supports it, Oracle does not.

Thanks for the help Scott...

Thursday, January 24, 2008

How to protect my PC, Free virus scan

Desktop support is not what I like to do, too many of my friend would like me to go clean up thier PC. No way I'm not going to be spending hours cleaning somebody else's PC. I usually answer to my friends; sorry I'm a mac/linux guy. We don't really get virus...

Anyway I saw an article today: How to take better care of your PC in '08

Here what you need to know:

Free options exist, such as AVG Anti-Virus Free Edition (free.grisoft.com) and Ad-Aware 2007 (http://www.lavasoftusa.com/), but many users choose more robust pay-for-use programs, like Sympatico Security Services ($6/month), Norton Anti-Virus 2008 (http://www.symantec.ca/; $39.99), Windows Live OneCare (http://www.microsoft.ca/; $39.99) or McAfee VirusScan Plus(http://www.mcafee.com/; $39.99).

and keep your windows up-to-date with all Microsoft patches.

I hope this help, and please don't ask me to fix your PC :-) Imagine if I was asking you to come pick up to 4 weeks of 2 dogs pup in my back yard when it's 8 F outside. (I'm having one of those day today, and it's only 7:30 AM :-(...)

Tuesday, April 24, 2007

How to know what table is linking to the row you are trying to delete

You are trying to delete a row in a table but b/c of the db constraint you can't, here how to find out what table is causing the issue.

In oracle you would get an error like this:
ORA-02292: integrity constraint (TESTDB.FK_REF_114571) violated - child record found

select * from user_constraints where constraint_name = 'FK_REF_114571'

select * from INFORMATION_SCHEMA.constraint_column_usage
where constraint_name = 'FK_REF_114571'

Friday, March 30, 2007

How to copy data between 2 different Oracle or MSSQL database

Well what if you did not do a backup of your data and you deleted the wrong stuff. Import your backup database on the same server. Login with a user that have access to both DB, system should work.
Oracle to Oracle:
insert into productiondb.bill_detail select * from backupdb.bill_detail
where not exists
(select *
from productiondb.bill_detail
where bill_id = backupdb.bill_detail.bill_id)
This query will copy everything that is missing back into the production DB.

Here's how I populated nd_loc and it took only 10 or so seconds to copy ~150,000 rows! First connect to the production db and then create the link to the backup server. By running the command "sp_addlinkedserver sqldev" (where sqldev is the other server name where the backup db is. You don't have to do this if both db are on the same server)

insert into nd_loc select * from sqldev.backupdb.dbo.nd_loc

Now why can't their damned odbc driver be that fast? (Thanks Scott for the tips)

How to create a table from a select statement

Ready to make a big update, before you do make a backup of that data into a temp table with a select. This save me few times.
create table tmp_eric as 
( select * from ... where ... )

Each columns returned from the select will become the columns of the new table tmp_eric.

For MSSQL, you need to first create the table then you can use the insert

create table tmp_eric (col1, INTEGER PRIMARY KEY, col2...)

insert into tmp_eric (col1, col2,...)
select col1, col2,... from eric

You can also use:

select * into tmp_eric from eric

Saturday, March 17, 2007

How to make Final Cut work on pre-AGP older Macs

I could not get my Final Cut Express v2 working on my iMac G5 until I found this info, and now it's working like a charm. ;-)

(from the June 26th, 2003 www.xlr8yourmac.com news page)
A reader sent a note on a link with info/workaround for installing Final Cut Pro 4 on an older Mac:
" Mike, Found the hack for FCP 4 on a non-AGP Mac. I'm attaching text file but I'm also sending you the 2-pop link where I got the info from. Please don't attribute this to me. #1) I didn't figure it out. #2) I think Apple doesn't like me sometimes. We're definitely getting a Dual G5, though. This is the Mac we've all been waiting. In the meantime though, this hack works perfectly. ENJOY! Here's the 2-pop link." (Note - that link gets a 404/not found today so here is a copy of the attached info he sent on the patch) "I didn't see this posted anywhere. I have a Blue and White G3 that I upgraded to a G4 500. I didn't realize that FCP4 didn't work with PCI macs until I launched it and was given the message: no AGP card on your machine.
I was able to get around this and have been editing happily since.

• Control-Click on the Final Cut Pro application and select show package contents.
• Open the contents folder and open info.plist.
• Search for AGP replace it with PCI.
• Save and close the file.
• Open FCP4, and voila it works.

I have 684 mb of ram. My playback is smooth, rendering is pretty fast. I have yet to encounter a scenario where it doesn't work

How to connect to your Tivo Dvr Serie 2 with your web browser

## First figure out the IP of your DVR then just add https:// in front (notice the s)

login: tivo
password: your Media Access Key

The best transfer rate I get is around 600 KB/sec, it take for ever to download those 1-2 GB files...

How to copy files using tar without a tar file / How to tar and untar without a tar file.

# why do this, well tar keep the ownership and permission of the files
# where cp -r will make everything own by the user doing the copy.

(cd / ; tar cf - home) | (cd /newhome; tar xvf -)

How to partition/format a disk under linux

# first use fdisk to setup your partition, for more info on fdisk, type man fdisk
fdisk /dev/hda

# Now that you partitioned your disk let's format it (man mke2fs)
mke2fs /dev/hda1 <--- you have to do this for each partition you created, just replace 1 for partition #

How to mount a webdav share with a comand line

## Here is the command I use to mount a test webDav share on my Mac OS X / unix

/sbin/mount_webdav -o noautomounted -o browse -a15 -vmyfotoz http://localhost:8080/ /Volumes/myfotoz/

How to rsync data from one UNIX server to an other

## Like lots of people I have lots of pictures online, 36 GB... I don't want to lose those preciouses ## memories, so I setup a cron to rsync my data every weeks. The beauty of rsync is that it won't ## copy what's has not change. For more info on rsync just type: man rsync

cd /backup/
rsync -rlptgov root@thibeault.cc:/path/to/my/photos/on/thibeault/cc/ photos/

## here if you like to snoop around my photo Album.

How to mount an iso on Linux

# First image
mount -t iso9660 -o ro,loop=/dev/loop0 FIRST_TRIP.iso /mnt

# Second image (make sure mnt2 exist)
mount -t iso9660 -o ro,loop=/dev/loop1 LAST_TRIP.iso /mnt2

How to create an iso image on linux (dd/mkisofs)

# How to create the content of a directory into an iso image
## if you mount an unprotected DVD under /dev/disk2/
## Here how you can make an iso file from it.

dd if=/dev/disk2 of=FIRST_TRIP.iso bs=256k


cd /dev/disk2
mkisofs -r -o ~/FIRST_TRIP.iso .

Friday, March 16, 2007

How to Batch Uppercase/lowercase file/directory

## under tcsh shell

# make the directory lowercase...
foreach f ( `find . -type d -print ` )
mv $f `echo $f | tr A-Z a-z`

# make the file lowercase...
foreach f ( `find . -type f -print ` )
mv $f `echo $f | tr A-Z a-z`

How to Batch Change file names under tcsh

## example: for each file ending by .jpg, replace any spaces with underscores

foreach i (*.jpg*)
echo $i > /tmp/nom
set j=`sed -e '1,$s? ?_?g' /tmp/nom`
mv "$i" "$j"
\rm /tmp/nom