Thursday, August 13, 2015

Conky With a Vengeance

Yet another little tinker update on the Conky config since the last one.

Here's the full .conkyrc. Of course blogger munges the output, so I've noted long lines with the character; there should actually be no line break on those lines:

background no
font Sans:size=8
use_xft yes
xftalpha 0.9
update_interval 5.0
total_run_times 0
own_window yes
own_window_type normal
own_window_argb_visual true
own_window_argb_value 196
own_window_transparent no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 220 1200
maximum_width 220
draw_shades yes
draw_outline no
draw_borders no
border_inner_margin 5
#border_inner_margin 20
draw_graph_borders yes
default_color CDE0E7
default_shade_color black
default_outline_color green
alignment top_right
gap_x 12
gap_y 0
no_buffers yes
uppercase no # set to yes if you want all text to be in uppercase
cpu_avg_samples 2
override_utf8_locale no

TEXT
${voffset 1} ${voffset -1}

${color gray}${font Sans:size=10}${voffset 5}${time %d-%b-%Y}${font}
    ${font Sans:size=12}${voffset -5}${alignr}${time %I:%M %p}${font}

${color white}SYSTEM ${hr 1}${color}
Hostname: $alignr$nodename
Kernel: $alignr$kernel
Uptime: $alignr$uptime
MB Temperature: ${alignr}${iconv_start UTF-8 ISO_8859-1}
    ${exec sensors|grep 'Physical id 0'|awk '{print $4}'}${iconv_stop}
CPU Temperature 0: ${alignr}${iconv_start UTF-8 ISO_8859-1}
    ${exec sensors|grep 'Core 0'|awk '{print $3}'}${iconv_stop}
CPU Temperature 1: ${alignr}${iconv_start UTF-8 ISO_8859-1}
    ${exec sensors|grep 'Core 1'|awk '{print $3}'}${iconv_stop}
CPU Temperature 2: ${alignr}${iconv_start UTF-8 ISO_8859-1}
    ${exec sensors|grep 'Core 2'|awk '{print $3}'}${iconv_stop}
CPU Temperature 3: ${alignr}${iconv_start UTF-8 ISO_8859-1}
    ${exec sensors|grep 'Core 3'|awk '{print $3}'}${iconv_stop}
Fan 1: ${alignr}${hwmon 1 fan 1} RPM
Fan 2: ${alignr}${hwmon 1 fan 2} RPM
GPU Temp: ${alignr}${exec nvidia-smi | grep '. ..\% ..C'|
    awk '{print $3}'}${iconv_start UTF-8 ISO_8859-1}°${iconv_stop}C
Processes: ${alignr}$processes ($running_processes running)
Load: ${alignr}$loadavg

${color yellow}CPU LOAD ${hr 1}${color}
${color b0b000}CPU Frequency: ${alignr}${freq} MHz
CPU1 ${alignr}${cpu cpu1}%
${cpubar cpu1}
${cpugraph cpu1 000000 ffffff}
CPU2 ${alignr}${cpu cpu2}%
${cpubar cpu2}
${cpugraph cpu2 000000 ffffff}
CPU3 ${alignr}${cpu cpu3}%
${cpubar cpu3}
${cpugraph cpu3 000000 ffffff}
CPU4 ${alignr}${cpu cpu4}%
${cpubar cpu4}
${cpugraph cpu4 000000 ffffff}
${color b0b040}CPU All
${cpugraph cpu0 000000 ff0000}${color}

${color 30b030}RESOURCE USAGE ${hr 1}${color}
${color 30b030}RAM ${alignr}$mem / $memmax ($memperc%)
${membar 4}
Swap ${alignr}$swap / $swapmax ($swapperc%)
${swapbar 4}${color}

${color gray}Highest CPU $alignr CPU% MEM%${color}
${top name 1}$alignr${top cpu 1}${top mem 1}
${top name 2}$alignr${top cpu 2}${top mem 2}
${top name 3}$alignr${top cpu 3}${top mem 3}

${color gray}Highest Memory $alignr CPU% MEM%${color}
${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}

${color white}FILE SYSTEM ${hr 1}${color}
Root: ${alignr}${fs_used /} / ${fs_size /}
${fs_bar 4 /}
Files: ${alignr}${fs_used /files} / ${fs_size /files}
${fs_bar 4 /files}

${color white}NETWORK ${hr 1}${color}
Eth0: ${addr eth0}
Down ${downspeed eth0} k/s ${alignr}Up ${upspeed eth0} k/s
${downspeedgraph eth0 25,107} ${alignr}${upspeedgraph eth0 25,107}
Total ${totaldown eth0} ${alignr}Total ${totalup eth0}

Friday, August 7, 2015

Superuser, Moderation, and Should I Bother

I just noticed tonight that an answer I did on superuser.com has been moderated into oblivion. It had 17 up votes, earning a "Nice Answer" badge, so some people at least felt it was useful.

While I can understand the intention behind the aggressive pruning that occurs, it's just...really disheartening having put some effort into answering as best I could in a precise, useful way, only to have it shitcanned. Especially when to my way of thinking there were a number of things in the answer that would have more longevity than other questions that survive just fine on SU.

So, for posterity, here's my answer. The question was regarding any potential issues with the asker's new PC build, which included common parts like an i5-4570, Gigabyte B85M-D3H, Kingston RAM, GT610, WD Green, and a fairly crappy looking case/PSU combo.

There are a couple of general rules of thumb you should follow when speccing your machine:

  • Don't cheap out on the power supply. I have no idea what is included in that case (specs are not forthcoming), but the price is so much cheaper than many budget cases that come with no power supply, I'm inclined to think that it is very low quality. Unless you are in dire need to save money, look for a separate PSU like a Seasonic. Many Antec or Corsair PSUs are good, as are some Coolermaster or Thermaltake. If you need to get a case/PSU combo due to budget, look for something like the Thermaltake Versa series.

  • Current onboard graphics (which is built into the CPU and accessed via the ports on the motherboard) is better than a low-end GPU like the GT610. Age of Empires doesn't need much graphics power, so I think you'll be fine with onboard graphics. The disclaimer is perhaps you want a cheap GPU for experimentation purposes, targeting your software to particular graphics card or something.

  • The CPU and the GPU are the two biggest parts that determine what kind of power supply you need. The system as specced above will use <150W even at maximum load. A good quality 350-450W PSU is where you should be looking, unless you want to support upgrade to a high-end gaming graphics card in the future — if so, look for 500-600W.

  • The motherboard you have chosen can only run RAM at 1600MHz, so the 1866MHz will clock back to that anyway. You could get a 1600MHz with CL9 timings (lower the better for timings), only a very minor difference in performance though.

  • Most modern consumer CPU/motherboard use dual channel RAM, you will get a mild performance boost by getting 2x4GB of RAM.

  • Get an SSD if you can and install the OS/applications on it. Use the HDD for storage. SSDs are awesome, particularly if you do dual-boot, as they reduce boot times and application load times significantly.

  • If you can't get an SSD due to budget, don't use a 5400RPM hard drive like the Caviar Green as your boot drive, they are very slow. A WD Caviar Blue (for example) is a better option.

  • Consider a Virtual Machine for doing the Linux development if dual-booting gets annoying. Unfortunately VMs are bad for games, so you can't really do it the other way around. Alternatively, you could consider running the games under wine in Linux. AoE III for example appears to have pretty reasonable support. Dual-booting is pretty annoying in my experience if other options are available.

Edit:

  • Since it's your first time putting one together too, I'd suggest watching a few videos on how to do it (search youtube for "how to build a computer" or similar). Will give you a feel for how everything fits together.

The whole thing is still available in the google cache in case anyone is particularly interested.

Saturday, June 13, 2015

Retro Reviews: Logitech G105 and K290

I got these keyboards nearly two years ago but only just found my notes on them, thought I'd post it anyway.

G105 Initial Thoughts: It's a rubber dome keyboard, so the keys are a little bit "squishy", but not too bad overall. It has LED backlighting if you want it — the LEDs are not very bright though. Lots of keys for gaming macros or whatever. The position of the keys down the left-hand-side was somewhat annoying at first until I got used to them.

The G105 has survived nearly two years of gaming use without fault, so its longevity seems reasonable. A lot of my other Logitech peripherals have failed at or before this period, so I'm a bit wary of the brand at the moment but this particular keyboard seems okay. The feel of the keys is not really any better than a $20 keyboard, so you have to balance up whether the extra macro keys and backlighting (and potentially the longevity) is worth a $50 keyboard.

K290 Initial Thoughts: Has a fairly hard, angular wedge shape. The bright blue USB cable doesn't look very good. The feel of the press on the "low profile" keys is difficult to get used to. It's difficult to describe, but the keys feel gritty or chalky to press, like you're pushing them through a crumbly layer of dried mud.

Appearance and feel aside, the thing I like least about the K290 is that to use the function keys (F1, F2, etc), you need to hold down the Blue "FN" key. Really awkward when on the vast majority (all?) keyboards the F keys are the default. This is the most difficult thing to get used to when swapping between other keyboards.

While the K290 has worked fine so far, I wouldn't buy it again due to the negatives I found while using it.

Don't have a pic of the K290 unfortunately, the above image and link is to the Logitech product page

Saturday, June 6, 2015

Review: Deepcool Tesseract

Recently used this case in a general purpose machine for a friend. At only A$49 it's at the budget end, but for what you get it's pretty good value. With 165mm CPU and 310mm GPU clearance it'll fit most setups.

For whatever reason, the Tesseract listing on Deepcool's website doesn't show the windowed version of the case, only the regular version.

Positives
  • Lightweight, but doesn't feel too flimsy.
  • The fans have both 3-pin and 4-pin molex connectors. Handy if you need it, but could be a negative if you only want the 3-pins as the molex connector is quite bulky.
  • Even when plugged into via the 4-pin, the fans were pretty quiet.
  • Lots of screws, cable ties and an onboard speaker for troubleshooting. (No rubber mounting grommets for hard drives or anything, but you can't have everything in such a cheap case).
  • Internal USB and case button cables are quite long.
  • Plenty of drive bays and room internally.
  • Cutout behind the motherboard to mount a CPU cooler if needed.
  • Large window to show off to show off your insides.
Negatives
  • "Punch out" PCI expansion slots, rather than ones held in place with screws.
  • No cut out at the top of the case for the 4/8 pin ATX power cable, so you need to route around the motherboard. (This is pretty common in cases in this range).
  • The short fan cable on the front-of-case fan would be tricky to reach the 3-pin header on an ATX motherboard.
  • The blue LEDs on the fans and the "power on" at the front of the case are all quite bright (could be considered a good or bad thing, depending on how much you like blue LEDs ;)
  • Not a whole lot of cable routing room at the back.
  • The connectors on the front of the case work okay, but do look a little cheap.
Summary

A good budget case where the value proposition and positives easily outweigh the negatives.

Friday, June 5, 2015

Image Overlays in reveal.js

reveals.js is a fantastic little library for creating web-based presentations.

While putting a presentation together I was trying to work out how to quickly throw up images as overlays over the presentation text at the start of a slide, and then disappear to reveal the text.

With the help of a colleague, we worked out a couple of techniques you can apply using the reveal.js "fragment" and "current-visible" option combined with an absolute position.

Option 1 simply overlays the image and has it disappear as the next action in the presentation:

<img class="fragment current-visible" src="image.jpg"
style="position:absolute; left:210px; top:100px;"/>

For Option 2, I added a link so you can get the full-sized image if you want:

<p class="fragment current-visible"
style="position:absolute; left:120px; top:100px;">
<a href="image.jpg"><img src="image.jpg" width="1024"/></a></p>

The way reveal.js scales a presentation to a nominated size in the configuration means the absolute positioning isn't as bad to work in as it would be in a "normal" web page, you only have to get the position right once for the desired image width and it will work due to the scaling factor. It may not be the most elegant way, but it works pretty well.

Okay, let's be honest, my colleague worked it all out, I just watched. Thanks GD!

Prevent Service Autostart on Linux

I installed JIRA last year but haven't ended up using it a lot, so I thought I'd stop it from starting automatically at boot. This wasn't immediately obvious how to do as the service command doesn't have that option.

This seems like a pretty definitive answer, but I ended up going with sysv-rc-conf as it seemed kind of easy to use and visualise everything that's going to be started.

The initial state for JIRA looked like this:

By unchecking everything, it no longer starts up by default:

Sunday, May 3, 2015

Canon MG-6250 Scanning in Kubuntu 14.04

Had to scan something today (first time in a long while), and wondered if I'd have to go through the process I needed to last time on Xubuntu 12.10.

Turns out the MG-6250 works out of the box with Skanlite on Kubuntu 14.04. No configuration required, it searched the network and found the printer, click Scan -- go.

Friday, April 3, 2015

Sorting a Bunch of Images by Resolution

I'd collected a heap of desktop wallpaper images over the years, and wanted to sort them by resolution.

This is the best way I found to do it, using the identify command from the ImageMagick tools. Of course I had to tweak it a little bit for my own purposes, namely to capture .jpeg files as well a .jpg, and to copy the files rather than move.

Script I ended up using:

#!/bin/bash for image in ./*.{jpg,jpeg} ; do res=$(identify -format %wx%h\\n $image); mkdir -p $res; cp -p $image $res; done

Monday, March 2, 2015

Setting up Asus RT-AC68U with Billion 7401VGP-R3

I'd been finding the wireless capability on my Billion 7401VGP-R3 was starting to degrade. Mainly that after a period of being on, it would occasionally start dropping devices and then not let any new ones connect until it was rebooted. Update to latest firmware didn't help.

The modem capabilities of the Billion were good, and I wanted to keep the VOIP capability to run the home phones. So I looked at AC wireless router options, and the Asus RT-AC68U got the nod as a good quality option.

There are a couple of possible ways to set up the AC68U so that it works with another modem/router like the Billion. One way is to turn off DHCP on the Asus and plug an ethernet cable into port 1 (rather than the WAN port) and likewise connect it to the Billion the same way. This allows the internet connection to get through, but takes up one of your ethernet ports.

The way I ended up running it (thanks to the tip from Pete at Whirlpool) was to turn on "Access Point (AP) mode", accessible Advanced Settings -> Administration tab in the router config.

Screenshot selecting Access Point mode

After changing to this setting, it will ask how you want to set up the IP address of the AC68U itself. You can let the DHPC-capable router on the network do it (which in this case I kept as the Billion), but since I'd already "lost" the AC68U once during the setup process by an automatic IP address change, I decided to keep it manually set:

(Incorrect) Manual IP settings for RT-AC68U

So far I haven't had any issues with this setup.

I had one issue, where the AC68U would occasionally drop one of the wireless connections and then seem to reboot. I think it was due to the Billion router allocating the same IP address to another device as the one I'd manually set on the AC68U. This was a bit silly by me, so I updated it to one well outside the Billion's DHCP range. For whatever reason it required a gateway address this time too. So far these settings have proven okay.

Updated settings below:

(Updated) Manual IP settings for RT-AC68U

Here's a colourful diagram of the entire network setup:

Sunday, March 1, 2015

PCT-MP4711 KVM: Nice experiment, not without problems

UPDATE 8/3/2015: The system exhibited similar (though far less pronounced) symptoms without the KVM being plugged in, so it may have been the mouse starting to fail that caused the dropped connections. I've tried a new mouse and it seems okay, but still need to set everything back up again with the KVM to clear its name.

While it looks like I was too hasty on the judgement, the frustrations with the device still stand. Post title updated to reflect the discovery.

A little over 12 months ago I bought a PCT-MP4711 4-port DVI/USB KVM to switch keyboard/mouse/monitor between two or more machines.

In the last week I started noticing some drop outs where the mouse/keyboard would lose "sync" for a few seconds. While working this is annoying, while gaming it's catastrophic. By coincidence I'd just installed a new router at the same time, so I initially thought it was a network issue, but have now proven it was the KVM.See above: perhaps not

Don't look at me!

I noted at the time that the 1 year warranty was a bit worrying, and it turns out I was right to be worried. It lasted essentially the 12 months and a few days before becoming unusable. You get what you pay for, etc, etc.

The thing always was a bit temperamental — particularly the key-based shortcuts to switch between settings. Sometimes you'd have to press the combo three, four, five times or more to get it to register. And sometimes it would stop working and require the USB connectors (which give the box its power) to be disconnected to reset the thing.

In the end it was an okay experiment, but I don't recommend anyone buy PCT equipment based on my experience. Unfortunately other equivalent options are much much more expensive, so while it was an okay stop-gap, the lack of longevity is a major let down.

Monday, February 9, 2015

Raspberry Pi B: HDMI Resolution and Localisation Fixes

Following up from yesterday's post on the Raspberry Pi B, I've played around with it a little more and noticed under Raspbian the screen resolution was running at 1776x952 rather than 1920x1080, and that the keyboard was set up for British layouts.

Resolution Fix

To fix the resolution I got into the /boot/config.txt and made a few changes as per various suggestions from the web. First of all you need to run tvservice -m CEA to find the preferred monitor settings. Mine was 16, but replace the text below with the appropriate number. (May also need to run tvservice -m DMT depending on your screen type. DMT is hdmi_group=2 for the settings. See: difference between CEA and DMT.

The summary of changes to /boot/config.txt:

disable_overscan=1
hdmi_drive=2

#overscan_left 24
#overscan_right 24
#overscan_top 16
#overscan_bottom 16
#disable_overscan=0

hdmi_group=1
hdmi_mode=16

The first two lines were already in the file, and just needed to be uncommented. The commented out lines about were in the NOOBS generated section at the bottom. NOOBS default seemed overly aggressive, so I took them all out. The last two lines are the results of the CEA output from above for the preferred setting.

Keyboard Localisation Fix

Default to British keyboard layout causes problems here in Aust because the # key is turned into £ and the @ and " keys are transposed. To update, run the following:

dpkg-reconfigure locales
dpkg-reconfigure keyboard-configuration

Both bring up little text-based wizards. For locales, select en_AU.UTF-8 or similar. For the keyboard config, I selected a generic match for the keyboard I was using, but I think the main thing is to change the "GB" setting to "US" keyboard layout.

Saturday, February 7, 2015

Raspberry Pi 2B Installation

Having played with a BeagleBone Black a while back, I thought I'd try out the newly released Raspberry Pi 2. Quad core CPU with 1GB of RAM sounds like it should be plenty grunty for SoC computer.

The Raspberry Pi 2B

Here's the process I used to set it up. I tried both Snappy Ubuntu and Raspbian. Since Snappy has no desktop at the moment, and that's the main thing I wanted to try out to start with, I basically satisfied myself it was working and then jumped over to Raspbian.

In addition to the Pi itself, you also need the following:

  • A micro-USB power supply — basically, a phone charger. I got a 2A one from Element14 with the Pi.
  • A microSD flash card. I got a 16GB Patriot that came with a USB adapter to make it easier to copy files to/from. You could also use a card reader if your computer has one.
  • Keyboard/mouse/monitor.

2A microUSB power adapter

Installing Snappy Ubuntu on the Pi

This install is using a Linux desktop computer to set up the Flash card. I'm sure there are guides out there for Windows/OSX if that's how you roll. OSX may be similar enough that the command-line options will work too, I'm not sure.

  • Download Snappy Ubuntu Core from http://www.raspberrypi.org/downloads/
  • Unzip the downloaded zip file to get at the pi-snappy.img.
  • Insert the flash drive into your computer.
  • Find out the device name using something like df if it automounts or fdisk -l if not. It will be called something like "/dev/sdc1". Drop the number at the end for the commands below — you need to flash the entire drive, whereas sdc1 is the first partition on the drive.
  • Unmount the flash drive if you need to.
  • From the command-line, run the following (replacing "sdc" with your device):
      $ sudo dd bs=4M if=pi-snappy.img of=/dev/sdc
    
  • It might take a while to flash the img. Play a game or something while you're waiting.
  • Run sync to flush the drive. (I forgot to do this and it still worked...)
  • Take out the flash drive and put it in the Pi. Connect up keyboard/mouse/monitor, then plug in power.
  • MicroSD flash card installed into the Pi

  • For me a "rainbow screen" popped up, then an image of 4 raspberries. Then it cycled around again and finally got to a login prompt. It took a long time, so I'm not sure whether something went wrong and it rebooted itself, or if that was normal.
  • Default login for Snappy is ubuntu/ubuntu.

Installing Raspbian via NOOBS on the Pi

NOOBS is a helper you can put on the flash drive to more easily install other distros. To setup the flash drive for NOOBS, reformat it as FAT32. I used gparted to do this. The drive had a bunch of existing partitions already on there from the Snappy install. Delete them all and create one single FAT32 partition, then Apply. Once complete, it should look something like this:

gparted after reformatting flash drive as FAT32

Unzip the NOOBS zip file, and copy the content onto the SD card. Once done, the file system should look something like this:

NOOBS unzipped onto flash drive

Put the SD Card back in the Pi. When it boots it will come up with an installation screen. Select Raspbian and optionally the Data Partition if you want it. It will then blat the drive with the Raspbian install, which will take a while.

Once complete, it should reboot and bring up another menu. I selected [1 Expand Filesystem] to make the rest of the SD card storage available, but it told me NOOBS had already done this. Then I selected Finish and it went to the console, selecting 3 (or 4?) to boot to desktop might have been a better option in general because that menu no longer appears on subsequent reboots.

Logging in to the console (username: pi, password: raspberry) you can start the desktop by running startx anyway.

Interestingly, I plugged in my Netgear WNA3100M (cheapy USB wireless adapter), and it connected right away. With the BeagleBone in comparison I got stymied trying to find firmware for that device. Score +1 for Raspbian right there.

Initial play with the Pi 2 shows the desktop to be pretty snappy, feels quite usable. There are few glitches in the rendering and occasionally you see artifacts if you, say, scroll the browser too fast for it to keep up, but overall the "feel" wasn't too bad. Will have to give it a bit more of a go to see what it can do.

Raspberry Pi 2B desktop screenshot (click to enlarge)

Sunday, January 18, 2015

Gigabyte Z97X-UD5H Stock Voltage Issue

As mentioned in the build log post back a bit, when combined with an i7 4790K the Gigabyte Z97X-UD5H has an issue at stock settings where (it appears) to auto-overclock to CPU, bumps the voltage way too high, and causes an immediate power shutdown.

Manually overclocking the board should fix this problem, but I found (with a bit of help) there are three other ways you can fix it by changing some settings in the BIOS:

  • Disable the Turbo Boost in the BIOS (as per this superuser answer). The setting can be found in M.I.T => Advanced Frequency Settings => Advanced CPU Core Settings => Intel Turbo Boost.
  • Turn off the "K OC" setting in Advanced CPU Core Settings.
  • Reset the CMOS (using the "clear CMOS" button on the board is okay), then start the machine and choose "Load Optimised Defaults" from the menu that pops up.

This thread at Intel's forum has information from many 4790K users on problems and test results they've found: https://communities.intel.com/thread/54032.

Saturday, January 10, 2015

Yet Another Canon Printer Linux Driver Install

After going round the loop with my Canon MF-4140 time or two before, I had to print something today and found I needed a slightly different process this time on Kubuntu 14.04.

There now appears to be a 64-bit driver for the MF-4100 series on Linux, which I downloaded from here.

After installing the two .deb files (cups-common and the cndrvcups-ufr2), the printer driver was available in the Add Printer dialog. It still didn't work though, despite appearing to install, accept and complete jobs. The trick was revealed by the answer in this askubuntu question, to search for missing dependencies for the .so libraries in the driver source tree. I installed lib32stdc++6, but as Dan Menes also discovered, it was the 32-bit version of libxml2 (sudo apt-get install libxml2:i386) that finally gets the thing to work.

Sunday, November 30, 2014

Getting Rid of 4-Pin Molex Connectors

As noted when installing a system in the Fractal Arc XL, the fan controller requires a 4-pin molex power connector. As it was the only one required in the system, I needed to plug in an extra cable on the modular PSU purely for the fan controller.

To remove that dependence (and reduce one of the cables floating around inside the case), all that is needed is a SATA-to-Molex power adapter. My local PC shop had one for $6.

SATA in one end

4-pin Molex in the other

Works a treat