Andy Kopciuch's Blog
The Flu, Graphics Magick & DMS features
MERRY CHRISTMAS!
I seem to get sick around every second Christmas. One year I'm fine, and the next year I manage to come down with the ugly flu that everyone else has gotten over just in time to enjoy Christmas, and I end up stuck on my couch wrapped up in a blanket taking vitamins and drinking 10 cups of tea a day. This year isn't so bad, but I did feel like crap for 3 days. Just tonight I am finally starting to feel better after a few hours in Dayle's hot tub. My apologies to everyone I cancelled plans with, or did not show for tentative drop-ins. I just couldn't handle it as I really needed the sleep.
Well during my sick time, I managed to screw up my sleeping schedule tragically. So in one of the 2 hour sections I was awake, and feeling shitty enough to be up, but wish I was asleep, I decided to do something semi-productive. I had been working on getting a personal website up for Thom. I had taken his site down on the sick somputers from the last week. Maybe I caught whatever those hard drives had? Anyways I decided to port the old site to the new phpfwk. It was a little bit of work to move to a new user system, which ties into the CMS, DMS etc. Base everything on templates, and a common framework location. I managed to move everything around, and create a single SQL file to run on the DB which would alter tables, and add everything we need.
This site in particular makes use of the photo album cmsObject I wrote quite some time ago. There were a couple of new features in the phpfwk version, which was cool. I did realize that the new server I installed was missing the imagick extension. I checked and / or installed, Image Magick, php-devel, and any other related packages from the distribution RPMs. I downloaded the imagick tar ball, ran phpize, ran ./configure. The configure failed stating it can't find InitializeMagick in -lMagick. Huh?!?! I found the .so, ran strings, linked it to other logical spots, checked the ld.so.conf, ran ldconfig, did all the usual things. I spent around an hour trying to get configure to run. No dice. I was also not lucky enough to have a .so built on SuSE 9.1 work on 9.2 :-( The end fix was that I installed Graphics Magick from source, and passed --with-imagick-gm flag to force Graphics Magick as the back end. Everything configured, compiled, installed, and worked perfectly. Another trick to put in my blue bag with the purple stars on it.
Tonight I was feeling more up to the task of doing something 3/4 productive. I decided to familiarize myself with the DMS code from the framework. I'll need a DMS for the L&Y toolkit. I'm heavily leaning towards using the existing DMS, and extending it to be more useable for L&Y needs. I think I can make the DMS totally extendable, and not wreck anything in there. I'm still rolling some things around in my head.
I did add a couple of needed features right off the bat:
- Allowing the creation of sub-folders
- Allowing the deletion of folders (all sub folders too)
I totally made the code look pretty. Well not really pretty, just workable. No disrespect meant to Aaron's coding, we were really really pressed for time when we first worked on this code base. I think he wrote the DMS in about 2-3 days IIRC. It has served it's purpose for the time we have used it. It just happens that I want to use it for some more, and while I'm in there I may as well make it look nice.
Some things I have planned for the future of DMS
- Allowing reparenting of folders and documents
- Creating a post action system (post folder / doc creation, post deletion, etc.)
- ACLs and FTS are listed inside the files as TODOS still (I might need these, low priority at the moment though)
- Add a DMS selector to the RTE (Maybe add the new RTE at this time, again low priority at this moment)
- Maybe redesign the on disk file layout (with sub folders now) ???
I'm sure I have some more things kicking around in my brain. It's kind of clouded tonight as I'm getting over the flu. I think I am on my way back to healthy, so I can get at this DMS stuff. I'm excited. Not so excited about the -26 Celius predicted High for Monday. At least I'll get to stay inside and code all day. ;-)
Vehicles, Hard Drives & Chocolate
So after arriving from Victoria I needed a vehicle. I left my car there because I didn't feel like driving 14 hours for 2 weeks to turn around and go back. AJ said I could use one of their extra vehicles. Turns out he couldn't get the mini van back soon enough so he let me borrow the Expedition. Totally cool! I feel like a monster driving that thing ... it's so _HUGE_. But a pig on gas. I got it on E, and I put $20 in. That only gave me a quarter tank! Today I went with AJ to pick of the van, and now I'm driving that instead. Much better.
It's a good thing I've had a vehicle over the weekend because man did I need it. The hard drive went on the southland server while I was in Victoria. I rebooted and it froze. AJ went up Friday morning and was telling me what's on the screen ... not good. I couldn't walk someone through it over the phone. I needed to be there. So Saturday I went up and booted into maintenance mode. I had to mount a bunch of partions to figure out what they were before fixing them ... I can't remember how big and what partions were on a server I built 2.5 years ago. Anyways I had to manually run fsck on a RH 7.3 box with ext3 filesystems. Man were there a lot of inode unbalances. I cleaned everything, and the system did reboot cleanly. I did not want to leave that disk in there to have it happen again. So I dumped all of the data to my home machine and burned it to a disc.
I went around to Computer Rack to see Brian. He wasn't working but I needed supplies. I picked up 2 80G Seagate disks, an LG CD-writer, IDE cable, and some discs. I was going to rebuild that system properly. I just got some SuSE 9.2 discs and decided it was time. I grabbed the configs and away I went. The Install went fairly easily. I did end up redoing my partitions table a couple of times to get it right. It's not overly intuitive when you are trying to set up LVM and RAID at the same time. I got it done right, which makes me happy.
Now Murphy's law when you re-install a server. I've set everything up and plugged the box back in. No internet. I change the IP based on the config file I saved. Doot Doot Doot ... hrm still no internet. I can't get by host name so I realized I forgot the DNS servers. I checked on another box up there to get the IPs. Still nothing ... not even by IP can I get anywhere. Oh crap ... I forgot about the gateway. I mean I forgot to get the value of the gateway from the old configs. So I ended up plugging in the hard drive to another machine to log in and check the IP value.
So I got it up and running. At this point in time I realized the server next to the one I just fixed started to flake out. Man ... how do two separate servers have their hard drives fail at the same time. Ever had a segmentation fault when you run ls? I did over SSH, which led me to believe it might be a RAM problem. I ran the x86Memtest on it with no errors. And the system would never boot up again.
This box was the first server install I did for this client over 3 years ago. It's running RH7.3 with an ext2 filesystem. I'm not sure how many of you remember non journalled filesystems, but I'll remind you why they suck. Becuase whenever I had a problem and had to power off the box because it hung during init, the filesystems were not cleanyly unmounted, running fsck on /, /home, /usr ... on and on. When trouble shooting a freezing computer with a flaky hard drive ... that's not fun. It's very time consuming and annoying as all get out.
Amidst my computer troubles at the north office, I realized something. It's much nicer to do those sorts of things during the day up there becuase the office tends to have lots of chocolate up there during the holiday season. I had to leave the office while waiting for one fsck just to stop stuffing my face with chocolate. Man those truffles are addicting.
I finally got the system to boot fully into single user mode. I tested out the internet connection. I could get in, and out. YIPPEE. This means I can at least get the needed data off of that sick computer before it dies. I had tar die a few times creating archives to move around easily. I ended up just moving the directories, and planned to transfer through KDE. I could drag and drop, because I couldn't tar them up and sftp them back. By hook or crook I'll get my data back! So I had the file transfers die a few times while transfering files through the kio_slave fish:// That was kind of alarming to me. I decided it would be a good idea to try moving stuff in smaller chunks. So one directory at a time with hundreds of small files in them. Eventually I got all of the files ... somewhere. I have to re-organize them still, but it's there.
After all was said and done I left and decided to install software, and configure things remotely from home. I didn't realize that SuSE 9.2 does not have binaries on the mirrors yet. Not until mid January I read. Damn! So I spent an hour attempting to build some things from src rpms. _EVERY_ time I did one I ended up missing -devel packages or other dependencies. That's a minimal system for you. I finally got fed up and spent 7 minutes compiling PostgeSQL from source. I already had apache, and PHP installed from the CDs. postgresql-server was not available though. :-( But it's all good, healthy, and everyone seems happy now. Lets see what tomorrow brings for the next hard drive I'll reformat.
Oh ... and happy holidays!
MS-SQL, Muscle Relaxation & Home
Alright. I'm back in Calgary now. It's Friday night and I'm going through the typical get home, unpack, check mail, watch TV etc. I decided it was time to jot down my second week out on the coast. During my 6 days of rain since my last post I did manage to get quite a bit accomplished. I would say we reached our goal which was to have the data gathering portion of the site completed. It's there, minus a few small features, and some look and feel things. My next round on the coast and we will finish it off, and make it look the way it's supposed to.
I found no real problems with the project design or implementation in PHP. I did have some learning curve to get a semi-doesnottotallysuckdonkeyass environment set up on windows. I miss my X-paste. I miss my Konsole, I miss my K-Mail. I miss my linux machine period. But I still managed to get there in timely fashion, and I'm quite proud of that. The biggest challenge for me was getting used to the way MS-SQL handles things. It's basically like any other RDBMS, but does handle some things differently with Transact-SQL. For example
- DATETIME is the datatype, not DATE or TIMESTAMP
- There are no BOOLEAN datatypes, just BIT
- UNIQUEIDENTIFIER datatypes are interesting
- Built in functions for system table access (EXEC sp_columns @table_name mytable)
Those are just a few. And they are nothing overly interesting or terrible. Just inconviences is all. I made the effort to become accustomed to the MS-SQL Enterprise interface. I _hate_ using a GUI for database design. Just give me vim and I can write the SQL statements myself. At least I'll know whats going on then. I did spend some time trying to sort out the relationships in the GUI. Ended up setting all of them one relationship level too high. I had the all of the wrong FK on the wrong table. Yeah ... that was fun. At least in the flat files I can see my screw up. Amongst a tool bar and a screen that looks like a spreadsheet, the information you really really want in the design view seems rather small. I guess I'm just old school ;-)
So I was staying late one night at the office. Chris left around 8:00 and I decided that since I hadn't eaten that day, food would be a good idea. That way I could just stay for a few more hours and get some work done. So I went around the corner and got some pizzas, and coke. Came back and ate. My back had been bothering me so I took a muscle relaxant, and played Slingo for a while. I started to realize that after not eating until night, and the muscle relaxants taking effect, there was no more work to be done. I could feel my brain just floating away, and I gave up and went back into Victoria. Typical computer programmer fashion ... go go go. Take some pills ... uh-oh can't work anymore. :-S
We didn't quite get everything setup for the internal server. Differences in PHP versions and ini settings. There's some problems with the include paths, and the way I've been doing things. We'll figure it out when I'm back in the new year if Rudy doesn't get it settled. The flight was quick thank God. It's good to be home.
Bitwise Math & Roll Up Jeans
So I've been trucking along out here in Sooke for a week now. It's been rather productive the last few days. It took a while for me to get a working development environment going. The PS guys are great ... always asking if I need something else. "Do you need another monitor? Do you want a different keyboard?". I'm good to go with whatever computer I'm sitting at. Adaptability is key when you are in my line of work.
So I'm using a windows machine. I have IIS installed, with PHP. I have a local running MS-SQL server nad I have encapsulated myself into my laptop out here. This way I can break things and not worry about the effects upon others. Eventually we will have a Visual Source Safe reopsitory for Rudy and I to make use of, but for now I'm good to go.
The hardest part of this project for me is really getting familiar with MS-SQL. I'm a command-line kind of guy, and the MS-SQL Enterprise Manager scares me. ;-) Not really, but I don't like GUIs for things like that. Just let me create the SQL in a flat file and run it on the DB in a command line. The whole Users / Groups thing for MS-SQL is not overly intuitive either. You have to add them into the security place before you create them in the DB. To me it feels like you are creating the user twice.
CREATE USER akopciuch WITH PASSWORD 'password' CREATEDB CREATUSER;
Doesn't that seem way easier than point and click these 7 things to set up a user, and then go to your database and add a user from the users and groups icon, and point an click a bunch more. Bah ... GUI. Another MS gayness I encountered: I wanted to create a simple key/value table for testing. Made the mistake of calling field names "key", and "value". It lets you enter them in, displays them inside [], but won't let me access them. because you get a syntax error at keyword "key". GRRRRRRRRRR! If I can't use them as column names ... why let me type them in in the first place? Just avoid the whole issue. I'm not saying one way or another that you should or should not be allowed to use keywords as column names. I can in PostgreSQL, not in MS-SQL. That's fine, I'm just saying that if you are not allowed to, don't allow me to enter them and lead me to incorrectly believe that it is alright.
My latest coding experience took me back to my days of engineer code at SED Systems. Lots of system development in C, C++. Hardware interaction etc. I remember learning very much in depth the tricks of using bitwise math operators, and storing information in numbers for flag processing. Check your mask as to whether you are on or off. Bitwise OR (|) to turn it on, bitwise AND (&) NOT(~) to turn it off. I didn't really get that far. I'm just using a mask of integers to hold which group of tabs should be accessible at anyn one given time. So I just do a bitwise AND (&) to check and set in a given placeholder in the bitmask was set, and display the proper tab. But it brought back my memories of pen and paper with a gazillion zeros and ones written all over the place. Many a coffee was drunk that afternoon.
So the weekend was upon us and the party had begun. Saturday I got up early and went shopping for some things. It is Karen's birthday on Tuesday, but she has finals so her birthday party was Saturday night. I got her a new pair of ADIDAS sneakers that I knew she wanted. I went to the store twice to make sure. I had to go back to the house and steal her shoe to check the size. She loved them! She squealed and jumped around for a few hours, and wore her "new kicks" at the house party.
Marshall and I went out in the afternoon. I took my car in for regular maintenance. We had lunch at Spinakers on the deck. The weather in Victoria was GORGEOUS! We went shopping around downtown for a while, and eventually got back home around 5:00. I bought two totally cool rye tumblers. Big thick and heavy. They are the coolest glasses I have ever bought ... plus they were on sale for half price. Melissa was preparing dinner for everyone in prep for the shindig. She made AWESOME chicken taco salad. Everyone can add whatever they wanted in the salad. I choose to avoid more of the chili sauce after Marshall deviously tricked me into thinking it was good to eat on corn chips ... not so much. My tounge is still scared of that jar.
So everyone was getting ready, and people were starting to come over. It was a margarita party, but since I don't like tequilla I was drinking rye and diet coke. I met tons of people. Marshalls friend Thor who is an accountant for the government, Johnny who is a cool wicked ass drummer. Me and Johnny are total geeks. We could just sit around all night long and talk about drums. Poeple think we are wierd. But it totally rocks! ;-) Sylvia recently got engaged, and also likes to drink rye. Paul who is also from Calgary and makes a living producing natural soap and similar products. Shane and Tanya (?) who actually live out here in Sooke. Esa (sp ... amybe Ece) who is a little french hottie. Totally cute, fun girl. I met lots more people but I can't remember everybody ... but you were all cool!
Do you remember in the late 80s early 90s when it was the cool fashion to tuck and roll your jeans up at the bottom. The tighter the better. And then people would wear big wool socks over top of their jeans too. I personally never did that. I remember it being the style with girls in my grade 6/7 classes. It always found it bizarre. Well we somehow got on the topic and before you knew it we were all tucking and rolling up the jeans to be "cool". Karen has the pictures, and the video to prove it. I said to Marshal "Dude ... do you realize it's 1:00 A.M. and we are rolling up out pants and dancing around because we think it's cool?". He said "yeah ... we're drunk".
Esa came with Marshall, Karen, Thor and Myself later in the night when we were completely anihlated. We went to a bar downtown. I can't even remeber what it was called. It was kind of a preppy club. Seemed like a cougar hangout to me, but it was fun times all the same. The bar was pretty short lived since we got there for last call. We are right downtown so downtown food it is. Me and Marsh went straight for Mr. Tub Steak again. Good stuff. Apparently Karen has a severe opposition to "Street Cock" so she went with Esa for pizza. Referring to our hotdogs as "Street Cock" seems to upset Marshall.
No cabs in sight. So we started walking. By this time in the night it had gotten fairly cold outside. So the walk in the wind wasn't so desireable. Karen decided to sing me songs to help keep us warm. Eventually Johnny came along to our rescue, and we swiftly made it back to the house. Melissa and Owen came out to join the really really drunk people. And someone decided it was a good idea to start having tequilla shots. that's when I tapped out and headed off to bed at 3:30. What a night ... what a party ... Happy birthday Karen! Glad I was there!
Snow, Umbrellas & Stuffed Animals
Well it's been a while since I last wrote. I have good reason for neglecting my writings. I was terribly busy getting ready to leave. And most of my travelling I have had limited access/time to a computer.
Friday Dec. 3 was insane. The day before I leave and everything went haywire. It started with a power outage in the north early in the morning. I was awoken to several phone calls, and a trip to the office to restart all of my servers. Apparently a scaffolding took out a power poll. As it turns out, the city is trying to collect $301.16 for repairs to a guard rail I did not hit in my accident last winter. So after several phone calls to re-explain everything to my insurance company, and the city's law department, I am waiting to see what happens. Then it turns out I was not getting a laptop to bring on the road trip. Not that I cared ... just more things changing last minute. And finally I spent most of the night cleaning and doing laundry. 3 hours of sleep before a 12 hour road trip is always good.
Saturday I slightly overslept. I was driving to Vancouver and I finally left Calgary at around 10:00. I did manage to pick up two XL double doubles from Tim Hortons ... and man did I need them! The roads were terrible. Blowing snow and rain for most of the highway between Calgary and Kamloops. They even shut down the highway for an avalanche check or something outside of Revelstoke. I hit the Coquihola highway outside Kamloops and arrived in Vancouver around 9:00. So the total trip took me about 11 hours with stops.
I met up with my buddy Heath at his apartment, and after a short break we promptly headed out to a party. The hosts were Chad and his fiance Kate. I met several of Heath's friends. I believe his friend Ben along with his grlfriend and brother were there. I can't remember all of the names three days later, but I can say they were really uber cool people. And for some reason they kept trying to feed me. The coolest thing I noticed in Vancouver was that _everyone_ always had an umbrella. On our way into the party, there was a big pile of open umbrellas in the hallway. I asked about them, and apparently that's what everyone does ... to dry them out ... just leave umbrellas lying around. Maybe bic should make disposeable umbrellas. Good idea right?
So we headed out for a bite to eat at Denny's, and headed back to the apartment, and Heath's girlfriend Chelsea came over. Chelsea is _TOTALLY AWESOME_. Well done Heathcliff! They work together at the English Bay Boathouse (well for about 2 more days I think). We went for breakfast the next afternoon, and hung around down on Davie St. We went for a little drive around Vancouver. Chelsea was the tour guide. Kitsilano, West Van, around the downtown, went to UBC. We didn't have much time because they had to work, but it was cool all the same. I did get to see where David Suziki lives, and where David Duchovny lived during X-Files. I dropped them off at work and had a coffee with them. I was returning there later to meet another friend Ara in the deck lounge. It was great to see some old time friends, and make some new ones along the way. I did however totally get my ass kicked by everyone at NTN later on in the night. I wish I could have stayed longer with Heath. I'll be around for his birthday this year I hope.
So Monday morning I got up early and took the ferry from Tswasan To Victoria. It was a quick ride (about 1.5 hours). I was very tired still, and from landing I jumped in the car and headed straight to Sooke arriving at noon. I greeted everyone at Power Soft once again, and we jumped right into the work. I met with Chris Lang, Rudy and Mik. We hashed out how we are going to tackle the new system we are building. I straightened quite a few things out in my head. It turns out I'll be using MS-SQL Server quite a bit too. It's all good ... I'm just starting to have windows flashbacks as I get going again. ;-)
I left Sooke and met up with Marshall in Victoria. We went out for much needed food at 5th avenue. A small pub / restaraunt. It was really good food. Or maybe I was just really really hungry. We headed over to the Knockanbach to visit Karen. We only stuck around for one drink, and Marshall had newspaper in his grasshopper. GROSS! We bolted and headed to another pub called the 6 mile to play some darts or pool. It turns out they had a toy house machine. The game with the metal claw where you try to grab the stuffed animals out. I'm totally addicted to them, and I ended up winning a stuff bear, and a Mickey Mouse. Karen and Melissa are now the proud owners. We played some pool for a while, Marsh won 3-2 eventually. I blew a 2-0 lead. We hung out, smoked, had the waitress make google eyes at Marshall. It was good times by all. We headed back to the house and went to bed.
Today I still have no laptop sent out (it was suppose to be fed exed or something). It's fine though ... I have one here I'm using. Didn't do any coding today. I spent my time discussing things, and writing most of a design document. I made my database schema definitions, and the html form layouts. I just want to be prepared when it gets to the implementation.
I think I'll use my framework, and write an ms-sql extension to the db extraction. I'll probably use a subset of the framewrok (no need for a CMS, DMS, shopping cart here!). Looking forward to getting into some code the next couple of days. I'll have to set up IIS / MS-SQL Server, Install PHP, and customize this envioronment. (prolly install vim, maybe cygwin). I really really really miss x-pasting (middle button) ... :-( It only screws me up around 35 times per hour. I'll shoot for 25 tomorrow. It's good to set goals.