Posted by
Quinn Madson
|
Posted in
|
Posted on
8:19 PM
Had to upgrade mass amounts of data from outdated MySQL 3.23 to 5. Couldn't find any good guides so I am attempting to make one. This is currently a work in progress. I will add more as I get farther.
Backup existing data:
mysqldump --all-databases --quote-names -u root -p > backup.sql
I built a virtual Redhat Enterprise Linux server using VirtualBox to test out the upgrade path before I did it on the production server. This process is pretty easy and well documented. Install the RPM for MySQL server and client.
While trying to re-import the SQL, it failed several times. As I was migrating a little more than 100 databases, I found it handy to have a script that removes all the databases when the import failed. Here's what i did:
grep 'CREATE DATABASE' backup.sql > bobby_droptables.sql
vi bobby_droptables.sql
:% s/CREATE/DROP/g
** Remove the line: DROP DATABASE mysql; **
If the import fails, you can run:
cat bobby_droptables.sql | mysql -u root -p
Found out there is a bug in "--quote-names". It does not quote database names, only tables. This is fixed in version 4 which does me no good. I need to escape all my database names in quotes because Ensim created database names as SITENAME_-_PROJECTNAME.
Did this instead:
vi backup.sql
:% s/CREATE\sDATABASE\s\/\*\!32312\sIF\sNOT\sEXISTS\*\/\s\([a-zA-z0-9\_\-]*\);/CREATE DATABASE `\1\`;/g
The above RegEx puts back ticks around all database names.
My backup.sql had create statements such as this:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ some_database_name_here;
If your statement is different you may need to tweak the RegEx above.
Also, I added:
DROP DATABASE mysql;
... immediately before the CREATE DATABASE mysql; statement. As of now, I don't know if this will work or not. I hope that removing the mysql database momentarily will not cause any catastrophes. I'm hoping that replacing the database will restore all the existing usernames and passwords for the databases. It worked!
Now after all this, I was finally able to import the sql:
cat backup.sql | mysql -u root -p --verbose
--verbose is nice because while importing about 300mb of SQL, I kept thinking that the thing was gonna stall out and then would manually run:
mysql -u root -p
show databases;
but with --verbose you get to see all the SQL whiz past your screen.
Posted by
Quinn Madson
|
Posted in
|
Posted on
12:22 PM
After completing the steps below for your platform, TNS aliases will be available in Oracle SQL Developer in the "New/Select Database Connection" dialog by selecting "TNS" for the "Connection Type" combo box. These steps are only necessary if you can't or don't want to install the Oracle Client for your platform.
For Linux machines:
-get tnsnames.ora from: https://mumbles.imt.uwm.edu/dbdoc/tnsnames-noworld.php
-copy the file to: /etc
For Windows XP machines:
-get tnsnames.ora from: https://mumbles.imt.uwm.edu/dbdoc/tnsnames-world.php
-copy to c:\tnsnames\ (or some other directory where it will never be moved)
-right-click "My Computer" and select "Properties"
-click "Advanced" tab
-click "Environment Variables"
-under "System variables" click "New"
-"Variable name:" TNS_ADMIN (must be caps)
-"Variable value:" c:\tnsnames\ (or whatever directory you used above)
-Click "OK"
-Click "OK"
-Click "OK"
Ref:
http://wiki.oracle.com/page/SQL+Developer+FAQ?t=anon
* How does SQL Developer find my TNSNames file?
o SQL Developer checks the following:
1) $HOME/tnsnames.ora
2) $TNS_ADMIN/tnsnames.ora
3) /etc/tnsnames.ora ( non-windows )
4) $ORACLE_HOME/network/admin/tnsnames.ora
5) Registry Key
Posted by
Quinn Madson
|
Posted in
|
Posted on
11:05 PM
Spent a few hours migrating from an old media server to a new one. For the most part everything went great except the MediaMVP running MVPMC would not load the dongle.bin.config. I assumed my TFTP server was mis-configured, the mvpmc commandline switches were wrong, etc.
No dice!
Found this wicked juju from: http://mlblog.osdir.com/multimedia.mvpmc.user/2006-05/msg00020.shtml
Reposting it here for posterity:
Guys,
See my post in the user group. I've posted an incantation that allows the MVP to boot. The problem with this H1 appears identical to the same problem I have with my H2. I'm posting an update later on more findings I've had with long vs short power cycles and using MVP relay. Here's the reader's digest procedure to get a successful boot (from an H2):
After trying several experiments, the following sequence got me back to reliable time and time again booting (until you boot from flash again):
* Unplug the MVP for (I got it to work with a 90 second to 120 second cycle).
* After the 120 seconds have elapsed, unplug the ethernet cable (I think leaving it plugged in may help bleed off any capacitors)
* Apply the power again and wait for the MVP to get to the point where it complains about not finding a server and asks you to press OK to re-scan. You'll also notice that your "favorite server" has disappeared from the list.
* Power it down
* Plug in the ethernet cable
* Power it up (no waiting)
* You should get past the hanging last square
* When you get to the screen that states to press OK within 3 seconds to configure press OK
* You should notice that the MVP is re-scanning and your available server should appear on the list.
* Press OK to save the configuration (this takes a while and I suspect clears out any "bad" data that may be causing the problem)
* The MVP restarts
* You get to the screen with the 10 squares and dongle.bin.ver is requested and served at about the 3rd square. Then dongle.bin gets requested and served and now the text LOADING APPLICATION appears above the 10 squares and they all fill completely and stop once all full (NOTE: only one cycle and the LOADING APPLICATION seem to indicate that its working)
* There is a delay as the mvpmc application loads and screen flashes as it boots up perfectly.
Please let me know if this works for you as well...
Cheers...
Sergio
It works ... as goofy as it seems ... it works.
Posted by
Quinn Madson
|
Posted in
|
Posted on
9:24 AM
The example available from JA-SIG is some of the ugliest code I've seen lately. This is what I came up with (based on their example code):
Application.cfm
<cfapplication name="my_awesome_app_name_here"
clientmanagement="yes" sessionmanagement="yes"
setclientcookies="yes" setdomaincookies="no"
loginstorage="session">
index.cfm
<!--- globals --->
<cfparam name="url.ticket" default="">
<cfparam name="username" default="">
<cfparam name="url.action" default="">
<cfscript>
cas_path = "https://cas-server.example.edu/cas/";
app_path = "https://coldfusion-server.example.edu/path/to/this/app/";
cas_url = cas_path & "login?" & "service=" & app_path;
</cfscript>
<!--- session init --->
<cflock timeout="10" scope="session" type="readonly">
<cfparam name="session.username" default="">
<cfparam name="session.authorized" default="0">
</cflock>
<!--- logout action --->
<cfif url.action eq "logout">
<!--- session reset --->
<cflock scope="session" timeout="30" type="exclusive">
<cfset session.username = "">
<cfset session.authorized = "0">
</cflock>
<cfset cas_url = cas_path & "logout">
<cflocation url="#cas_url#" addtoken="false">
<cfelse>
<!--- auth check --->
<cfif not len(trim(session.username))>
<cfif not len(trim(ticket))>
<cflocation url="#cas_url#" addtoken="no">
<cfelse>
<cfset cas_url = #cas_path# & "serviceValidate?ticket=" & url.ticket & "&" & "service=" & app_path & "/">
<cfhttp url="#cas_url#" method="get"/>
<cfset objXML = xmlParse(cfhttp.filecontent)>
<cfset SearchResults = XmlSearch(objXML,"cas:serviceResponse/cas:authenticationSuccess/cas:user")>
<cfif arraylen(SearchResults)>
Raw XML:<cfdump var="#cfhttp.filecontent#">
<cfdump var="#objXML#" label="CAS Results">
<cfdump var="#SearchResults#" label="Parsed CAS Results">
<cfset username = SearchResults[1].XmlText>
<cflock scope="session" timeout="30" type="exclusive">
<cfset session.username = username>
<cfset session.authorized = "1">
</cflock>
<cfelse>
<cflocation url="#cas_url#" addtoken="no">
</cfif>
</cfif>
</cfif>
<cfif structKeyExists(url, "accessdenied")>
Access Error
<cfelse>
Authenticated.<br/>
<cfdump var="#session#" label="ColdFusion Session Object">
<a href="?action=logout">Logout</a><br/>
</cfif>
</cfif>
Honestly, it's a pretty simple process:
- Check for a ColdFusion session
- If one doesn't exist, redirect to CAS and provide a call back URL
- When CAS redirects back to your application you grab the ticket and verify it server to server via cfhttp.
- If the ticket checks out, you create a ColdFusion session and use it within your application.
The point of this example is to keep it simple. The code is commented to clue you into where the different components would plug into the framework of your choice.
Posted by
Quinn Madson
|
Posted in
|
Posted on
7:08 AM
Zimbra has a bunch of built in functionality for rendering HTML versions of calendars as well as feeds such as RSS. This keeps coming up with Zimbra users inside and outside of our organization. I'm posting it here for future reference.
For an HTML representation of a public calendar we use a URL like this:
https://pantherlink.uwm.edu/zimbra/home/qkmadson/calendar.html?view=week
The view=week is optional; I just wanted to show an example. The view defaults to a month view and can be changed by the user. If the calendar is not set to public, you'll get a permission error. If you want to show a private calendar, you can use something like:
https://pantherlink.uwm.edu/home/bmaas/?fmt=freebusy&view=week
This will show the free and busy information but, no meeting details. For your purposes, you will need to change "pantherlink.uwm.edu" to your Zimbra server and change "qkmadson" or "bmaas" to one of your usernames. You may want to take a look at this blog entry:
http://www.zimbrablog.com/blog/archives/2006/01/rest-update.html
The show examples of how to use various feed options in Zimbra. For example, if you wanted to use RSS:
https://pantherlink.uwm.edu/zimbra/home/qkmadson/calendar.rss
Posted by
Quinn Madson
|
Posted in
|
Posted on
9:01 AM
The current package for RapidSVN segfaults constantly with the current version (as of today's date) in the Hardy Heron repos. To fix this:
- Grab the Intrepid Ibex package by editing: /etc/apt/sources.list
- Do a search and replace: "hardy" for "intrepid".
- Update your packages and reinstall RapidSVN.
You can do this from the GUI side with gedit and synaptic. From the command line:
sudo -s
vim /etc/apt/sources.list
in vi:
:%s/hardy/intrepid/gi
:wq!
command line:
apt-get update
apt-get install rapidsvn
At this point, you should switch back to the hardy repos by editing sources.list and re-replacing intrepid for hardy.
Posted by
Quinn Madson
|
Posted in
|
Posted on
6:12 PM
While running the MVPMC software on MVC devices, sometimes I will receive an error that the streaming server cannot be found.
Check /var/log/messages for:
dhcpd: DHCPACK on 192.168.0.51 to 00:0d:fe:39:21:06 via eth0
if that's the last message, make sure you run:
/usr/sbin/in.tftpd -l -a :16869 -s /tftpboot -v
/usr/bin/mvprelay 16881 5906 6337 192.168.0.1 &