stuff about stuff

yup

“…inode table of its ramdisk (root) is full”

So last week a co-worker had an issue with powering up a VM that had died and decided to pull me in to fix the problem.  When I tried to vMotion the VM out to another ESXi host, it failed as well. The error was something like “WARNING: VisorFSObj: 1954: Cannot create file /var/run/vmware/tickets/vmtck-XXXXXXX for process hostd-worker because the inode table of its ramdisk (root) is full.” 

Note that we are using ESXi 5.1 in our environment. After some googling, I found this article published on 3/11/2013 which describes the problem and a workaround for this.

kb.vmware.com/kb/2040707

Note: I strongly recommend reading the official KB to get a deeper understanding of the issue as the below is simply a short summary of it.

Basically, the issue is caused by SNMP trap files filling up in /var/spool/snmp, causing the ESXi host to run out of inodes.

In summary:

To verify the issue is caused by full SNMP trap files:

1. SSH to the host

2. Run ls /var/spool/snmp | wc -l

3. If output exceeds 2000, it is good indication that this is the cause of full inodes.

To delete .trp files and free up inodes

1. cd /var/spool/snmp 

2. for i in *.trp; do rm -rf $i; done

Backup and recreate snmp.xml

1. cd /etc/vmware

2. mv snmp.xml snmp.xml.bkup

3. Create a new file called snmp.xml and paste the following in:

<?xml version="1.0" encoding="ISO-8859-1"?>
<config>
<snmpSettings><enable>false</enable><port>161</port><syscontact></syscontact><syslocation></syslocation>
<EnvEventSource>indications</EnvEventSource><communities></communities><loglevel>info</loglevel><authProtocol></authProtocol><privProtocol></privProtocol></snmpSettings>
</config>

Reconfigure SNMP

1. esxcli system snmp set –-enable=true

2. esxcli system snmp get

Again, for more details on this issue I strongly suggest reading up more from the KB article. As far as I know, there is still no permanent fix for this. Hopefully we will see a patch in the near future for this issue.

Disclaimer: The above information are provided for informational/educational purposes only.

New diet and running regime

I’ve been reading about how effective and easy the keto diet is and decided to try it out for myself. After about a week, I can say that it is definitely not easy to sustain this diet. Especially as a working adult in Singapore where 90% of all hawker stalls sell carby food. For now I’m making do with stuff like roasted meat and chicken chop without the gravy and chips. The diet itself is certainly effective and I feel my tummy getting tighter and I’m experiencing increased endurance during my 10km runs.

Speaking of running, I’ve recently decided to switch it up a little and include a couple of inclined sprints mid journey. Not sure if it’s just placebo but since I started doing this I’ve been able to sustain a higher pace than before. Thighs are feeling more compact as well 😀 

Autoscrolling JTables

Had to deal with Java Swing for a school project and faced an issue with getting a JTable to autoscroll after adding an entry during runtime. After more than 3 hours of scouring the internets to no avail.. i put together a dirty hack that sorta works (well enough for me, I guess)

private synchronized void autoScroll() {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            eventTable.scrollRectToVisible(eventTable.getCellRect(
                 eventTable.getRowCount()-1, eventTable.getColumnCount(), true));
        }
    });
}

where eventTable is the JTable constantly being updated at runtime. Basically call autoScroll() each time an update is done. Pretty sure there’s a better way to do this but what the hell, hope this helps other people who’s having a hard time with Swing/JTables.

Cheers.

Software I use

Every now and then I’d get asked this question and I’d casually recommend something. For some reason I’ve become the goto-guy for windoze software recommendations. In light of that, I thought I might as well post a list (non-exhaustive) of stuff that I’m using that other people might find useful.

Browsers:

Chromium (Chrome without Google’s crap) : I find the nightlies good enough (bar the occasional bugs which shouldn’t be much of a problem since they get fixed so quickly)

Firefox : I use it as a backup to Chromium but it’s starting to win me back with its smaller memory footprint

Editors

emacsW32 : Just a personal choice

Notepad++ : I don’t use it often but I quite like the XML tools (offered as a plugin) which I use to test XPath queries

Microsoft Office 2010: Would be using LibreOffice if it weren’t because of school requirements.

Google Docs : Team project collaboration. Online storage means I can access documents pretty easily as long as i can haz internets

MediaPlayers:

foobar2000 : without any customizations

VLC : just works plus I quite like the small step video playback speedups whenever I need to watch my webcasts at 1.5X speed

Media Player Classic + KLite Mega Codec : Backup to VLC, but I never seem to have to use it

Instant messaging/IRC

GTalk with Psi configured to use the MSN protocol

Pidgin: Multiprotocol IM (my old favorite)

XChat 2 : Just works, mIRC just doesn’t cut it for me anymore.

Security

Microsoft Security Essentials: good enough

Windows firewall : good enough

Truecrypt : Encrypted virtual disks

Readers:

Sumatra PDF : Lightweight, very fast. My only gripe is that it has rubbish print support.

Net Utilities:

Tixati : Torrent client, been using it since uTorrent sold to BitTorrent

WinSCP :  for FTP, SFTP

PuTTYTabs: putty with TABS!!!

OpenVPN: VPN Goodness

Efficiency boosters/System Utils:

7zip : For extracting compressed files

Flux: Great for late night laptop usage, reduces stress on your eyes.

CCleaner: Good for cleaning up / freeing up disk space and also removes useless registry entries.

Daemon Tools Lite: for mounting ISO files

Launchy: Quiksilver for windows

deskview: declutters desktop icons by giving you the option to view icons as lists

Everything: Very fast search tool

Dropbox: Online storage, access files from anywhere with internet

Teracopy: File copying on steroids

Misc.

VirtualBox: Free alternative to VMware workstation

Eclipse : For Java projects large enough to require the use of an IDE

AutoHotkey : Awesome tool for repetitive tasks

Introduction to DAML+OIL

Continuation from previous post..

DAML + OIL?

In 2000 in the United States, DARPA started development of DAML led by James Hendler.In March 2001, the Joint EU/US Committee on Agent Markup Languages decided that DAML should be merged with OIL.The EU/US ad hoc Joint Working Group on Agent Markup Languages was convened to develop DAML+OIL as a web ontology language. This group was jointly funded by the DARPA (under the DAML program) and the European Union’s Information Society Technologies (IST) funding project. DAML+OIL was intended to be a thin layer above RDFS,with formal semantics based on a description logic(DL). – wikipedia

DAML Basics

Setting up the namespaces

<rdf:RDF
xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd ="http://www.w3.org/2000/10/XMLSchema#"
xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
>

Defining classes

<rdfs:Class rdf:ID="Animal"> </rdfs:Class>
<rdfs:Class rdf:ID="Male">
<rdfs:subClassOf rdf:resource="#Animal"/> </rdfs:Class>
<rdfs:Class rdf:ID="Female">
<rdfs:subClassOf rdf:resource="#Animal"/>
<daml:disjointWith rdf:resource="#Male"/> </rdfs:Class>
<rdfs:Class rdf:ID="Man">
<rdfs:subClassOf rdf:resource="#Person"/>
<rdfs:subClassOf rdf:resource="#Male"/> </rdfs:Class>

Defining properties

<rdf:Property rdf:ID="hasParent">
<rdfs:domain rdf:resource="#Animal"/>
<rdfs:range rdf:resource="#Animal"/> </rdf:Property>
<rdf:Property rdf:ID="hasFather">
<rdfs:subPropertyOf rdf:resource="#hasParent"/>
<rdfs:range rdf:resource="#Male"/> </rdf:Property>

Defining restrictions

<rdfs:Class rdf:ID="Person"> <rdfs:subClassOf rdf:resource="#Animal"/>
<rdfs:subClassOf>
<daml:Restriction>
<daml:onProperty rdf:resource="#hasParent"/>
<daml:toClass rdf:resource="#Person"/>
</daml:Restriction> </rdfs:subClassOf>
<rdfs:subClassOf>
<daml:Restriction daml:cardinality="1">
<daml:onProperty rdf:resource="#hasFather"/>
</daml:Restriction> </rdfs:subClassOf>
<rdfs:subClassOf>
<daml:Restriction daml:maxcardinality="1">
<daml:onProperty rdf:resource="#hasSpouse"/>
</daml:Restriction> </rdfs:subClassOf>
</rdfs:Class>
<pre>

UniqueProperty and TransitiveProperty

<daml:UniqueProperty rdf:ID="hasMother">
<rdfs:subPropertyOf rdf:resource="#hasParent"/>
<rdfs:range rdf:resource="#Female"/>
</daml:UniqueProperty>
<daml:TransitiveProperty rdf:ID="hasAncestor">
</daml:TransitiveProperty>

hasValue, intersectionOf

<rdfs:Class rdf:ID="TallThing">
<daml:sameClassAs>
<daml:Restriction>
<daml:onProperty rdf:resource="#hasHeight"/>
<daml:hasValue rdf:resource="#tall"/>
</daml:Restriction>
</daml:sameClassAs> </rdfs:Class>
<rdfs:Class rdf:ID="TallMan">
<daml:intersectionOf rdf:parseType="daml:collection">
<rdfs:Class rdf:about="#TallThing"/>
<rdfs:Class rdf:about="#Man"/>
</daml:intersectionOf> </rdfs:Class>

Instances

<Person rdf:ID="Adam">
<hasHeight rdf:resource=#medium/>
</Person>

Introduction to RDF

My notes of RDF Basics from CS4211: Formal Methods for Software Engineering. Writing them here to fortify my own understanding.

What is RDF

The Resource Description Framework (RDF) is a family of World Wide Consortium  (W3C) specifications originally designed as a metadata data model. It has come to be used as a general method for conceptual description or modeling of information that is implemented in web resources, using variety of syntax formats. (wikipedia)

An RDF Document is a collection of assertions in subject, verb, object form for describing web resources. The framework itself provies interoperability between applications that exchange machine understandable information and uses XML as syntax.

So, from my understanding, this is the condensed form:

RDF is a framework using XML as syntax to model a conceptual system.

RDF Basics

rdf:Resource – Defines the class resource; things being described by RDF expressions. Resources are always named by URI (e.g. html document, specific xml element within the document source, collection or pages)

rdf:Property – Defines aspects, characteristics, attributes or relations used to describe a resource (e.g. title)

rdf:Statement – Resource (Subject) + Property (Predicate) + Property Value (Object)

Examples

Example 1:

kwong is the creator of weakbytes.wordpress.com

( https://weakbytes.wordpress.com) ——–creator—->[kwong]

In XML syntax:


<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <rdf:Description about="https://weakbytes.wordpress.com/">
    <dc:creator>kwong</dc:creator>
    <dc:title>KWブログ</dc:title>
  </rdf:Description>
</rdf:RDF>

RDF Containers

rdf:Bag – an unordered list of resources or literals

rdf:Seq  – an ordered list of resources or literals

rdf:Alt – a list of resources or literals that represent alternatives for the value of a property

Examples

Statement: The founders of Google are Sergey Brin and Larry Page.

<rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#
xmlns:s="http://www.schemas.org/Course/">
  <rdf:Description about=http://www.google.com/>
    <s:founders>
      <rdf:Seq>
        <rdf:li rdf:resource="http://infolab.stanford.edu/~sergey/"/>
        <rdf:li rdf:resource="http://infolab.stanford.edu/~page/"/>
      </rdf:Seq>
    </s:founders>
  </rdf:Description>
</rdf:RDF></pre>

RDF Schema

XML Schema can only provide specific constraints on the structure of an XML document, but this is insufficient if we want to know how to interpret these constraints. RDF Schema solves this issue.

Example from lecture

Class

<pre><?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<rdfs:Class rdf:ID="Person">
<rdfs:subClassOf
rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Resource"/>
</rdfs:Class>
<rdfs:Class rdf:ID="Student">
<rdfs:subClassOf rdf:resource="#Person"/>
</rdfs:Class>

Property

<rdf:Property rdf:ID="teacher">
<rdfs:domain rdf:resource="#Course"/>
<rdfs:range rdf:resource="#Person"/>
</rdf:Property>
<rdf:Property rdf:ID="students">
<rdfs:domain rdf:resource="#Course"/>
<rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/>
</rdf:Property>

Why RDF itself is not enough

  • We can only define range/domain on properties
  • No properties of properties
  • No equivalence, disjointness
  • No necessary and sufficient condition

On touch typing

Having only gotten my first personal computer at the age of 13, I can be considered a late adopter. Fortunately, by the time I got my first PC, I was already proficient with working the keyboard thanks to my involvement in my primary school’s Computer Club. I still recall what the practices were like: progressively typing letters away from the home row while maintaining the “left hand on ASDF, right hand on JKL; keys” position.

And so I learned how to touch type without knowing I was actually doing so as it was something the teacher had made us do twice every week religiously. I guess at my current age I can look back and appreciate what that particular teacher had done for me. I currently average around 90WPM and my record stands at 124WPM. I’m sure there are others out there who can do better, but that’s good enough for me since my mind can never seem to catch up with my fingers at a constant pace.

Recently, I discovered that my wrists would start to hurt after many hours of typing. This greatly affected my work output as it meant having to deal with the ache, resulting in incoherent thoughts and general lack of ideas due to said pain. I decided to do something about this and started experimenting with different wrist positions while typing —  well, just 3 actually.

1. Rested wrists (what I usually do)

2. “Chinese Zombie” (arms straight, finger tips facing down, wrists unsupported)

3. Pianist (Go figure)

I tried each of them on three different days and came to the conclusion that the “Pianist” way of typing provides best comfort for prolonged use and the “Chinese Zombie” method the worst. In fact, the Pianist method feels more natural and I can now proudly say I’ve found a winning formula that works for me!

Mini guide to NUS SoC (School of Computing)

I remember myself rummaging through the interwebs looking for possible blog posts of my seniors to better prepare myself for school. Luckily, there were a precious few (Recommended source: life-of-a-nus-computing-student.blogspot.com) and I was able to survive my first year without feeling too much of a tool. In light of my fortunate survival (though barely), I’m documenting the fruits of my ordeal in hope that it would benefit my kouhai (juniors) who are about to start their four year adventure in your soon to be home (yes, home).

Orientation week

My personal take on this: Don’t join for the sake of joining. Unfortunately, I fell victim to some self-convincing that if I didn’t take part in orientation week, I’d never be able to make friends with anyone. While it is true that participation in said event allows you to befriend a lot of people, if you’re not one to take part in cheers accompanied with exaggerated hand gesture (and rather silly ones at that) then you may want to avoid this. On the contrary, if you enjoy good company, silly dance moves married with comprehensive school tour and course preparation (unix workshop comes to mind), then this is for you.

Printers

SoC provides Lexmark laser printers at Technical Services, or affectionately known as techserv, with a quota of 50(?) pages monthly. I’ve been able to get by just fine with just using the school printers and not having to print much from home. Sadly, these printers are known to be wonky and usually jammed up with print jobs, hence causing your print trips to be excruciatingly painful. Fortunately, this tool exists and you may consider buying its creator a coffee if you, unlike the poor student that I am, have extra cash and would like to show a token of appreciation.  This post also highlights some issues regarding the printers

Grub

Food is rather cheap and tasty depending on your standards. If you aren’t picky then you probably wouldn’t have an issue with the canteens. The Biz/Comp canteen is the nearest to SoC and one you would probably visit often, apart from the Arts canteen. Safe bets include the mid-eastern cuisine and Western fare. There seems to have been a Korean cuisine stall that opened just recently but I haven’t been around school for awhile so I can’t vouch for it yet.

Vending machines around COM1 are a godsend and you will grow to appreciate them throughout the semester. The one near the main entrance dispenses hot canned coffee and is my favorite.

Class/IVLE Forum etiquette

Though I’ve only taken 10 modules so far, I’ve already seen many cringe-worthy acts in during lectures/tutorials. Naturally, people who commit such acts are loathed at and may risk getting themselves condemned within the lecture/tutorial group. In a worse case scenario, you may end up jeopardizing your grades because 1: peer appraisals are common in most modules 2: team based projects are aplenty.

Instances of bad etiquette in lectures/tutorials include:

“Participation hogging” –  Raising your hand every 5 seconds to interrupt the lecturer/tutor in hope of maxing out your participation marks. If possible, consolidate your questions (if you genuinely have any) and ask them when the tutor goes “any questions?”.

Ranting/Showboating – I’ve sat in a tutorial where a guy just rattled on and on about his favorite linux distro and how good and bad it is, yadda yadda. I could see that the tutor was not impressed. Please, take your showboating out of class even if you’re really that knowledgeable.

Being unprepared – There are times where the whole tutorial group is expected to prepare something for a particular session, which is rather common in CS2301. While I don’t recommend going to tutorials unprepared, there are times where you’d forsake doing them just so you can finish a project on time. Nonetheless, not doing it would mean looking like a tool and dragging the entire class along with you.

Forum etiquette is equally important too. Most modules give marks for forum participation. Inevitably, you’d have “spammers” flooding the entire forum with pointless chatter and boring trivia. Try not to be one of them.

Study corners

Techserv, Basement 1 and Level 2 come to mind. These places are usually packed during lunch and after 2pm. I recommend hanging around techserv due to its proximity to the printers. OS/Prog Labs make for great study areas too if you have access and there are no ongoing lessons. Power sockets are precious commodities around SoC, bring a multiplug if you are desperate enough.

***

For everything else, I suggest reading the recommended source (see first para) as it’s infinitely more comprehensive than what I have here. Do note that the above is still a work in progress; comments are welcomed.

Looking forward to seeing the new freshies soon. 🙂

Do note that what I have here is still a work in progress; comments are gladly welcome.

Firefox displaying weird symbols?

Quick diagnosis (aka “How do I know I have this issue”)

1. Visit meme.yahoo.com or shoeblog.com
2. View this screenshot (of meme.yahoo.com) click here
3. If you’re experiencing something similar then this fix is for you.

Why am I getting this error:
I do not know the exact issue; or what exactly causes this. However, it is largely due to a corrupted Helvetica truetype/opentype font.

Now for the quick and dirty fix:
Assuming you’re a WINDOWS user, simply go to your WINDOWS\FONTS folder and delete any instance of Helvetica truetype or opentype fonts. There may also be third party helvetica font types installed by third party vendors. They are usually named “he[insert random numbers].ttf” or “helv.ttf”; do keep a lookout for such files.

When you’re done, simply restart firefox (if you had it opened) and visit the above mentioned sites again to confirm the fix. It is advised that you replace the deleted helvetica font files with a WORKING helvetica font.

Disclaimer: The author is not responsible for any damages caused. No consequential damages can be sought against the author. This information is provided out of goodwill to share knowledge that the author gained while fixing a similar issue. Only proceed when you have agreed to these terms.

Dual boot

As I’m typing this post, Windows 7 is being installed on my T400 and this has been the fourth time I’m doing this. What seemed like an easy task (hey, I used to set up dual/triple boot PCs for fun in the past) suddenly turned into something pretty challenging.

As far as I recall, Dual booting windows+ubuntu pretty much only required setting up two primary partitions (ntfs and ext3/4) before proceeding to install Windows followed by Ubuntu (I wanted GRUB as boot manager, hence this sequence). Unfortunately, having not used GParted for so long, I was unaware of this certain “Round to Cylinders” feature and was pretty upset when I realized this default feature didn’t allow me to allocate disk space as I wanted it — there’d always be this unallocated space.

Good ol’ google to the rescue and I eventually got this fixed. But what confused me was how GParted allowed this to be a DEFAULT feature.

As I finish this sentence, Windows 7 has pretty much finished its initial installation. Time to reinstall the goddamned drivers again.