Archive for category Uncategorized

Midterm week – A retrospect of my first 6 weeks of uni

So… I’m at university. University of Waterloo to be exact. It’s been almost a whirlwind – it’s both more and less hectic than IB, if that makes sense. There’s more to do – activities, events and maintenance things (laundry, grocery shopping and so on.) And the same time, there’s less – schoolwork isn’t as demanding as I found IB – fewer projects meaning less homework, minimal travel time to class. So I’ve got more free time now that mandatory stuff is reduced – but also more things to fill that free time with.

In terms of classes… well, they’re are pretty enjoyable. I’m finding CS137 the easiest coming from IB CS, followed by surprise, Math 117, aka Calculus. I’m enjoying Physics, again, thanks to groundwork in IB. Linear circuits is ok, but I’m finding the work, with all the sign changes tedious and annoying, because if you just make one mistake… yeah, you’re gone. SE 101 is the boring class – half lectures, half project. Lectures turn into what’s been termed Facebook parties, and projects are where we split off into a group and 3 people discuss stuff to do, and the other 3… well, we don’t do much. I’m hoping after midterms that’ll change though.

And the last class… Linear algebra. It’s probably my horror class – so much new stuff, and I’m not finding the textbook too helpful. I can get it in class, I understand what the prof is doing… and then when I get home and try it I’m an utter blank.

Profs are hit and miss too. though I’m not sure if that’s a result of my liking the subject or not. ECE105 & Math 117 are awesome, profs are good at making things easy. Math 115 and CS 137 are ok – profs are ok. They aren’t as interesting though. SE 101 and ECE 140 are not as great – they tend to read directly off their notes.

As for midterms, since I’m in the middle of them… So far, not as bad as I expected, but not as great as I hoped, especially Physics today. They’re sneaky and include a fifth option on their MCQ – “None of the above”. And the marking is purely correct/wrong, no partial marks due to its MCQ basis. I’ve got 2 more exams to go – linear algebra and CS. Worried about lin. alg., not too worried about CS.

 

And on a more personal note…

I signed up for the Made with Marmalade/Blackberry promotion to see what the Blackberry Playbook is like – they’ll ship a Playbook for free to me for 6 months, and if I publish an app on the Blackberry App World I get to keep it. Making an app is something that’d be good for a resume, so it’s win-win. (I’ve thinking of making a sudoku game, and writing it in Java so I can port it to Android because I don’t like any of the sudoku games that I’ve tried on their.)

I’m also ramping up my VPS plans and (re)creating a personal site. Most stumbling block – nginx isn’t playing well with php-fpm. I’m hoping to follow a LEB script to get it up and running. Random trivia: I’m liking Cloudflare’s Mirage and the SSL support that comes with Cloudflare Plus – at the $9.95/month it costs is more than the $9/month I’m paying for a VPS.

I’m also planning to get back into photography – time lapse astrophotography right now. I’m hoping for a clear Saturday night so I can set up my tripod and camera and let it run for a few hours. Problem of course is that I have no area to leave it overnight, so I’ll need to stick with the camera, and in the cool weather… yeah, it’s not going to be too fun. Also, something to do during that time. Staying out for 2 hours is one thing. Staying out for two hours with nothing to do… that’s another story. Thinking about it, there’s a picnic table outside my dorm, and a fairly empty patch of land with a clear view of the sky.

So, yeah… dinner time now, so I’m off. Meeting with my friends for dinner, chat for a bit, and then come back and continue linear algebra revising.

Because I’ve been using the writing of this post to distract myself from revising for it.

Whoops.

,

No Comments

Cheaping out on EC2 – using Spot Instances

Amazon markets Spot Instances as a way to reduce the price you pay for instances. So, continuing my efforts to reduce expenses on EC2, I looked into using spot instances. Spot instances are essentially just like normal instances. You can create your own AMIs, where you essentially create an image and tell Amazon to create instances based on that image, or use an existing AMI.

If you want to create an AMI, get a starting image, and customize it as necessary. I started with the Fedora 17 image. In an attempt to reduce the cost, I resized the disk from 10GB to 2GB, installed vim, less, screen and rsync, which oddly aren’t in the default Fedora install.

I then had to package it as a new AMI – this created an EBS snapshot, so I’m happy that I resized the disk. It’s a bit annoying that you’re going to be paying for an EBS snapshot AND the active EBS volumes, but in virtually all cases, the cost of the EBS snapshot won’t exceed the amount saved by using spot instances. If you have a bigger snapshot, it’ll cost more of course, but then you’d likely be using a more expensive EC2 instance, so the cost should balance out in the long run.

As for actually using the spot instance, I had my AMI set up to automatically start an IRC bot, so I used this for timing. The IRC bot came online ~7 minutes after I submitted the request to start the spot instance, so there’s a bit of lead time, but not too much. Because of the lead time, the instance won’t appear in the instance list for a while.

And an extra tip: Don’t be like me and not realise the spot instance actually started, and leave it running for two months racking up charges, only to be notified by Amazon that you now owe them money after your credit runs out. (Thankfully, they waived the charges as a one time thing.)

So now by default I set an expiry time of a day on all my spot instance requests if I know I’m only going to have them up for a few hours.

And one thing to look at if you require access to your data and can get by with using a pre-created image is using instance stores and mounting EBS volumes with the API. I didn’t try it because apparently, the t1.micro size that I’m using doesn’t support instance stores. Of course, this only really makes sense if you don’t want to pay the cost of having the spot instance run off an EBS volume. For a large scale operation, could be worth it.

, , ,

No Comments

HLDS on EC2

Update Jul 2014 – use the shiny new SteamCMD tool. Also, I started using DigitalOcean instead of EC2 (marginally cheaper, incredibly easier to setup)

Create a Instance – spot works

Install wget, tar, ncompress – depends on your distro, fedora 17 by default didn’t come with this (which, btw, is WTF?!) Also, screen to run disconnected from the server, and vim for text editing

wget http://media.steampowered.com/client/steamcmd_linux.tar.gz && tar -xvzf steamcmd_linux.tar.gz && ./steamcmd.sh

download the actual HLDS server

mkdir tf2 && ./steamcmd.sh +force_install_dir tf2 +login anonymous +app_update  232250 +quit

setup the config files

cd tf2/orangebox/

touch cfg/server.cfg && vim cfg/server.cfg – specify what you want, I pulled mine from forums.srcds.com/viewpost/67692#pid67692

./srcds_run -game tf -autoupdate -maxplayers 32 -console +map mvm_coaltown

Notes:

Pull map names from TF2 wiki, eg wiki.teamfortress.com/wiki/Mann_vs._Machine_%28game_mode%29 has the map filenames listed under “Maps”.

If you’ve got iptables running *in addition to* the aws security groups, disable iptables, or allow exceptions for the HLDS ports (UDP 27000-27015).

A t1.micro instance *isn’t* suitable for a tf2 server. The way Amazon has it set up is that Micro instances will have their CPU stolen by other instances if necessary. While this rarely happens to any great effect, when it does, there’s a large ping spike.

List of console commands, unknown how many map to the server: developer.valvesoftware.com/wiki/List_of_TF2_console_commands_and_variables

Official Valve post on setting up HLDS: support.steampowered.com/kb_article.php?ref=6758-TCMF-2234 (Wasn’t too helpful, also Windows specific.)

On the client, you have to set rcon_password to the server password, *then* issue rcon commands. Doing “rcon password” in the client won’t work.

Some other stuff relating to HLDS here: wiki.teamfortress.com/wiki/Linux_dedicated_server

Potential mods: www.mani-admin-plugin.com/cms/index.php/about and wiki.alliedmods.net/SourceMod

18th Aug update:

For some reason, auto-update failed, had to manually update.

3:07 Updating 'Team Fortress 2 Content' from version 350 to version 352

A symptom was a bunch of messages showing up in the log:

MasterRequestRestart
Your server will be restarted on map change.
Your server will be restarted on map change.

Also, a bunch of config changes coming too.

Aug 19th: Since I’m jumping between EC2 regions spinning up servers as and when I want to play on them, a ‘one’-line command to get the TF2 server up & running is now here

Also, 3 files are edited in the orangebox/tf folder: cfg/server.cfg, mapcycle.txt and motd.txt

A pretty extensive sample server.cfg was posted here: forums.steampowered.com/forums/showpost.php?p=32341843&postcount=1

If the servers were going to be around for a while, register them with Valve as per support.steampowered.com/kb_article.php?ref=2825-AFGJ-3513 for Quickplay support

More plugins: forums.alliedmods.net/showthread.php?t=84801, www.sourcemod.net/newstats.php?mod_id=558&addon_id=0, forums.alliedmods.net/showthread.php?p=592536 and forums.alliedmods.net/showthread.php?p=532620

RCON Guides: forums.srcds.com/viewtopic/13192 and www.uk-tf.co.uk/index.php/rcon-guides#Kicking%20&%20Banning%20players

, , ,

3 Comments

Linkdump – 18/8/11

www.ossec.net/main/downloads

Fully featured HIDS. For free. I look forward to messing around with it soon.

No Comments

Link dump: 14/08/11

Only 1 today:

www.computerworld.com/s/article/print/9218765/10_essential_MySQL_tools_for_admins

– Tool #2 & 3 seem the most useful for small-scale stuff… #1 looks interesting, but I need to find out how to set up query logs… or whatever the analyzer is running off of. =|

No Comments

SELinux and Apache userdirs

Normally I disable SELinux – for a home user, the additional security it provides isn’t worth much.

But for some reason I left it enabled on this install of Fedora 15. Which led to problems when I tried to get phpMyAdmin working out of my home directory. Read the rest of this entry »

No Comments

Linkdump – 11/8/11

technet.microsoft.com/en-us/hh377174 – Critical Career Paths for IT Pros

No Comments

Link Dump – 9/8/11

www.pixelatedimage.com/blog/ – David du Chemin, an interesting photographer. Manfrotto did a webinar with him, which I’ve been meaning to watch. (Signed up, but they’re held at 3AM local time, which is..not going to happen.)

nerdfitness.com/blog/ – As the URL suggests, a fitness blog… thing. Sells a book, but it seems to have a bunch of free info. Which I’m intending to trawl through and glean some info. (Also, nerdfitness.com/community/ which might actually be better suited for a beginner because you can ask questions there)

manvsdebt.com/ – Seems to be a personal finance blog. Again, selling a product, but free info always helps.

artofmanliness.com/ – WHATISTHISIDONTEVENKNOW. But it sounds impressive. If the content lives up to the URL

www.marksdailyapple.com/ – Linked in one of the blog posts, looks like it might have some stuff

www.posemaniacs.com/archives/386 – Oh hey drawing stuff

www.reddit.com/r/Fitness/ – I am just discovering the wonder that is reddit. Heard of it, but never touched it

frequentflyermaster.com/ – Interesting idea, but you have to pay for the good stuff.

www.nytimes.com/2002/07/07/magazine/what-if-it-s-all-been-a-big-fat-lie.html?pagewanted=all&src=pm – Interesting NYT article. About nutrition, so worth looking at.

No Comments

Getting Xen up and running

Now that Xen and a dom0-capable kernel have been installed, it’s time to combine the two.

There’s essentially two steps to this:

  1. Set up grub to boot Xen
  2. Set up Fedora to automatically start the Xen management services

Read the rest of this entry »

No Comments

Because setting up automated kernel compilation is annoying

git checkout -f xen/next-2.6.39 && git pull && yes ""|make oldconfig && make rpm-pkg && git checkout -f xen/next-2.6.32 && git pull && yes ""|make oldconfig && make rpm-pkg && git checkout -f xen/stable-2.6.32.x && git pull && yes ""|make oldconfig && make rpm-pkg

Now I have to mix it all together in a crontab (or two, since I’ve got a x86 VM and a x86_64 VM churning away at this).

No Comments