Monthly Archives: July 2012

Write or Die Redux

I was doing 250 words a day as a goal, but Jen and I signed up for stickK together.  It looked like a time commitment would work better with their site than a wordcount commitment, so I said ten minutes a day/an hour a week.

This works a lot better than I expected.  I almost always write more than 250 words, and I feel like I’m making a lot of progress on the story I was working on.  I plan to up the time later to a more ambitious number.  (Jen chose five hours a week.  There’s no way.  I’d be setting myself up to fail.)

I also signed up to run more than 134 minutes a week.  I usually run 3-4 days a week for 45 minutes at a time.  This is also going well.

I didn’t even put money on either one!

Future running goals include running outside (right now I’m treadmill only) and eventually signing up for a race.

Comments Off on Write or Die Redux

Filed under writing mysticism

True Confessions

I run Nagios at home.  It texts me when my machines need patches.

I told this to a charming gentleman who was my dinner companion for the evening and he gave me a look that implied that I was not all there.  (He’s a Nagios admin, too, but not willingly.)  I found myself spluttering defensively, “I’m testing things for work!”

It’s absolutely true that I’m testing things for work.  In fact, I just set it up to check and make sure work’s email and web were up today, because they lost connectivity earlier this weekend.  But it’s also true that it’s fun.

My home Nagios server also Twitters.  I don’t remember if I told the charming gentleman that or not.  I suspect that I did.

Maybe I shouldn’t tell him about the webcam that tweets whenever someone is in my driveway.

Comments Off on True Confessions

Filed under monitoring

Clearly, you’re doing it wrong.

So, I have this friend.  (No, really, it’s my friend, it’s not me, I set up my own Nagios server.)  She’s a DBA with no responsibility for anything outside of a bunch of SQL Servers. Nagios wakes her up in the middle of the night if the web server goes down.

If you page people in the middle of the night over things that aren’t their responsibility, you’re just training them to ignore their pagers.  I once worked with someone who was, according to legend, the only person ever to work at [name of company redacted] ever to successfully flush a pager.  (And they didn’t even have Nagios at that time!)

I feel the same way about people who receive daily “CRITICAL!!!” emails that their servers’ drives are 98% full.   Nagios is supposed to be informing you about things that are unusual.  If your SQL Server typically uses 96% of its RAM (mine do), don’t turn off warnings and only receive notifications for critical, and don’t receive daily emails saying that the servers are using too much RAM.  Up the thresholds to sane numbers that indicate an unusual condition.  What do you think happens if, in the slew of daily emails about “CRITICAL!!!” there’s a disk that usually isn’t 100% full, or a service down, or a memory leak?  No, no.  You don’t want your slew of “Situation Normal:  All Frelled Up” emails, you want to know when something unusual is occurring.

If you’re like me, you resist this. “Dammit, my C: drive should be at least 20% free!”  There comes a time when you have to accept that a number is not an attainable number and work from there.

Comments Off on Clearly, you’re doing it wrong.

Filed under monitoring

Tea

We interrupt your regularly scheduled computer geekery to bring you tea.  I’ve been really getting into tea lately.  Also, caffeine abuse is a vital component of geek culture, and tea is relatively neglected (unless you’re steampunk).

So.

Loose leaf, my darlings.  It’s so much nicer.  It may look expensive, but it’s only a teaspoon (hence the name) per cup.  I have a relatively cheap glass teapot at the office.  Generally, I’ve found that the more intact the leaves are, the more likely I am to like it.  I hear this is because the more intact leaves have essential oils that evaporate if the leaves are crushed.  I will drink tea bags or Keurig tea, but given a choice I’d much rather have loose leaf.

I’ve found I don’t like drinking the exact same thing day after day, so I have a collection. I drink black tea in the mornings, green tea in the afternoons, and white tea in the evenings.  Except when I don’t, on impulse.

Black tea:  I’ve been doing this British style, more or less, with milk.  Well, with soymilk or soy creamer, either of which is probably heresy, but I’m okay with that.  Current favorites here include Twining’s Lady Grey (loose), Teavana Black Phoenix Pearls, and Republic of Tea’s 2oth Anniversary Celebration and Rose Petal Black Full-Leaf.

White tea:  I generally like flavored white teas.  Octavia Tea Company has strawberry and wild blueberry teas that I like a lot.  Rishi has rose petal white tea.  Silver needle by anyone (I think I’ve had Teavana, Rishi, and Octavia)  is also really nomalicious.

Oolong:  I’ve really only had Octavia Tea’s Amber Dragon, which was good.

Green tea:  I think that I prefer my green tea unflavored, although I do like Jasmine Pearls (which I’ve had from Octavia and Teavana).  Thus far I’m liking Gyokuro Imperial Green and Dragon Well.

I’m also eying fancier teapots, although a lot of those require you always drink the same kind (black, green, etc.) because the pot seasons to the variety.

Have some tea vendor links:

 

Comments Off on Tea

Filed under Uncategorized

Blast from the past!

I finally reached the central conflict on the story in progress!  As one of my nieces’ other aunts pointed out, some add clay to an armature and some chip at stone.  I’m usually the former.  Which is why the amount of whacking I’m going to have to do on this one is so disconcerting.

In other weed-whacking news, it occurred to me that the hurricane story I was working on in 2007 anticipated the Occupy Wall Street movement, and I may have to fish it out and try (again!) to finish it with that in mind when I’m finished with this one.  Note to self:  Less (or no) cyberpunk, more politics.

Comments Off on Blast from the past!

Filed under writing mysticism

Tracking total file usage, DBs only.

Yes, I’ve been bad about updating.  I was traumatized by a bunch of friends getting laid off from a former employer, and then I had two very busy weeks.

This system of tracking total file usage, DBs only, came up talking to someone recently (Eric, are you reading this?) and I thought I would share.

First, there’s the query to get SQL Server to tell you how much space it’s using.  Sure, you could map the drive or remote out to the server (unless, you know, you can’t), but this is a good sanity-checking number that you can compare to what the OS says you’re using.  I had an issue recently where that was handy information.  I may have downloaded this off the internet somewhere, or may have written it.  I forget which.  So, if I just stole your query and posted it as my own, I’m sorry!  (I did Google and didn’t find it.)

declare @totalsize float,
@bytes float,
@kb float,
@mb float,
@gb float,
@tb float

CREATE TABLE #temp
(
size int
)

insert into #temp (size) EXECUTE sp_msforeachdb ‘SELECT size FROM [?].sys.database_files’

select @totalsize = SUM(size) from #temp
set @bytes = (@totalsize * 8192)
set @kb = (@bytes / 1024)
set @mb = (@kb / 1024)
set @gb = (@mb / 1024)
set @tb = (@gb / 1024)

drop table #temp

–print @totalsize
–print @kb
–print @mb
print @gb
print @tb

(Download.)

You can tell by which two aren’t commented out the data sizes I’m generally dealing with. Comment or uncomment as suits your situation.

Well, that’s fine and dandy, but you might have more than one server, or more than one instance, or you might want to track those numbers over time (which is what I was going for, yes).  I do, so I have a table:

CREATE TABLE [dbo].[datasize](
[id] [int] IDENTITY(1,1) NOT NULL,
[instance] [varchar](50) NULL,
[datasize] [float] NULL,
[dateadded] [datetime] NULL,
CONSTRAINT [PK_datasize] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[datasize] ADD  CONSTRAINT [DF_datasize_dateadded]  DEFAULT (getdate()) FOR [dateadded]
GO

(Download.)

I generally store the GB number in the datasize column, because some instances are bigger than others (GB is my smallest sane number), but you can store whichever size is meaningful for your situation.  Just, you know.  Always store the same measure (duh, you knew that).

Sadly, I have not yet automated populating this table because I’m working across two domains that don’t trust each other, so I’m C&Ping the results from six instances.  That’s not that bad.  You could probably easily automate that, though.  I’m automating tracking log size and usage (for reasons I may address later), so, you know.  Easy peasy.  Make SQL Agent do it for you. (I’m a sysadmin.  We’re lazy.)  Especially if you have, like, a million instances.

Okay, so you have this data.  Now what?

I have a view that’s the current data:

CREATE VIEW [dbo].[current_size_by_instance]
AS
SELECT     instance, datasize, CONVERT(varchar, CAST(DATEDIFF(dd, 0, dateadded) AS Datetime), 110) AS date
FROM         dbo.datasize
WHERE     (dateadded >
(SELECT     MAX(CAST(DATEDIFF(dd, 0, dateadded) AS Datetime)) AS Expr1
FROM          dbo.datasize AS datasize_1))

GO

(Download.)

Make SQL sum or average or any other kind of slicing and dicing you want there. However, the really shiny part for me is tracking data usage:

CREATE TABLE #filegrowth (instance varchar(255), maxdata float, mindata float, maxdate datetime, mindate datetime)

insert into #filegrowth (instance, maxdata, maxdate)
(select instance, datasize as maxdata, dateadded from CPMaintenance.dbo.datasize where dateadded  >
(SELECT     CONVERT(varchar, MAX(dateadded), 112)
FROM          Maintenance.dbo.datasize))
insert into #filegrowth (instance, mindata, mindate)
(select instance, datasize as mindata, dateadded from Maintenance.dbo.datasize where dateadded  <
(SELECT     CONVERT(varchar, MIN(dateadded) + 1, 112)
FROM          Maintenance.dbo.datasize))

select instance, (MAX(maxdata) – MAX(mindata)) as filegrowth, datediff(d,(max(mindate)),(MAX(maxdate))) as timeframe_in_days from #filegrowth group by instance
union
select ‘total’ as instance, (SUM(maxdata) – SUM(mindata)) as filegrowth, datediff(d,(max(mindate)),(MAX(maxdate))) as timeframe from #filegrowth

drop table #filegrowth

SELECT sum(datasize) / 1024 as TB, CONVERT(varchar, CAST(DATEDIFF(dd,0,dateadded) AS Datetime), 110) as date
FROM Maintenance.dbo.datasize GROUP BY CAST(DATEDIFF(dd,0,dateadded) AS Datetime)

(Download.)

I actually have that as a stored procedure so I don’t have to open a file to load a script. (Lazy!)  So, you can, too.  Just paste that as the main part of the procedure into CREATE STORED PROCEDURE SP_OMGLAZYBUM and go from there.

And yes, this is in addition to SQL Monitor and Nagios.  But it came in handy recently.  We were having DAS issues and there was some question about SQL’s file usage, and I was able to confirm based on numbers from last week and fresh numbers that yes, those are sane numbers.

Comments Off on Tracking total file usage, DBs only.

Filed under monitoring

Those Special Moments

I’ve already had that special moment when you realize that you’re probably going to cut 6,000 words from your short story in progress. Today I had that special moment when I realized that I’ve written 13,000 words and haven’t reached my central conflict yet.

This is the point where my ex would traditionally inform me that I was writing a novel. Nope. I think it just took me this long to figure out where the hell this thing is going.

Comments Off on Those Special Moments

Filed under writing mysticism

I’m in the BroadPod again!

I read an excerpt from “The Last Wasicu” in the Broadpod, here.  It’s one of my favorites of mine.

Comments Off on I’m in the BroadPod again!

Filed under Uncategorized

New Author Photos!

These were taken by Luke McGuff at Wiscon this year.  You can see the entire collection here:  Wiscon Photo Booth.

Comments Off on New Author Photos!

Filed under Uncategorized