Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
User Journal

Journal Journal: It's All Good

Brian has left the building!

Yep, I'm a few days late on this, but I'm done working for Uncle Pete. That is, in the direct sense. Now I'm working for his little sister, Seline. If this doesn't make sense, don't worry. I'm just trying to keep it vague enough to write about.

After 4 years of progressive horribleness at the former, I was finally able to break away and get a transfer to M&S to do development full time. So, how is it so far? Umm... uneventful. I know I'm just getting started, but that's the problem. I'm not *getting started.* I am going to need at least a little direction to meet this end-of-year deadline.

I'm coming into a completely new codebase, and several new frameworks: J2EE, Spring, Maven, Hibernate... all the buzzwords. Which will be great on a resume, providing I can figure it all out. I don't have any training or experience in any of these technologies (save for a 2 day class on Maven). So yes, I'm green. But I'm ready to get started.

Aside from the lack of movement so far, I'm still pretty stoked to be here. The days of waking up to 300+ email notifications in the morning because the WebLogic or ColdFusion environment was down are over. The environment so far seems like I will be mostly left alone to do the things I need to do, and as long as I do them, people will continue to leave me alone. I'm mostly unimpressed with the current staff, tech skill-wise. They are enterprise people. They know their way around the technologies they need to make them good at work, but not much interest outside of that.

That's ok. I'm keeping myself sharp by taking a class on Artificial Intelligence through Stanford. It's really testing me. Bayes networks are not the easiest thing I've studied. Along with that, I'm trying to keep up with a 7 Languages in 7 Weeks class. I committed to teaching Erlang, so I have to at least do that much. So far, I've dived into Ruby, and gotten to know it at least a little. And I've started on Io, but haven't gotten far. That's falling behind. Gotta step it up.

So yes, keeping myself sharp is good. I have a feeling I will be very good here in a few months. It's going to take some time and a lot of practice and learning. I already feel good coming over here. Like a huge weight was lifted off my chest. The quality of life was so low at the last job, I don't know how anyone lasts more than a year. Good luck to that fucking team.

I also installed Good Mobile Messaging on my phone and got rid of my BlackBerry piece of shit. Not sure if I will like the notifications, but maybe I can turn them off. And I bought a bunch of extra batteries for my Droid X so I don't have to worry about it dying after 3 hours. Turns out, it was just that battery. I got a couple new ones and they will last all day on continuous use.

Point is, things are good.

User Journal

Journal Journal: RPM Purgatory

Well here's a fuckin' update for ya!

I am progressing with OPERATION: GITFO slowly but surely. Some days I just have no motivation to do anything, so I don't. But some days are perfect for work; It's quiet, I'm well rested, I've got ample coffee, and it's QUIET.

What is really helping is having New Guy take over the bullshit tickets I get every day. That is helping immensely.

I've been sitting on a stood up server farm for a few weeks now. It's time to make progress. The next step is to get the RPM process working. If I can build an RPM with this server farm configuration, I can get this shit set up and in a hurry. So that's the focus today.

First, I'm learning about SPEC files. Fun stuff.

I'm using this guide to explain this particular SPEC file to me: http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html

So the most important things I'm noticing are files and directories, wich is pretty much all we do for RPMs. We bundle things up (which could just as easily be done with a tar file). But this is how
we do it, so fine.

%files grabs everything in the directory recursively.
%dir specifies just the directory, nothing in it

This seems to be the meat of these RPMs. I guess that's easier than I figured it would be. We don't really have any dependencies (that we list, anyway) so that's it I guess.

And anyway, it's the start of a long weekend, so I'm fuckin' out of here. Peace.

User Journal

Journal Journal: Ugghhh Mondays

There are some days when I walk into work and I know it is going to be hell. Usually it's because I'm tired, I wake up late, and I made a bunch of changes on Friday that are now coming around on Monday to bite me.

Today fits that bill.

I've been trying to tidy up the ColdFusion environment by making configs easier to update in one fell swoop. I'm using ANT's Filter Chain utility to modify the jrun.xml file. Only problem is, that
fucking file is a touchy bitch. You fuck something up in it, and your server can start behaving VERY irradically. I've had several problems with this and I think I just found another. Most of the
problems have been related to either not allowing the right IP addresses in or the clustering not working as expected.

Furthermore, I've been trying to put everything in SVN. This has also been a headache. I believe that if I can get everything set up, future configuration management will be easier. But setting it
all up has been a nightmare of broken shit.

I'm trying to figure out how to be more careful with these changes. And I always think I am being careful, but shit still gets broke.

I'm now worried that this is how the rearchitecture is going to be. I've titled the rearchitecture "Operation: Gitfo." Short for Git the Fuck Out, but it also sounds like Git'Mo, because I'm trying
to break out of prison.

Anyway, I just did 3 hours of fixing people's shit that I broke on Friday, damage control, investigation of shit that's been broke forever and will continue to be broke until I complete Operation:
Gitfo, and general nuisance managing. Now I get to fix all of our Autosys jobs. Joy.

User Journal

Journal Journal: Consulting Is Bullshit

So I started a consulting gig a while back to design a website for a psychotherapist.

Many months later, she's finally wanting to get on with it. This isn't the first consulting job I've offered to do where the client flaked. Super annoying. Anyway, I guess we might be getting on with it.

So we have an account on Host Gator. You don't get SCP or anything cool like that. Just FTP. So I'm finding I'm having trouble remembering how to auto-login to FTP on Linux. So here's how:

You need a ~/.netrc file. This was the first Google link I saw:

http://www.mavetju.org/unix/netrc.php

(In case it ever dies, you need to do the following):

[~] edwin@k7>ls -al .netrc
-rw------- 1 edwin wheel 246 Aug 27 16:14 .netrc

Layout of the .netrc
Machine definitions

The first part of the .netrc is filled up with host-definitions:

machine ftp.freebsd.org
        login anonymous
        password edwin@mavetju.org

machine myownmachine
        login myusername
        password mypassword

Macro definitions

This part of the .netrc consists of macros which can be used to perform automated tasks:

macdef uploadtest
        cd /pub/tests
        bin
        put filename.tar.gz
        quit

macdef dailyupload
        cd /pub/tests
        bin
        put daily-$1.tar.gz
        quit

User Journal

Journal Journal: Catching Up

Man, it seems that I come back to /. every so often (years) to see that I haven't updated my journal in that long.

Sad, really.

This journal holds a lot of memories, as well as some good knowledge, should I need to revisit a particular issue at any point. It also reminds me of my ingenuity at times. I come back and read something 4 years old and I'm like, "I was a smart motherfucker back then."

Back when I worked in Aurora, things were easier to talk about, too. Typical admin/dev stuff. Here, there's a lot of things specific to the company that I can't/don't want to talk about.

Well, I'm starting a new project that I think is noteworthy, which I am calling Operation: Gitfo. (It's a play on Guantanamo Bay, since I feel like an enemy of the state, and GTFO, because that's
what I want to do). The project is basically fixing the entire ColdFusion environment by rearchitecting it, so I can get out and go to my shiny new developer job.

So, in this endeavor, I plan on documenting much of my efforts on here. I'll try to keep the technical aspect general enough so that it isn't company-specific, yet still interesting.

Today, I'm not really doing anything interesting, but I will follow up. PROMISE!

Oh, and I'm also turning off comments, cause it weirds me out that people other than me actually read this. Weirdos. xoxo

User Journal

Journal Journal: Life Is Hard 2

I am attempting to straighten out my fucking life.

On the surface, everything seems great. I'm a CS/Math graduate working for a Fortune 500 company doing web infrastructure and development. I'm not in
too bad of shape, fairly good looking, and people seem to like me.

But, dig a little deeper, and you'll see that things are teetering on disaster at any given minute.

My debt situation is fucking ridiculous. Not in the amount, but in the fact that it doesn't seem to be moving at all. I throw a little cash here and
there at it, and the interest and fees just eat it like a greedy dog. Couple that with the fact that I'm basically living pretty meagerly. I hate my
apartment. It's constantly a mess. I have a long-haired cat that coats the house in fine cat hairs. I feel like I'm struggling to keep up at work.
Forget testing, I'm just trying to get the product out the door. And because of the lack in testing, when it is out the door, it's buggy, which in
turn makes me look bad. I'm not even sure I like my job anymore. I'm not sure I was cut out for corporate America. I think I would rather be touring
playing music. No, there's no money in that. But there's no joy in my current job. I have always wanted to freelance. Something that I would put time
and energy into because I would love what I was doing, not just because of pride in work (which is the only reason I work as hard as I do now). Anyway.

I am attempting to straighten out my fucking life. And not without a plan. So, here's my fucking plan:

Physical Appearance:


  •        

  •                 Diet - I am using http://dailyburn.com to track my nutrition and my goal is to get down to 10% body fat. I have several other goals with how
                    much weight I would like to lift. This is all with the end goal of being confident and attractive to women.
           
  •        


  •                 Skin - Sunless tanner, tanning beds, or just sitting out in the sun. But I need to get some color on this skin. I also need to clear up my
                    blackheads and big pores. It's not terrible, but it's an imperfection nonetheless.
           
  •        


  •                 Hair - I'm changing my hair from the military spec haircut to something a little more edgy. I've always said I get most of my confidence from
                    my hair. This should shoot confidence through the roof (if it works).
           
  •        


  •                 Lips - If the peeling doesn't stop, I may need to find a product that will fix it.
           
  •        


  •                 Clothes - I don't have the money for new clothes, but I am going to start needing them. My thighs are outgrowing my jeans (squats, man,
                    squats). Keeping an eye on the sales racks in Von Maur and Express should do the trick.
           

Finance:


  •        

  •                 Since http://mint.com won't track my small hometown bank, I need to do my own tracking on a http://docs.google.com spreadsheet. Strict record
                    keeping and adhearance to a budget should help me get my debts slowly paid off.
           

Work:


  •        

  •                 The biggest problem at work is distractions. I need to find a way to focus. I'm currently typing this at work. This is not focus.
           

Girls:


  •        

  •                 I need to get out and continue meeting women. I've been slacking off in this area, so I need to get back into it. More to come on this.
           

Long Term Work Goals:


  •        

  •                 If I ever want to be a consultant, I need to start doing some small work. I need contacts. I NEED TO GET THIS MOVING.
           
  •        


  •                 I also need to start learning skills that people want. Like design. God I hate design. But I need to learn it. Without it, I'm only half a
                    consultant.
           

Music:


  •        

  •                 I want to play music. I always have. I'm going to start booking shows around here and getting contacts. I need a demo as well. This must
                    happen.
           

This is kind of a shitty list, but it's just an overview. I've got a lot of the specific tasks in http://rememberthemilk.com To Do lists. I need
these lists to feel a little less panicked. I've only got one shot at this life. I need to make the most of it.

User Journal

Journal Journal: Time Wasted Debating What's Kosher

I'm fucking sitting here debating with myself over whether it's cool to send out a bit.ly shortened URL of an internal website or not.

I mean, for fuck's sake, what the hell could be wrong with it?!

But that's the mentality here. God forbid you step outside the red tape. I want to use technology. I want to stay current on things. I want to shine.
But it's hard to shine when you're covered in red tape. This is bullshit.

In my intern days, I would have just sent the fucking email. But now that I'm full time, I have to sit here and think about it. Is someone going to
yell? Is there some kind of legal issue being violated? Security concearns? God I hate this.

I sometimes miss the shit out of the Co-op, because of their ignorance to such stupid policies. They just let me rock. And I wasn't nearly as good as
I am now, but the freedom to roam fueled me. Responsibility fuels me. Being treated like an adult fuels me. Being wrapped in red tape and confined to
a box does not fuel me. It sucks the life right out of me.

Anyway, enough ranting, I guess. I'm playing with jQuery and trying to get it to do things for me, but right now, it's being a bitch.

I've also been reading Head First Design Patterns, and it is a fantastic read. I think I'm going to implement the Observer Pattern for my scheduler.
Sounds like the perfect candidate. I'm also trying to wrap my head around "code to an interface, not an implementation." While I understand the
concept, I find it difficult to apply, especially in the non-object-y world of ColdFusion. It's not usually as cut-and-dry as having an "Animal
class" and a "Duck class" that extends it. I've got forms and SQL and Ajax to work with. It's a little more fuzzy on how it would relate. Though I
DID set things up with an MVC Pattern, my backend is painfully lacking in any kind of structure. It's very thrown together.

I hope to resolve this as I start to implement Quartz.

Alright, back to work.

User Journal

Journal Journal: Waste of a Day

Instead of spending the day coding, I was stuck troubleshooting a
support case. These are my least favorite days.

The support case in question was about writing barcode image files into
a cfdocument.

But the page made a cfhttp call to the page the wrote the image file to
disk, then included it using an img tag. This made it hard to debug.

After enough fucking around with cflog, I narrowed it down to this
error:

Unable to create temporary file
java.lang.SecurityException: Unable to create temporary file at java.io.File.checkAndCreate(Unknown Source) at java.io.File.createTempFile(Unknown Source) at javax.imageio.stream.FileCacheImageOutputStream.<init>(Unknown Source) at com.sun.imageio.spi.OutputStreamImageOutputStreamSpi.createOutputStreamInstance(Unknown Source) at javax.imageio.ImageIO.createImageOutputStream(Unknown Source) at javax.imageio.ImageIO.write(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:87) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) at cfbarcoder2ecfm1376469513._factor6(/content/admin/htdocs/coldfusion/testing/consulting/supply/barcoder.cfm:104) at cfbarcoder2ecfm1376469513.runPage(/content/admin/htdocs/coldfusion/testing/consulting/supply/barcoder.cfm:5) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:375) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:288) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.CfmServlet.service(CfmServlet.java:175) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

Well, that's fucking ugly.

After lots of digging and trying shit (even tried setting the System property java.io.tmpdir - but nope, it's not writing to a file, it's writing to
memory), it came down to one issue.

<cfset temp = imageio.write(image, "PNG", baos)>

Where image is a java.awt.image.BufferedImage object, and baos is a java.io.ByteArrayOutputStream object.

Yep. It's not able to write to memory for some stupid reason. Oh, and it only happens half of the time.

Gotta love that stupid shit.

I did find one cool thing today, though.

Squad is a free online collaborative code editor. Q. How fucking cool is that? A. Very fucking cool.

There were a few other online editors, but this one is fast and has nice features. Nice work, guys!

User Journal

Journal Journal: Operation Obsolescence

Some people are a waste of space. And we know that the only thing keeping them there, always in our way, is the fact that there is a need for them. We love to hate them, but goddamnit, there is a need for them.

Enter Operation Obsolescence. If we can eliminate the need, in theory, that person should simply go away.

We begin by describing the mark's responsibilities:

  1. Monitoring servers
           
  2. Grepping through logs to find "bad actors"
           
  3. Creating data sources
           
  4. Responding to support cases
           
  5. Server planning and architecture
           
  6. Applying patches and hot fixes
           
  7. Monitoring disk space and usage
           
  8. Recycling servers
           
  9. Responding to monitoring alerts

Then, we carefully pick through them and figure out a way to eliminate these responsibilities, or at the very least, make them so trivial that there
is really no longer a need to have more than one person assigned to these tasks.

Of course, this is not a trivial issue in and of itself. If it were, it would have been done by now. That is not to say that it can't be done.

Let's talk briefly to the issues:

(1). We have alerts set up, and this should all be self-monitoring. If necessary, we can set up additional alerts to let me know of impending problems.
But on a deeper level, there should be no alerts. Yes, that is a fantasy, but I think I can come close to achieving this by attacking the issue at
the core: bad code. Having less of a tolerance for bad code could make the number of alerts drop significantly. How do we do this in our current
state of "Wild West" programming? By taking alerts more seriously. Instead of just recycling the cluster right away, find out what code is
responsible for it, then find out who owns it. If necessary, move it to the penalty box and isolate it. Help the developers refine their code - of
course, there should be tools for this. A code sweeper perhaps, but more likely, a way of tracking the performance and finding bottle necks (usually,
this is at the database level).

(2). I am already hot and heavy on developing a solution for this. It's a log grepper that spans logs and servers, and pulls out only what it needs
within a given time frame. This should help with (1).

(3). This process is somewhat automated, but I think it could be improved and made smarter to reduce time spent by at least half.

(4). This will always be an issue, but the smarter I get at this game, the faster I will get. Also, I need to be put on the main notification list so
I can attack them before the mark does.

(5). As I get smarter at the environment, I should be taking over this field entirely.

(6). Staying up to date with the bugs out there and knowing my environment will make me a master at this. Setting up a solid testing environment will
also aid with finding and fixing bugs, both inherent to the product, and bugs in my code.

(7). Again, we can set up more monitors, but those will only tell me when it hits a certain critical point. We need trends. We need to be able to
extrapolate data. Where are we headed next week? Next month? Next year?

(8). This is in the works. I have a temporary solution in place for development and testing environments. I can now recycle clusters from my
phone, which is nice, but I can make this process even slicker. I can tie this into the alerts so when I receive one, I click a link in the alert, it
not only recycles the cluster, but also populates a database with all that information. The more data we have on these things, the better we can
track trends and prevent it from happening again, or at the very least, anticipate it.

(9). This is covered in (8).

With all of these tools and procedures in place, most of the need for the second person should be eliminated and I can reign peacefully over my new
product while spending the bulk of my time coding.

Bliss.

User Journal

Journal Journal: Syncing IBM Lotus Notes to Google Calendar

The age old problem. Pulling the IBM dinosaur into the cloud.

So far, this has proven to be extremely challenging, due mainly to my company's restrictive policies.

Previously, I had it forwarding mail to Gmail, using the ALL rule, but that was swiftly crushed when they fucking disallowed it.

Assholes.

So now, I just want to do AT THE VERY LEAST, an export of Notes appointments into Gmail so I don't have to type it in manually.

I garnered some information from here: http://cfguy.instantspot.com/blog/2007/2/28/Syncing-Lotus-Notes-with-Google-Calendar

Here's what I've tried so far.
  • Notes iCal Support
    This was the original suggestion which would have allowed me to export events as iCal, but it wouldn't even install on my system.
  • lngooglecalsync
    This requires your Domino server be accessible via HTTP, and ours is not (that I know of). Version .4 is supposed to have this update, but as of now, it does not.
  • lngooglecalsync
    This requires your Domino server be accessible via HTTP, and ours is not (that I know of).
  • CompanionLink
    Need admin rights to install. Of course.
  • syncnotes2google
    THIS WORKS. BUT. It doesn't sync the location, which is almost a deal breaker. It does help me get at least the name of the event and the times in there, but I still have to include the location. There was also the issue of having to get the proxy in there using System variables, but that actually worked per the suggestion.

So, at least I have a partially working solution today. I hope it can be expanded on and work completely.

User Journal

Journal Journal: My Life in the Cloud

I am attempting to digitize my life. The goal is to make everything digital, archivable, searchable, and permenant. I would like to keep everything with Google, since they area stable company, and will be around for a long time to come. But they don't provide everything I need. So, in those cases, I use the best option, and back things up where needed. Here's my list so far of everything I have in the Cloud:
  • Email - Gmail
  • Phone and SMS - Google Voice
  • Passwords - Passpack
  • Bookmarks - Delicious
  • Web History - Google Web History
  • Maps - Google Maps
  • Calendar - Google Calendar
  • Contacts - Note, using the Facebook app for BlackBerry, you can manually go through each of your Facebook contacts and tie them to a BlackBerry contact. Then you can use Google Sync to syncronize them to your Google Contacts list. It's kind of a middle man way of doing it, but it's faster than typing them all out (like I did one night).
  • Finances - Mint
    One problem here has been getting Mint to work with my small hometown bank. As soon as this is resolved, I will be a happy camper.
  • Photos - There are a couple of challenges with storing my photos online.
    1. A lot of them are porn.
    2. A lot of them are just personal and I don't want stored online.

    To deal with this, I have a couple of things:

    • Flickr
      Flickr will backup my BlackBerry photos. I like this option because there is a Flickr app for BB, and it stores them as the original size.
    • Picasa
      Picasa will organize everything on my harddrive. That will work for my porn and personal pictures.
  • BlackBerry Instant Messenger -
    The new BBIM allows you to email whole chats, with the subject already in place. Setting up a filter on your Gmail will let you skip the inbox and archive these, and tag them with BBIM, giving you quick access to your old BBIM chats. Although not automated, it's a fairly quick process.
  • Documents - There a couple forms of docs I want to keep. Those that are already digital, and those in hard copy form.
    • Google Docs
      This will take care of the already-digital docs
    • Pixily
      Pixily will take my hard copy documents and scan them into searchable PDFs. These will be downloaded and backed up.
  • Chat - Google Talk - Saves all conversations (that are not off the record)
  • Books
    • Google Books
      This will let me search all my books.
    • Zoho - Zoho - I have all the books I own in a Zoho database. This might need to change though.
  • ToDo lists - Remember The Milk - With a BlackBerry sync tool, I am always on top of my ToDo lists.

There are a few things missing from this list. I will try to fill them in as I can.

PHP

Journal Journal: Project: CraigsBots, Part 1: Setting Up PostgreSQL With PHP

I've launched into a new statistics project that takes a look at Craigslist. I won't go into detail yet. You can find that in the report when I'm finished.

What I want to share here is how I got PostgreSQL working with PHP 5 and Apache 2 on Debian Lenny.

First there's the usual steps of installing all the packages. That's not hard to figure out. The hard part is getting it all talking.

First, set up the user with the password. (stolen from: http://hocuspokus.net/2007/11/creating-new-accounts-in-postgresql

Getting a new account set up on PostgreSQL is a simple process...

Create our new user:

$ sudo su postgres -c createuser karniv0re

Then you have to give this new user role a name (I called it daz), and then say 'y' to the question "Shall the new role be a superuser?" if you want the user to be an administrator.

Give the user a database password (this does not have to be the same as their unix password):

$ sudo su postgres -c psql
postgres=# ALTER USER karniv0re WITH PASSWORD 'mypassword';
postgres=# \q

Finally, give the new user a database to play with:

$ sudo su postgres
postgres@home$ createdb -O karniv0re mynewdatabase

Then create your SQL in a file and import it: SQL (stolen from http://www.devshed.com/c/a/PHP/PHP-and-PostgreSQL/1/)

CREATE TABLE addressbook (id serial, name varchar(255), address text,
tel varchar(50), email varchar(255));

INSERT INTO addressbook values (nextval('addressbook_id_seq'), 'Bugs
Bunny', 'The Rabbit Hole, Looney Toons, USA', '123 4567',
'bugs@wascallywabbit.net');

INSERT INTO addressbook values (nextval('addressbook_id_seq'), 'Robin
Hood', 'Sherwood Forest', 'None', 'robin@steal.from.the.rich');

INSERT INTO addressbook values (nextval('addressbook_id_seq'), 'Sherlock
Holmes', '221B Baker Street, London 16550, England', '911 1822',
'holmes@bakerstreetirregulars.domain');

Import it:

$ /usr/local/pgsql/bin/psql -d test -f /home/postgres/addressbook.sql

Now, you have to grant permission to the individual tables. I don't know a better way to do this, but this works.

$ sudo su postgres
postgres@home $ psql
postgres=# grant all privileges on database mydbname to
karniv0re;
postgres=# grant all privileges on tablename1 to karniv0re;
postgres=# grant all privileges on tablename2 to karniv0re;
postgres=# grant all privileges on tablename3 to karniv0re;
postgres=# grant all privileges on tablename4 to karniv0re;
postgres=# grant all privileges on tablename5 to karniv0re;

And we're good to go.

Programming

Journal Journal: Things Learned From the Scheduler Project 1

The report scheduler project I have been working on for the last 6 months has taught me a LOT about the software engineering process.
  1. Gather concrete requirements at the beginning and stick to them. Give customers solid, realistic dates for each one. This way, if a requirement changes, the added time in refactoring code is their fault and they have to suffer for it, not you.
  2. Test Driven Development. This is my new mantra. Test All The Fuckin' Time. TATFT. LIVE BY IT. Design your product. Write your tests. Write your product in small increments, making individual pieces work and work well. The sum of these well-oiled parts will become (typically) a well-oiled whole - as opposed to you getting fucked in your not-so-well oiled hole. Sorry, was that too much? IT'S TRUE! TDD! TATFT!
  3. Task Lists. If you have trouble staying on task (like I do), task lists with hard deadlines on them could help. It can also keep you organized and lets you prioritize your tasks, which can make a huge difference in what gets done and when. Plus, it's nice to see all the stuff you've checked off as a measure of progress.

This is just a small list of things I wish I had done. Overall, my code was done very well, but the lack of testing really hurt the process. I used a lot of cool encapsulation techniques, such as an MVC architecture in ColdFusion, and kept all the pieces in their place. Database writes are done in one place and one place only (Model), the ugly JavaScript glue is kept in one place (View), and the Ajax calls are made to and handled by a middle party (Controller). And I have it email me on errors so I know what's going on at all times.

The good news is, my list of "wish-I-had-dones" is getting smaller, so I'm learning from old mistakes. I just need to apply more to the software engineering side of things and take it more seriously. Especially when it comes to dealing with customers.

User Journal

Journal Journal: Lotus Notes Sucks, Scheduler, Productivity, and Miscellany

Never Use Lotus Notes Again

I made the best discovery last night. Though it comes a little bit late, it's better than never. Lotus Notes can forward ALL your email to any address. I chose Gmail of course. I know I've tried this before, the but the option didn't exist. It does now (Lotus Notes Version 7).
  1. Open your mail
  2. In the left panel, expand Tools
  3. Click on Rules
  4. New Rule
  5. WHEN: All Documents send Full Copy to

And that's it!

You can also set up Gmail to send mail as your Lotus Notes addy, but it will only put that in the "Reply To" field. Users can still see that it was sent from Gmail, so this may not be advisable.

Scheduler Discoveries

I should have done a Google Code Search before starting this project. Goddamnit. I should have thought about the countless number of schedulers that have been built in the past. I can still benefit from this though. Improvements can still be made.

Productivity

Along with forwarding all my LN mail to Gmail, I've been applying a lot of filters and aggressively archiving. Trying to reach that fabled Inbox Zero. I've achieved that task. 16,000 emails, down to 0. I'm not sure if that is productive at all, and I could give a shit less what Merlin Mann has to say. But, it was fun, and it does feel a little more organized. Filters are good. I will be using them more from now on.

Other than that, I just wanted to write here, because I haven't in a while. Many new things are on the horizon, including some potential freelance opportunities, which will involve Ruby on Rails. I started diving into RoR and I am impressed and intrigued so far. Can't wait to get into it a little more.

Security Initiative 08 Recap

I should also recap Security Initiative 08. I didn't get everything done that I wanted to, but it also hit a point where I stopped caring. I did catalog all my books and clothes, though new items purchased since have not been added nor have I backed up the database. I have been doing a better job of keeping my doors locked, though I occasionally slip up or don't double lock it like I should. Hard drives haven't been completely encrypted, but I have been at least taking some steps in this fight. Network security hasn't been assessed yet. This is still a big todo that may never get done. Finally, my place is still a fucking wreck. It's hard to keep shit cleaned up and maintained when you have little free time. I suspect this will continue long into the year.

That's it for now. Peace out, bitches.

Unix

Journal Journal: Lines of Code Counter 2

Here's a quick little script that counts all the lines of code in my ColdFusion projects.

It can easily be adjusted to count other files.

#!/bin/bash

# Count lines of code starting at the parent directory

xmlfiles=`find . | grep "\.xml$"`;
cfmfiles=`find . | grep "\.cfm$"`;
cfcfiles=`find . | grep "\.cfc$"`;
jsfils=`find . | grep "\.js$"`;

total='0';

for file in $xmlfiles
do
total="$total + `wc -l $file | awk {'print $1'}`";
done

for file in $cfmfiles
do
total="$total + `wc -l $file | awk {'print $1'}`";
done

for file in $cfcfiles
do
total="$total + `wc -l $file | awk {'print $1'}`";
done

for file in $jsfiles
do
total="$total + `wc -l $file | awk {'print $1'}`";
done

echo $total | bc -q

Slashdot Top Deals

"Engineering without management is art." -- Jeff Johnson

Working...