Getting System Information from Linux
November 10, 2008 on 3:37 pm | In Programming | By QBasicer | 2 CommentsMost of the information I gather for my Linux version of my uptime program comes from procfs.
/proc/sys/kernel/hostname
Provides me the one word hostname of this kernel. I’m planning on switching this and /proc/version to a uname() syscall (see man 3 uname) to provide better compatibility on systems without /proc.
/proc/uptime
Provides me the raw number of seconds (including factional) since the computer booted, as well as the total number of seconds this computer has been idle (the second bit I discard)
/proc/loadavg
Provides me with the three load averages
/proc/version
Provides me with a long kernel version, which is different than the one supplied by uname -a.
/proc/meminfo
I get all of my memory information from here, but I don’t use all of the information available to me. Most of it is pretty useless, but I do get:
- Total Memory
- Buffered Memory
- Cached Memory
- Free Memory
- Total Swap
- Free Swap
I get ‘memory used’ from the formula: “int memused = memtotal – cached – buffers – memfree;”
Please Make it Stop!
November 4, 2008 on 1:38 pm | In Personal | By QBasicer | 2 CommentsWhy am I continually assulted with an election that gets more press coverage in Canada than Canada’s own election? People complain about Canadian Politics, but that’s because everybody’s so fixated on the wrong country.

Managing Computer Health in Multiple Places
October 31, 2008 on 10:27 am | In Programming | By QBasicer | 2 CommentsI have a few computers under my control. Unfortunately, not all of them are in the same room. Actually, most are spread all around the country. I have essentially two computers under my direct control, with a few others that I tend to use.
It becomes very important when you start needing these computers to do tasks, such as serve up websites, provide SSH servers, or other such services. Unfortunately, power interruptions, and crashes do happen. A lot of times, if a server goes down, you need to wait until you can get somebody to physically press the button if it’s remote, or provide some details on network access (did just the network go down, or did the actual computer go down, or both). Collecting information about a server after it has gone down is a trivial task, just look through the logs. The big crunch here is, what about real-time outage information? Having a server “ping” a webpage every 5 minutes, uploading the latest load average, memory information, disk usage, uptime, and system log information should provide adequate information to provide a decent report on system health.
Over the weekend, I want to see if I can write some code and set up a little site where I can monitor all my computers, and maybe even try and send commands to them (security and authentication being somewhat of a problem here).
Update: I started work on this on the weekend, and I already have it working. Visit data.vectec.net/uptime for live uptime information for three of my Linux computers (Mac OSX coming soon I hope).
I Usually Stay Outta This…
October 22, 2008 on 12:15 am | In Uncategorized | By QBasicer | 1 CommentMeant for twitter
October 21, 2008 on 9:05 pm | In Uncategorized | By jason | No CommentsSteve probably isn’t going to vote because: John McCain is a loser and Barack Obama is stealing his “thin is in” look.
Struggle For More Pixels
October 19, 2008 on 12:48 pm | In Personal | By QBasicer | 3 CommentsAnybody that uses a computer a lot, usually would agree that there’s just never enough pixels on the screen to do what you want. This term, my old roommate left his monitor behind, and I’ve taken it into my room for use with my laptop. My laptop’s display is 15.4 inch widescreen, with a native resolution of 1280×800. The current monitor I’m using has a native resolution of 1680×1050 (just shy of 1080!), however, sometimes even that doesn’t feel like enough. Having a dual monitor setup is perfect, but I wish it worked better in Linux for a setup where both monitors might be a different size.
X seems to think that the best way to do this is to make a square screen, even if one screen is taller pixel-wise than the other, meaning I don’t get the bottom of the screen on the smaller monitor. The other side-effect here is that the KDE panel goes across the bottom all the way, even if I wanted it just to be on one screen (Windows does this, and it’s a feature I like). Dual monitors is something Windows gets right, and Linux absolutely fails at. Then again, there might be a solution I don’t know about. At work, I have a nice setup. I have a nice large square screen, and spend all day in VMWare, so switching around VMWare has become second nature.
I’m also thinking within a year I’m going to have to get my laptop replaced. Heat has became a big issue for it, and even a chillpad struggles to keep it cool. I’ve tried dusting it a couple times, but unfortunately the air circulation on it has never been that great. I have the most problems when running something that gives the GPU a pretty good workout, usually pushing the sensor temps over 100C, and making the bottom of the laptop too hot to touch. In my dual monitor setup, I must remember to keep the laptop lid open, even if the screen is in use to promote air circulation.
Who Turned Off the Pump?
October 11, 2008 on 3:34 pm | In Ottawa Adventures, Personal | By QBasicer | 2 CommentsEvery weekend, my friends and I go to a pub called “The Lieutenants Pump” for bunch at about noon. Last week we got this letter:
Dear Valued Patron,
I regret to inform you that the Lieutenant’s Pump has been assessed a two day Liquor license suspension by the Alcohol and Gaming Commission. The Commision found us guilty of being over capacity by five people on the patio during last years Stanley Cup Finals.
On the night of the infraction, we did everything in our power to control the patio but did not foresee people jumping the fence. We had staff supervising the patio and when people hopped the fence they were immediately escorted off.
We were not aware at the time that this would be considered insufficient by the Commission. Somehow, the Commission expected us to prevent the fence jumping. Short of barbed wire and electrification I’m not sure how this could have been accomplished. None the less, in its wisdom the Commission has concluded that the suspension is warranted as a general deterrent to other operators and as a specific deterrent to us letting it happen again.
The Lieutenant’s Pump will be closed October 11, 12 and 13 which is Thanksgiving weekend including Monday.
I apologize in advance for any inconvenience this closure will cause. Any concerns about this situation should be directed to:
Ted Meekin
Minister of Government and Consumer Services
4320 – 99 Wellesely St. E.
4th Fl. Whitney Block
Toronto M7A 1W3416 – 327 – 6611
TmcMeekin.MPP@Liberal.OLA.ORG“See You At the Pump”
<SIGNATURE>
John Couse
Owner
Great debates! Tabs
September 27, 2008 on 4:57 pm | In Uncategorized | By jason | 2 CommentsI’d like to talk about a growing trend which has been displeasing me lately: Tabs. They’re everywhere! Well, maybe not everywhere. Really the kinds of tabs I want to talk about are the ones made common by web browsers like Firefox or Safari, etc. but which are also showing up in apps like Photoshop and other non-browser apps.
Now, I’m not talking so much about say, a Settings window for an app, where different settings are on different tabs, grouped by relevance. Grouping functions of an application together on a tab is not what my gripe is about. That seems fairly appropriate to me. My gripe is with grouping documents into tabs.
So let’s move on with the classic example: the modern web-browser. You can click a link and have it open (optionally) in a new tab (there are other ways of creating tabs but I’m sure we all know them, and it’s really unimportant here). This typically reveals a tab bar, with small rectangles titled for each tab you have open, also bearing a small icon for dismissing the tab. Most modern tab bar implementations allow you to re-order the tabs and also expand them into full windows (otherwise the tab acts as a child to its window). When a tab is selected in the window, it is the sole document the user may view in that window. This is the basic idea of tabs which I’m sure we’re all familiar with.
Here’s my problem with tabs: Let’s say I’ve got Safari open, one window containing 5 tabs. I want to switch from my email tab to my news tab. I’ll just use alt/cmd-tab to switch to new. Ironically, this functionality is busted because I’m using tabs. Also, things like Exposé on the Mac (and I’m sure Compiz on Linux) are broken when it comes to tabs because, they deal with windows and not tabs.
Let’s take a breather here. Yep, most every tab implementation I’ve seen has a keyboard shortcut for switching between tabs. Sadly, these are all different shortcuts most of the time. And even if they are the same in different apps, it’s still not the cmd/alt-tab we’re so accustomed to. And hey, Firefox is pretty extensible, so maybe there is a hack to get it to co-operate with alt-tab, but that only solves the problem for Firefox, not all tab apps.
If you don’t use a keyboard, you’ve now got to hit those ridiculously small rectangles in the tab bar. Let me explain ridiculously small, I’m comparing the target size of the tabs to the target size of entire windows (which, as you may remember, is what we had before tabs). So I’m saying, if I have three windows onscreen at once (tiled in some manner, not full screen), each one of those windows is orders of magnitude easier to hit (and therefor switch to) with a mouse than is a tab.
I don’t think tabs are all bad. I think the real problem lies in the paradigm associated with them. The general paradigm seems to be something like “My browser is fullscreen and I have 3 tabs open, one for every task I’m currently focusing on”. However, if you work more like “I have 3 windows open, one for each task with tabs briefly opened in each window when it is appropriate” then it’s much easier (as I’ve explained) to switch between them. I’m not saying “do away with tabs altogether”, but I am saying tabs should should only be used temporarily, and only when relevant to that window’s task.
It often happens one of my tasks is researching a certain topic. Given my paradigm for browsing, I’ve got a window open with Wikipedia and one with Google Docs. As I read wikipedia, I’ll sometimes open a new tab to read on a related subject, close it, and then switch to my Google Docs window to write something about my topic. The different areas of focus stay separate and tabs are only used briefly, like an extra buffer or scratchpad for any given task.
I’m interested to hear your thoughts on this one, because I know tabbed applications like browsers are one place we all spend a lot of time.
Getting Lost
September 5, 2008 on 8:05 pm | In Personal | By QBasicer | No CommentsI had a meeting with a company this morning at 10:30 in a part of the city I’ve never been to before. Between Google Maps and OC Transpo’s trip planner, I was about to figure out approximate times and buses I’d have to take. Since the meeting was at 10:30, I obviously didn’t want to be late, so I targeted to be there about 10:00. Both websites said the latest I could get there, without being late, was 9:00.
I woke up early at 6:45, and got up about 8:00, got showered, etc, and left by 8:30. I jumped on the 96 to Bayview, hopped off, and picked up the 182 to where I thought the building was (according to Google Maps). I started in search for a Tim Hortons, found one, but the line was ridiculously long. I started back to the building. When I got to the building, I remembered the email said suite 300. I get to suite 300, but it’s not that company. I try looking it up on my cellphone through webmail, the my phone was rejecting the webmail’s server certificate. Great. I do a quick google, and find a result for a building down the road, so with 20 minutes to my interview, I hike it about a kilometer to the other building. Upon reaching the elevator of this 7 storey building, and I got in and pressed floor 3. She started to press floor 3, then realized I already had. Knowing about the meeting today, she asked if I was the person whom had the meeting.
The meeting went fairly good, about 50 minutes long. I left the building, and went to the bus stop, and waited for about 15 minutes for a bus to arrive. A 15 minute bus ride to a transit terminal, and I took a bus back home. It took me about an hour and 20 minutes to get home, and in 30C heat with 35C humidex. I probably covered about 5.5 km (3mi) of walking today, but I could do with the exercise.
Questionable
September 4, 2008 on 5:44 pm | In Personal | By QBasicer | No CommentsOne thing I’ve always said I was going to do, is read all the archives of Questionable Content, a daily web comic. When I first saw in on April 1st, I thought it looked really cool. I decided that I’d read right from the beginning, but with 1,200 comics, that isn’t an easy feat. I recently had a small three week vacation before I flew out to Ottawa, so I took 3 days, and read about 300 comics a day. I can safely say I’m caught up, and I highly recommend the comic to other people.
Also, sorry for the lack of content of late. The well of ideas is kinda dry right now. I start a new job on monday, so maybe that will give me something to talk about.
Powered by WordPress with Pool theme design by Borja Fernandez. I rewrote the CSS because I'm cool like that.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
