• Home
  • About
  • Software

SQL Replace and Previewing your Changes

17 04 2009

Recently I had a situation where I needed to a full url to a relative url in the database. I just needed to remove the domain portion of the path, but I wanted to preview it live before I executed the query. Here’s the solution for the preview and for the actual update statement.

select replace(,’original_string’,'new_string’) from
where like ‘%the string you want to replace%’

update
set = replace(,’original_string’,'new_string’)
where like ‘%the string you want to replace%’

Date : 17 April 2009 at 15:44
Comments : No Comments »
Categories : Uncategorized
del.icio.us:SQL Replace and Previewing your Changes digg:SQL Replace and Previewing your Changes spurl:SQL Replace and Previewing your Changes wists:SQL Replace and Previewing your Changes simpy:SQL Replace and Previewing your Changes newsvine:SQL Replace and Previewing your Changes blinklist:SQL Replace and Previewing your Changes furl:SQL Replace and Previewing your Changes reddit:SQL Replace and Previewing your Changes fark:SQL Replace and Previewing your Changes blogmarks:SQL Replace and Previewing your Changes Y!:SQL Replace and Previewing your Changes smarking:SQL Replace and Previewing your Changes magnolia:SQL Replace and Previewing your Changes segnalo:SQL Replace and Previewing your Changes gifttagging:SQL Replace and Previewing your Changes

How to exclude directories when TAR-ing files

18 03 2009

zip -vr -9 httpdocs_06_20_2006.zip /home/user/domain.com/site -x
“/home/user/domain.com/site/excluded-dir/*”

tar -cvf httpdocs_06_20_2006.tar.gz /home/user/domain.com/site
–exclude “/home/user/domain.com/site/excluded-dir”

Date : 18 March 2009 at 21:26
Comments : No Comments »
Categories : Server Administration
del.icio.us:How to exclude directories when TAR-ing files  digg:How to exclude directories when TAR-ing files  spurl:How to exclude directories when TAR-ing files  wists:How to exclude directories when TAR-ing files  simpy:How to exclude directories when TAR-ing files  newsvine:How to exclude directories when TAR-ing files  blinklist:How to exclude directories when TAR-ing files  furl:How to exclude directories when TAR-ing files  reddit:How to exclude directories when TAR-ing files  fark:How to exclude directories when TAR-ing files  blogmarks:How to exclude directories when TAR-ing files  Y!:How to exclude directories when TAR-ing files  smarking:How to exclude directories when TAR-ing files  magnolia:How to exclude directories when TAR-ing files  segnalo:How to exclude directories when TAR-ing files  gifttagging:How to exclude directories when TAR-ing files

Generate an SSH Key

7 01 2009

To generate a secure public/private key pair to log in securely, and without a password (if you want).

from the command line (on your box, not logged into ftp, and replacing “username” and “yourdomain” with yours) type:

ssh-keygen -d

hit enter three times

type:
scp ~/.ssh/id_dsa.pub username@ftp.yourdomain.com:.ssh/authorized_keys2

enter password

type:
ssh username@ftp.yourdomain.com

You’re logged in!

Date : 7 January 2009 at 4:18
Comments : No Comments »
Categories : Geeky things
del.icio.us:Generate an SSH Key  digg:Generate an SSH Key  spurl:Generate an SSH Key  wists:Generate an SSH Key  simpy:Generate an SSH Key  newsvine:Generate an SSH Key  blinklist:Generate an SSH Key  furl:Generate an SSH Key  reddit:Generate an SSH Key  fark:Generate an SSH Key  blogmarks:Generate an SSH Key  Y!:Generate an SSH Key  smarking:Generate an SSH Key  magnolia:Generate an SSH Key  segnalo:Generate an SSH Key  gifttagging:Generate an SSH Key

Command Line MySQL

17 12 2008

I’ve been getting back into some Ruby on Rails stuff and had never used MySql from the command line. Here’s enough commands to be dangerous:

mysql -u root -p

show databases;

use db_name_development;

show tables;

describe users; # where users is a table name

Date : 17 December 2008 at 20:18
Comments : No Comments »
Categories : Geeky things, Ruby/Rails
del.icio.us:Command Line MySQL digg:Command Line MySQL spurl:Command Line MySQL wists:Command Line MySQL simpy:Command Line MySQL newsvine:Command Line MySQL blinklist:Command Line MySQL furl:Command Line MySQL reddit:Command Line MySQL fark:Command Line MySQL blogmarks:Command Line MySQL Y!:Command Line MySQL smarking:Command Line MySQL magnolia:Command Line MySQL segnalo:Command Line MySQL gifttagging:Command Line MySQL

Dreamhost Backup

26 11 2008

To tar and compress the folder:

tar -czvf mydomainarchive.tgz mydomain.com/

To untar and decompress the folder:
tar xvfz mydomainarchive.tgz

To backup the mysql database:
$ mysqldump -h localhost -u username -p database_name > dump_file

To restore the mysql database:
$ mysql -u username -p database < dump_file

Date : 26 November 2008 at 20:38
Comments : No Comments »
Categories : Geeky things
del.icio.us:Dreamhost Backup digg:Dreamhost Backup spurl:Dreamhost Backup wists:Dreamhost Backup simpy:Dreamhost Backup newsvine:Dreamhost Backup blinklist:Dreamhost Backup furl:Dreamhost Backup reddit:Dreamhost Backup fark:Dreamhost Backup blogmarks:Dreamhost Backup Y!:Dreamhost Backup smarking:Dreamhost Backup magnolia:Dreamhost Backup segnalo:Dreamhost Backup gifttagging:Dreamhost Backup

Debugging wsps deployed in Sharepoint through Visual Studio

23 10 2008

Compliments of Shashi…a coworker of mine…


  1. Make sure to build your solution in debug mode.
  2. Deploy the debug version wsp (located in wsp/debug folder) to Sharepoint
  3. copy the .pdb file from bin/debug folder of whatever the solution you would like to debug to clipboard
  4. open up the gac folders using – Start-> run -> %systemroot%\assembly\gac_msil
  5. Open the folder of the solution you wish to debug till you find the .dll file
  6. Copy the copied .pdb file
  7. Bring up the site
  8. In Visual studio, click on Debug -> Attach Process (make sure “Show processes in all sessions is checked”)
  9. attach 2 w3wp.exe process and click on Attach if prompted
  10. Set the breakpoints

Go back to site and try to do your activities, if your breakpoint gets hit, it will show you the VS screen and you are good to go….

Date : 23 October 2008 at 21:57
Comments : No Comments »
Categories : Ruby/Rails, SharePoint
del.icio.us:Debugging wsps deployed in Sharepoint through Visual Studio digg:Debugging wsps deployed in Sharepoint through Visual Studio spurl:Debugging wsps deployed in Sharepoint through Visual Studio wists:Debugging wsps deployed in Sharepoint through Visual Studio simpy:Debugging wsps deployed in Sharepoint through Visual Studio newsvine:Debugging wsps deployed in Sharepoint through Visual Studio blinklist:Debugging wsps deployed in Sharepoint through Visual Studio furl:Debugging wsps deployed in Sharepoint through Visual Studio reddit:Debugging wsps deployed in Sharepoint through Visual Studio fark:Debugging wsps deployed in Sharepoint through Visual Studio blogmarks:Debugging wsps deployed in Sharepoint through Visual Studio Y!:Debugging wsps deployed in Sharepoint through Visual Studio smarking:Debugging wsps deployed in Sharepoint through Visual Studio magnolia:Debugging wsps deployed in Sharepoint through Visual Studio segnalo:Debugging wsps deployed in Sharepoint through Visual Studio gifttagging:Debugging wsps deployed in Sharepoint through Visual Studio

DOS Layout Settings

30 09 2008

I think the fact that the DOS prompt is not resizable is a limitation. For a 19″ Dell LCD, the best settings that i’ve found are:

Screen Buffer Size:
Width: 155
Height: 9999

Window Size:
Width: 155
Height: 66

Seems to work well.

Date : 30 September 2008 at 16:04
Comments : No Comments »
Categories : Geeky things, General, Ruby/Rails
del.icio.us:DOS Layout Settings digg:DOS Layout Settings spurl:DOS Layout Settings wists:DOS Layout Settings simpy:DOS Layout Settings newsvine:DOS Layout Settings blinklist:DOS Layout Settings furl:DOS Layout Settings reddit:DOS Layout Settings fark:DOS Layout Settings blogmarks:DOS Layout Settings Y!:DOS Layout Settings smarking:DOS Layout Settings magnolia:DOS Layout Settings segnalo:DOS Layout Settings gifttagging:DOS Layout Settings

Kdiff = Cool Tool

21 04 2008

I just ran into a situation where I had a Ruby on Rails plugin (Substruct) that I am using for a site release a new version. One big disadvantage of plugins vs. gems in the rails world is versioning because you can modify plugin code. Anyhow, I needed to know what changes were made across the entire plugin directory structure, so that i could easily merge the changes I’ve made to the code changes that were released with the update.

Enter Kdiff, an Free, Open Source, Platform agnostic tool for comparing files and directories.

http://kdiff3.sourceforge.net/

Date : 21 April 2008 at 19:45
Comments : No Comments »
Categories : Geeky things
del.icio.us:Kdiff = Cool Tool digg:Kdiff = Cool Tool spurl:Kdiff = Cool Tool wists:Kdiff = Cool Tool simpy:Kdiff = Cool Tool newsvine:Kdiff = Cool Tool blinklist:Kdiff = Cool Tool furl:Kdiff = Cool Tool reddit:Kdiff = Cool Tool fark:Kdiff = Cool Tool blogmarks:Kdiff = Cool Tool Y!:Kdiff = Cool Tool smarking:Kdiff = Cool Tool magnolia:Kdiff = Cool Tool segnalo:Kdiff = Cool Tool gifttagging:Kdiff = Cool Tool

Allocate more memory to Eclipse

18 04 2008

C:\eclipse\eclipse.exe -clean -vargs -vmargs -Xms256m -Xmx512m -XX:MaxPermSize=128m

Date : 18 April 2008 at 14:58
Comments : No Comments »
Categories : Java
del.icio.us:Allocate more memory to Eclipse digg:Allocate more memory to Eclipse spurl:Allocate more memory to Eclipse wists:Allocate more memory to Eclipse simpy:Allocate more memory to Eclipse newsvine:Allocate more memory to Eclipse blinklist:Allocate more memory to Eclipse furl:Allocate more memory to Eclipse reddit:Allocate more memory to Eclipse fark:Allocate more memory to Eclipse blogmarks:Allocate more memory to Eclipse Y!:Allocate more memory to Eclipse smarking:Allocate more memory to Eclipse magnolia:Allocate more memory to Eclipse segnalo:Allocate more memory to Eclipse gifttagging:Allocate more memory to Eclipse

TiltViewer

21 02 2008

Every once in a while i come across a pretty sweet flash/flex application…and what makes TitleViewer really cool is that it’s free and configurable.

Overview:

http://www.airtightinteractive.com/projects/tiltviewer/ 

Demo:

http://www.airtightinteractive.com/projects/tiltviewer/app/

Date : 21 February 2008 at 18:32
Comments : No Comments »
Categories : Flash, Flex
del.icio.us:TiltViewer digg:TiltViewer spurl:TiltViewer wists:TiltViewer simpy:TiltViewer newsvine:TiltViewer blinklist:TiltViewer furl:TiltViewer reddit:TiltViewer fark:TiltViewer blogmarks:TiltViewer Y!:TiltViewer smarking:TiltViewer magnolia:TiltViewer segnalo:TiltViewer gifttagging:TiltViewer

« Previous Entries

  • Archives

    • April 2009
    • March 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • April 2008
    • February 2008
    • January 2008
    • November 2007
    • October 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox