September 2005
Monthly Archive
Tue 13 Sep 2005
A quick post to note the changes made to the interoperability site, changes still left to do, and to keep this blog fresh! The interoperability site is located at http://interoperability.ucsd.edu.
Changes Made
- Tabs
- Reshuffled nav tabs: Home, Project, People, Publications, Activities, Links, Tools
- Nixed Resources tab. The former sub-pages under Resources were Publications and Links. Those now have their own tabs.
- Moved Blog and Files under newly created Tools tab.
- Sidebar
- Removed block from sidebar (e.g. Stuff, Menu, etc.).
- Added green background color: #618c65
- Breadcrumbs
- Added bottom padding, gives more space to ease viewing.
- Adder underlines to hyperlinks, underlines removed when hovering.
- Images
- New background images behind main content: silver->green with drop shadow, colors used to distinguish columns
- Moved logos to directly under main content in left column. Overlayed white background on silver in Photoshop to give transparent effect.
- To finish drop shadow effect, added background images in footer and used a “corner” element so that shadow wouldn’t stretch entire width of the wrapper
- Borders
- Changed border color of block from green to silver: #ccc
- Added silver border underneath breadcrumbs.
Changes To Do
- Add photo gallery/random photo viewer on sidebar for all pages.
- Integrated authentication for private and tools pages.
- Email-by-post and email notifications for blog.
As always, I created before and after snapshots of the interoperability site, shown here. The Before shot shows the site how it looked under the Xoops CMS. The After shot shows how it looks today.
Subversion Notes
I had issues with subversion when updating the working site. Somewhere or somehow, I changed/added/deleted a file from the dev site, and failed to mimic the action with the proper svn add, svn delete, svn move, svn copy commands. The file in question is 05LTER_NetworkNews_spring.pdf. Subversion stopped updating the working site when it reached this file, complaining that this file was already added in the repository? (I don’t have the exact error msg at this point. I will post it as soon as I re-see the problem). Regardless, I ended up abandoning Subversion temporarily and used a cp -r dir1 dir2 to copy the code from the dev site to the working site. I will go back when I have time to address the issue with Subversion. It’s probably something really simple, so I’m not too worried about it.
This issue made me think about how we should use Subversion. It is designed mainly versioning code. Yet, if we throw an entire website into a repository, we end up versioning all sorts of files, including images and binaries (docs, pdfs, etc.). Must all these be versioned?
Perhaps we should recognize what files should be stored in Subversion for certain projects.
For web sites, it is good practice to store html, php, css, javascript, sql, perl, and any other related web-scripting or programming files. I would also store basic image files used for presentation purposes (background images, bullets, etc.), as these are seen as part of the project. However, docs do not really need to be stored in Subversion. They should be managed by separately, particularly since they are peripheral items to me, the developer, and are not part of a web-programming project from my point of view.
It may be a poor practice to segragate code files from doc files, as this creates a parallel workflow to consider when updating a site. However, the doc files typically remain dormant, and are only editted and tracked by other users. Their only relation to the code are the anchors that link back to them. Keeping these files outside of Subversion frees me from issuing the svn * commands each and every time a file is added or removed to the project. An added benefit is the prevention of wasted space in the repository that is otherwise eaten by very large files. If having a parallel workflow is the consequence of preventing complications elsewhere in the workflow, I’ll take it. I am figuratively picking the less deadly poison… at least I’d like to think so anyway!
One more note about storing config files in Subversion. Particularly with web applications, the config file is specific to the web app path, and other factors (dev vs. working databases). Thus, a config file is the only code file that should “not” be included in the repository, as any update could potentially overwrite the local config file. One workaround (something I see with many open-source projects) is to create a distribution config file, something like: config_dist.php. When checking out code for the first time, you would then copy this file to config.php and add the appropiate settings as dictated by your file path and database. Using this method, config.php is safe from being overridden by Subversion, yet you can still recieve up-to-date changes to config_dist.php, should there be any.
WordPress Note
I wrote this post in Firefox, which uses Javascript to provide an HTML Quicktags bar on top the text area window. This helps with some html generation. From my experience here, it’s not as much a time-saver as I thought it would be, because it’s just as cumbersome to click the tags on top as it is to type them in manually. Most entries won’t contain html anyway, and those that do use only simple html tags (lists, bold, italic, etc.). Thus, Safari is fine to write/edit posts, even though it lacks some extra editting quirks seen in other browsers.
Thu 8 Sep 2005
Posted by srhaber under
ToolsNo Comments
I upgraded our working version of PhpMyAdmin today. Our previous version was 2.6.0-pl2, released on Oct. 12, 2004. Our new version is 2.6.4-rc1, released on Aug. 28, 2005 as a Release Candidate. The new version is installed at the same url: http://oceaninformatics.ucsd.edu/phpmyadmin. I removed (archived outside the web root) the old version since we should no longer use it. You need a mysql login/pass to login. Talk to Jerry if you don’t have one.
(Note: I changed the authentication scheme from http-based to cookie-based… don’t worry if you don’t know what this means).
There are many major UI improvements which should be useful for db administration work. In addition, I discovered a number of cool features that ship with PhpMyAdmin, but are not available by default; they require additional configuration steps.
These features include:
1. Foreign key enforcement and visualization through query/edit/insert interface.
2. Bookmarking reusable queries
3. Maintaining history of recent queries
4. Creating database dictionaries and schema diagrams as PDFs
Foreign Key Enforcement
Though MySQL now includes support for foreign keys/relations, it is difficult to model these relations in an application interface or on the mysql command line. For example, if you want to insert a new record that has a foreign key, you need to look in the referenced table to make sure you use a valid value for the foreign key. However, using PhpMyAdmin, you can choose a value from a drop-down list maintaining foreign key integrity. This feature is extremely useful for relational database work because it removes the burden from the administrator of looking up foreign keys.
Bookmarking Reusable Queries
PhpMyAdmin lets you bookmark common queries, so you don’t have to type them out each time. In addition, you can pass in a variable to a bookmarked query, which is useful for singling out specific records with the WHERE clause.
History of Recent Queries
PhpMyAdmin tracks the history of recent queries, making it easy to go back and reuse a query, even if you didn’t bookmark it.
Database Dictionaries and Schema Diagrams
You can export a Database Dictionary as a PDF. The dicitionary contains the structure, comments, etc. for each table in the database. Furthermore, PhpMyAdmin creates schema diagrams… and they look snazzier than DBDesigner4!
View the differences here.
I think I may start using PhpMyAdmin to model my schema diagrams, an ironic choice considering I spent the last couple days working with DBDesigner4 and related X11 forwarding issues. However, it is best to keep both apps in consideration for making schema diagrams, as each application has its own strengths. PhpMyAdmin produces clean and colorful diagrams, whereas DBDesigner4 gives you better visual feedback when laying out tables.
These additional features should be highly beneficial to our database workflow and productivity. I decided to upgrade our version after reading these articles.
I didn’t really go into specifics here, such as exactly how to bookmark a query or create a schema diagram. I can save these topics for later posts, or answer them in the comments section.
Thu 8 Sep 2005
Posted by kbaker under
Hints[4] Comments
a VPN (Virtual Private Network) is available at UCSD for off campus users to make use of UCSD services through use of an encrypted tunnel
(see http://www-no.ucsd.edu/documentation/vpn/)
It enables
-UCSD privileged library work
-remote disk mounts (ie to iocean)
-running remote applications, ie run matlab
Lessons learned recently about using VPN
-cannot make use of vpn if wired at UCSD, ie go wireless to test
-as a first line of action if have vpn errors or vpn is nonfunctioning,
open a browser window to force re authentication
-if you upgrade tiger, you need to upgrade VPN (ie to vpn4.7 aug05)
Download and documentation
-download and configure VPN client to your mac from
http://www-ono.ucsd.edu/documentation/vpn/mac/47/index.html
-where general ucsd acs network documentation is at
http://www-no.ucsd.edu/documentation/index.html
Related settings:
-home: cable modum router assigns IP address
-mac: apple: preferences: network; tab: build-in ethernet; tcip: using dhcp
Wed 7 Sep 2005
Posted by srhaber under
Tools1 Comment
DBDesigner4 loads fine on the PC Laptop, but it cannot connect to mysql on iocean. It gives the error message:
“Connection to database failed.
dbExpress Error: Invalid Username/Password”
I know for fact the username/password I am supplying are valid. They work fine from other remote areas, including the DBDesigner4 installation on the Linux server.
There is a documented issue about DBDesigner4 being incompatable with MySQL 4.1 or higher, and a password workaround is needed. This, however, does not apply to us.
After tinkering with the issue for a while yesterday, I’ve about run out of options, and I’m ready to forfeit any attempts to use DBDesigner4 on the PC. My initial interest was that DBDesigner4 would run faster on the PC than through the X11 forwarding/ssh connection because it is a desktop application. However, with the discovery of the -Y argument to enable “trusted X11 forwarding”, my interest in using the PC is now moot. From the Linux server, I can now run DBDesigner just as quickly on various remote systems, all while using the server as a central repository for schema files and images.
If we happen to stumble across a solution or workaround for DBDesigner4 on the PC, or if an upgraded version of DBDesigner is released, we can re-investigate using the application on the PC. Until then, I feel it is a waste of time to actively pursue a fix, especially considering the working instance of DBDesigner4 on Linux.
Wed 7 Sep 2005
Posted by srhaber under
HintsNo Comments
In my last post, I talked about reconfiguring the /etc/ssh_config file to enable X11 Forwarding over an ssh connection. It turns out this step is unnecessary in Tiger. Instead, you can provide the “-Y” argument to the ssh command, which enables “trusted X11 forwarding”.
> ssh -Y hostname
I learned this the hard way. After I reconfigured my /etc/ssh_config file to enable X11 forwarding, I was indeed able to successfully load DBDesigner over the network (ssh connection with no args). However, I was unable to work with ER diagrams within the DBDesigner interface. The tables would disappear from the screen when I tried to drag them around, and the program ran very very slow.
I tested this process on a separate machine (PowerBook) running Panther. DBDesigner loaded and worked fine, although still a bit sluggish. This had me convinced there was a compatability issue with X11/ssh and Tiger. I searched in Google and found this thread (among others) which mentions the new -Y arg introduced to ssh in Tiger.
Note: The -X argument enables X11 Forwarding over ssh. Using this argument also makes it unnecessary to change the /etc/ssh_config in Panther.
Tue 6 Sep 2005
Posted by srhaber under
HintsNo Comments
After upgrading to Tiger, I had to reconfigure my system to enable X11 forwarding (so I could use DBDesigner over the network). To enable X11 Forwarding, open /etc/ssh_config (you need root privs). Change “Forward X11 no” to “Forward X11 yes”, and remove the pound sign from the beginning of the line.
One other Unix hint:
To refer to the last argument from your last command, type !$.
To refer to all args from the last command, type !*.
To refer to the nth arg from the last command, type !:n, where n is the arg number.
I pulled these refs from here.
**UPDATE - srhaber 9/7 **
I discovered it is not necessary to change the /etc/ssh_config file at all (which is great if you lack sudo privs). If running Panther, use the -X argument when establishing the ssh connection:
> ssh -X hostname
In Tiger, use the -Y arg:
> ssh -Y hostname
The -X argument enables X11 Forwarding, and is available to ssh in both Panther and Tiger. The -Y argument enables “Trusted X11 Forwarding” and is only to available to ssh in Tiger.
Tue 6 Sep 2005
Posted by srhaber under
Tools[2] Comments
You can write private posts on WordPress, meaning only you can read/edit it. Not even the site admin can view them. (Note: The posts are still readable from the database, however, so don’t get too personal!).
Private posts are useful for capturing information that should be kept hidden from the public. For example, I just wrote my first private post about authentication changes made to the interoperability site. On the down side, I’m not sure if it’s possible to allow read-access to a group of users. Private posts are mainly for individuals.
Tue 6 Sep 2005
Posted by srhaber under
Tools ,
HintsNo Comments
This page has many cheat sheets, covering html, javascript, css, php, mysql, subversion, and more. A valuable resource!
This site was discovered through http://del.icio.us/, a social bookmark aggregator which helps show active trends among websites. It’s basically an online bookmark manager, where users maintain personalized lists and can tag their link submissions with keywords. It determines a popular site based on how many users have it bookmarked. This search approach is a nice alternative to Google, particularly because it employs a real human/community element to finding good websites.
« Previous Page —