tips

Updating Drupal quickly over ssh

Just finished updating my drupal install and its modules. Would have been a nightmare over ftp but using ssh it takes seconds:
http://drupal.org/node/297496

My bash history looked something like this (remember to backup db/site first and run update.php at the right places):

Vim Replace All Reminder

I keep forgetting this so here it is for me to remember

Replace all occurences of foo with bar in the file:

%s/foo/bar/g

Svn error: .. has unexpectedly changed special status

To solve this delete the svn:special property by doing this:

svn propdel svn:special FILETOCHANGE

You can also use svn proplist FILETOLOOKAT to see the svn properties on that file.

I had just used this script: http://arctic.org/~dean/scripts/unln to unlink but keep a copy of the symlinked file.
Seems to work quite well.

Cakephp 404 not found (The requested URL .... .xsd was not found on this server)

This happened when i had a controller called Types and a file in my webroot called types.xsd. When i turned off Multiview in my site configuration file it started working.
<Directory ....>
 
Options Indexes FollowSymLinks MultiView
 
</Directory>
I just removed the MultView option for now.

Ubuntu One Music not syncing (Queued)

I just bought an album from the Ubuntu One album store. It was very quick and easy to buy but as with many things, once you have handed over the money it got alot worse. Basically the music was 'in my cloud' but it wouldn't sync to my local machine...
Ubuntu has status page
Which linked to a bug report
Which said to open Applicaitons->Accessories->Terminal and run:
 touch ~/.ubuntuone/Purchased\ from\ Ubuntu\ One/placeholder; u1sdtool -q; u1sdtool -c
This will put a "placeholder" file in your ~/.ubuntuone/Purchased from Ubuntu One/ folder and then force the syncdaemon to reconnect and try to sync that folder.

ExtJS ext.data.jsonwriter and cakephp

Just spent quite abit of time getting an EditorGrid properly creating and updating rows automagically using Ext Writer. Except it wasn't so magical.
Notes:
- Create requires success: true and then the created record (including the id).
Use this snippet:
echo '{"success":'.$success.', results:'.$javascript->Object($record).'}';
in the above results should be whatever your roots property is in your store reader config. For example:
                reader: new Ext.data.JsonReader({
                        totalProperty: 'total',
                        successProperty: 'success',
                        root: 'results',
                        idProperty: 'id', etc
Example of working create json string:
{"success":true, results:{"id":"47","jobId":"47","jobType":"7",
"partName":"0101012","partDescription":"3.0 Metre Crossover Network Cable",
"quantity":"1","price":"3.5"}}
Example of working update json string:
{success:true, id:11}
After an update you can use $this->MODELNAME->id to get the id for the json.
Destroy just needs
{success:true}
Read example (all records for grid):
{"total":2, "results":[{"id":"46","jobId":"47","jobType":"7",
"partName":"0101104","partDescription":"Dual Back Box","quantity":"1","price":"4.26"},{"id":"47","jobId":"47","jobType":"7",
"partName":"0101012","partDescription":"3.0 Metre Crossover Network Cable","quantity":"1","price":"3.5"}]}

SVN Ignore Folder

svn propset svn:ignore FOLDERNAME .

^^ Note the dot!

More info here

http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/

Mysql - dump and load

You can dump the database into a file using: 
 
  mysqldump -h hostname -u user --password=password databasename > filename 
 
you can restore the info to the database again using: 
 
  mysql -h hostname -u user --password=password databasename < filename

from: http://forums.mysql.com/read.php?10,195091,195097

Microsoft Activesync Test tools

Web based (microsoft) tool: https://www.testexchangeconnectivity.com/

Downloadable program: https://store.accessmylan.com/main/diagnostic-tools

If you are having problems getting an Iphone to sync to Exchange 2003 read this:

http://www.it-eye.co.uk/faqs/readQuestion.php?qid=1

I had major problems with a SBS 2003 setup and the above all helped.

 

 

Syndicate content