This is my personal knowledge base - a place to hold all the things I know (or need, or want, to know) and am likely to forget.
By making it public, I hope to:
The biggest challenge, at least in the short term, is developing the discipline to come here with everything I learn, and everything I want to learn.
And, in the short term, with my current obsession/compulsion being catching up with the Drupal community, it will disproportionately reflect that project.
Note that not everything here represents firm knowledge - research projects (things I'm learning about) will appear here, dynamically updated as I refine my understanding...
Thanks for your contributions.
My knowledge about Drupal development and administration is documented here. In the short term, my investigations of the best development environment (source code editor/IDE, file system layout, CVS/SVN setup, etc.) for my work style will be the focus. Input is, of course, welcome.
Recipes for particular tasks when doing Drupal development.
Resources:
Quick-and-dirty CCK imports (Lullabot)
Creating a node programmatically
drupal_execute and svaing a node?
Here's the reference: http://drupal.org/node/101092
Will report back on my experience...
I'm transitioning from Windows to Mac, and still working at establishing the best development environment for my needs. What tools am I most comfortable with? I'm trying TextMate at the moment, based on several recommendations - will probably make another stab at Eclipse (too much memory-wise for my old Windows PC) as well. I also will be documenting my experiences with helpful modules like devel and coder, approaches to managing revision control (CVS/SVN), synchronizing production/test/development sites, etc.
Starting point: Developing for Drupal in the handbook at drupal.org.
References:
How to Successfully Incorporate Eclipse IDE into a Drupal Workflow
Maintaining Drupal sites using version control
Now trying Eclipse as my Drupal development environment... Starting with Rob Loach's approach:
Maintaining my Drupal sites, both development sites on my computer and production sites on my webhost. Use of CVS & SVN, copying back-and-forth, etc....
As a first step, I simply want to use SVN to track changes in my local development environment. Simple step-by-step instructions are lacking on drupal.org, but Nick Sergeant's blog got me started:
References:
Nick Sergeant :: Blog - Painless Drupal revision control with CVS and Subversion on a sharedhost
Note: I did set up a repository and do an initial commit, but right now I'm more inclined to leave it to Time Machine...
Tips on using Komodo for Drupal development.
There are currently issues with using both CVS (for updating/committing from/to drupal.org) and SVN (for maintaining local history). Track:
Handy functions for parsing and formatting Javascript dates:
http://www.xaprb.com/blog/2005/12/20/javascript-date-parsing/
I'm doing my first project using PostgreSQL (I've always used MySQL in the past). Hints, tips, etc.:
First, I found a Mac OS X binary. At this writing the version of PostgreSQL is 8.2.3. The instructions say it is only tested on Mac OS X 10.4 (Tiger), but it works fine for me on 10.5 (Leopard).
To access a database from a shell:
psql -U username -h localhost -d databasename
To export a database to SQL, for loading onto another pgsql server:
pg_dump -C -O -h localhost -U username databasename >filename
To import from an export performed as above (I expected to use pg_restore, but no...)
psql -h localhost -U username -f filename
Finally getting back to working on the old browscap module, and needed to ape a particular browser string. I found this article on configuring Safari and Firefox to accomplish this:
Spoofing the User Agent with Safari or Firefox
So, first I do the command using Safari's actual browser string, so I can easily revert to it later:
defaults write com.apple.Safari CustomUserAgent "\"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18\""
... or, How I Learned to Stop Worrying and Love the 'Net...
<to be fleshed out later... Basic idea - all the information in my life - financial, technical, personal - that would otherwise be on my computer or on paper should be out on the net. Tradeoffs - security risks (server intrusions on the net, physical intrusions in real life), integrity risks (net info presumably backed up, risk of businesses running the server going out of business - vs. risk of my own computer crashing, home burning down, etc.), convenience (info on net searchable, can be organized more flexibly - real-world info is literally at fingertips, not vulnerable to lost connections)...>
I'm transitioning from Windows to Mac OS X - as I learn how to best make use of the new environment, I'll drop hints & tips here.
I needed to establish backups. I have a 300GB external hard drive - but it was formatted with NTFS (thus unwritable by Mac OS X), and it contained many, many GB of music files. I had already imported the MP3s into iTunes on my MacBook, but Sarah has been using the external drive to sync her MP3 player through her Windows laptop (using MediaMonkey, a much better music library manager than iTunes, but which unfortunately won't sync to my iPhone). It would also be good to make it easy for her to backup to the external drive as well, and there's a file or two we'd like to share. The initial plan was to reformat as FAT32 and pass the USB cable back-and-forth, but FAT32 can only handle up to a 127GB partition. So, the plan changed to semi-permanently mounting the external drive on my MacBook - and, while I'm at it, sharing the music files directly from my iTunes Library rather than having them duplicated on the external drive (particularly since Time Machine is backing them up there anyway).
Note we have cable Internet through a wireless router, both computers link to the router directly.
So, the whole process - at least as best as I can reconstruct what I would have done if I'd known what I was doing, instead of struggling through trial-and-error-and-semi-helpful-forum-posts...
Now, at this point it turns out the alias to my iTunes folder (created in Finder with Make Alias) shows up on the Windows side as a 0kb file instead of a folder. Going to the shell, ls -l shows the attributes as -rw----r--@ (@ indicating extended attributes). I created a symbolic link from the shell (resulting attributes lrwxr-xr-x) - that seemed to do the trick.
Next, see about sharing the printer...
Having some file permission trouble on my MacBook - files that I cannot edit/mv/etc. although I own them and permissions are 755... So, how about good ol' su?
How to Enable the "root" account on Mac OS X
The Quick CLI Method (sudo passwd root) worked fine for allowing me to su - but the root account can't seem to do anything to these files either...
To more fully describe - I have installed MAMP, and under its htdocs directory I have the roots of my local (Drupal) websites. Pretty much everything has 755 permission (rwxr-xr-x), is owned by my account which has administrative permission, and is in the staff group. I can do what I want with files in, say, /Applications/MAMP/htdocs/pathauto6 - but trying to edit and save, or rename (mv), or chgrp, or chown files in /Applications/MAMP/htdocs/pathauto6/sites/default fails with "Operation not permitted". The root account has no more luck than my own account. What's up with that?
Well, I'll tell you - the "immutable" flag was set on the folder (default). This seems to be an obscure, under-documented Mac OS X feature that overrides normal file permissions. If I'd never heard of it before (and I wasted a ridiculous amount of time tracking it down), how did it happen? My best guess is it has something to do with copying files from an NTFS-formatted external drive, which I used to transfer files from my old Windows system to my new MacBook - perhaps Windows read-only permissions get translated to the immutable flag when copying?
Full filesystem in Finder/Time Machine
The Mac OS X Finder by default only shows stuff regular people need to see - it doesn't show the entire filesystem. Time Machine follows Finder - which means that, although Time Machine backs up everything, you can't see and restore... oh, let's say /usr/local/pgsql/data. To make the entire filesystem visible under Macintosh HD, you need to go to the shell and say
defaults write NSGlobalDomain AppleShowAllFiles YES
Then, of course, reboot.
I'm going to have to find some time to track down what other neat things can be done with that defaults command. And, how to hide the extra stuff now showing on the desktop.
Disable .DS_Store files on network drives
Mac OS X drops little .DS_Store files in every folder you visit, including network drives. It can't be stopped locally, but to at least be more polite about other people's drives:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Developing on my MacBook, with the MAMP stack installed, attempts by any of my local Drupal sites to send email out to a Drupal user (say, a new account notification) go into the local mail queue and get stuck there. /var/log/mail.log shows "Operation timed out" errors from Postfix, whether sending to an account on my webhost or my Gmail account. telnet to port 25 (using a couple different hosts) also fails with "Operation timed out".
And... now I feel like an idiot, because I had this problem a few years ago with Comcast - my ISP (now RCN) is blocking port 25. Solution:
Took a few tries with telnet [mail|smtp].rcn.[com|net] 25 to find the right server, but I'm all set now...
Everything was just fine on my way home last night - earbuds in, music flowing, phone call clear as a bell... But last night I tried making a couple of phone calls from home - no sound of ringing, no audio in (or out, so I was told) until I put the call into speaker mode. Panic! But Googling "iPhone sound" turned up the answer quickly - plug in the earphones and unplug them again. Apparently it sometimes misses that you've unplugged the earphones.