July 26, 2013


I'm posting this in celebration of SysAdmin Day 2013.

Like everywhere with a file server, all our users' files are stored on the file server, so the users don't need to worry about hard drive damages and they can access their files from any computer in the domain just by logging in, and I don't need to worry about having to move files over to a new computer when their computers gets replaced, and backup scripts and shadow copy on the server keeps everyone's files safe.

So I gave a user a new notebook computer, and he called me up a few hours later and said that Documents is empty on the new computer, and he couldn't find his files anywhere. Okay... I let him know that in order to see the files in the new computer, he needs to save his files on the server and not on the computer's hard drive. In fact, he should not be using the local hard drive at all, and should always use the server to save his files.

A few hours later he brought his old notebook to my office, and let me know that he had successfully moved all the files to the file server, and he had already deleted all his personal files from the old computer.

"Very good, hope you like your new computer."

Yet a few hours later, he called me up again and said he couldn't find his files on the new computer. Even though he made sure they were there earlier.

"Wait... when you told me earlier that you deleted the files, what exactly did you do?"

"You told me to move my files to the file server. I did that."

"... and?"

"When I was sure I can see my files on the new computer's file server, I went back to my old computer and deleted them all from the old computer's file server."

"Uhh... right, let me do some magic here, call me back again when you see your files appear."

Fortunately, my server performed a shadow copy before he deleted the files, so I restored his files without any trouble. A few minutes after I finished restoring his files, he called me back.

"Great! I can see my files now! Thanks! But what about my emails? I deleted them from the old computer too."

(We use Google Apps.)

June 23, 2013

DD-WRT duplicate MAC address

Earlier this year I decided to upgrade my team of WRT160NL to the latest DD-WRT. The upgrade went fine, but afterwards I could only reach just one of the WRT160NL's. Upon closer inspection, I discovered that the MAC address on all of them were set to 00:11:22:33:44:55.

This would be perfectly fine for normal users who have just one such router in her LAN, but it didn't work for me since MAC addresses have to be unique in a LAN.

The nvram set command can be used to change the MAC address, but it only affects the MAC address displayed in the DD-WRT control panel, it doesn't actually change the MAC address. After some fiddling, I found that I need to use the ifconfig command, so the full command is:

ifconfig br0 down
ifconfig br0 hw ether 00:25:9C:CA:23:0D
ifconfig br0 up

The LAN MAC should be the same as the Wireless MAC, so that's what I used. The commands can be save as a startup command using the DD-WRT interface. And here's a screen capture of the new setting in effect.

Since I have more than 10 WRT160NL's, I had to go to each one to change the MAC address. This is a bug in DD-WRT, but since it only affects people with multiple routers, I think it may be a long time before it gets fixed, so my workaround will do for now.

May 31, 2013

Business courses on Coursera

I wrote about MOOC earlier. Since I lack a lot of business management knowledge, I decided to look at Coursera in more depth and take some business courses there. I've already taken courses at edX, Coursera, and Udacity (big three of MOOC) at this point, and I think I can make a fair comparison of them.

I would not say that Coursera's courses are comparable to university classes. At best, they're similar to extremely high quality training courses. I took classes on innovation and operations management (among others). Both courses were 8 weeks long with some tests and "peer-graded" projects. The concepts I learned were solid though. Both classes have optional textbooks that must be bought separately that go into more detail than the online lectures and free materials, but neither require the textbook. The courses are completely self-contained. I spent roughly 4 hours per week on the innovations course (standard track), and roughly 8 hours per week (practitioner track) on the operatons management course.

And yeah, peer-grading really sucked in one of the other courses I took as the grading criteria wasn't clear at the beginning. Even though the class instructor posted in the forums to clarify the grading criteria, many people did not read the forums and I managed to fail the course spectacularly. The innovations course's projects were group projects, and many people complained that their partner got bored with the course and disappeared. (Apparently the course completion statistics of MOOC is only roughly 5~10%.)

These problem is in part due to the multitude of courses available from different universities and instructors. Some of the courses are really professionally made, while some seem to be put up in haste with bugs and missing features. Because I took so many classes all at once, it was quite obvious that the Coursera platform has many optional features that are up to the instructor and staff to use at will, and many are learning as they go along.

Coursera made headlines at the beginning of the year for introducing the Signature Track. The Signature Track really a certificate with a unique URL that contains the student's name and course details. Without the URL, the Coursera (and Udacity) "statements of accomplishments" are completely worthless since you can actually edit your profile name, and re-download any certificate, and the certificate will contain the new name. Another perk of the Signature Track certificate is that it looks really professionally made, I'm not sure though if it's a PDF file like the statement of accomplishment or if you get it in the mail. It costs roughly $30 to $50 for the verified certificate right now, but according to Coursera, prices will go up.

I paid for a Signature Track course just to find out what the verified certificate looks like and see how they handle the verification process. Every time you submit an assignment, there is a typing pattern recognition test and webcam facial recognition test to "prove" that you are really you, and that you're actually doing the work. This is kinda hokey since nothing stops you from cheating and proving yourself to the computer really proves nothing. Besides, I tried typing the verification phrase randomly and not sitting in front of the webcam when submitting, and Coursera still happily accepted my submission. I'm not sure how much tolerance the tests have, but they surely accepted anything I threw at them.

Even with all the verifications and stuff, the Signature Track certificate really doesn't hold any value since it's not from an accredited institute. But like I said above, Coursera's courses both in quality of material and length of the course are only comparable to high quality training classes as opposed to a university class, so they're still invaluable if you're thirsty for knowledge, and not just a piece of paper to prove to your employer that you took a class. Personally, I would pay for the Signature Track as a way to support Coursera, and also to make myself work harder on the courses since it's being paid for, and not give up so easily.

March 28, 2013

Udacity CS253 Web Development

I've never been really interested in "web development" even though I set up the first website in Thailand years and years ago as a joke that got me into heaps of trouble. But I was browing Udacity's course offerings, and the chipmunk looked just friendly enough for me to click in to take a look. The course is taught by Steve Huffman of Reddit fame, so I decided to check it out.

Lesson 1: HTML stands for Hypertext Markup Language! Here's how HTTP works! ...
Problem Set 1: Install Google App Engine and make a basic Hello, Udacity! web app.


Okay, installing Google App Engine wasn't hard for me, but I'm sure there would be thousands of others who would be completely stumped by this. But Python? There's nothing in the course description about using Python and GAE (I had assumed JavaScript), but since I'm learning Python, so I was glad this was another chance to learn Python.

Lesson 2: Here's how to do basic HTML web forms!
Problem Set 2: Make a user signup form using App Engine.


Okay, this involved some reading of the fantastic manuals, but I was able to figure it out without too much trouble.

Lesson 3: SQL stands for Structured Query Language. Here's how to do some basic SELECT statements.
Problem Set 3: Make a blog.

Wow. I was hooked by Lesson 3 since the lessons have nearly nothing to do with the problem sets and the problem sets really needs a lot of documentation reading and web searching which I'm really good at. No hand holding here and nothing about breaking the problem down into little pieces. I read the outdated forum posts and people seem to be divided into those who were completely lost and those who were saying the course is too simple.

Lesson 4: Cookies.
Problem Set 4: Make the signup form work, including logins and logouts.

Lesson 5: RSS.
Problem Set 5: Make the blog output JSON.

Lesson 6: Caching.
Problem Set 6: Implement caching for the blog.

Final Project: Make a working wiki, including signups / logins / logouts, signed-in users are able to create new wiki entries, as well as edit existing wiki entries.
Bonus Final: Make the wiki display editing history.

Since Udacity's courses are all self-paced, I was able to complete the entire course in about a week. I watched all the videos and did the in-video quizzes, and completed all the problem sets, the final project, and the bonus final, and was able to download my Certificate with Highest Distinction.

I'm now ready to take over the Internet.

March 15, 2013

Self-changing Wi-Fi password

I'm totally addicted to coffee, and whenever I see a new coffee shop, I would stop and try their coffee. These days, most coffee shops have free Wi-Fi, and sometimes, it's easy to drink one cup of coffee, and then steal their Wi-Fi permanently since most places don't have the knowledge to change their Wi-Fi password frequently. (Might as well not set a password if you never change the password!)

Presenting... automatic WPA2-PSK password changer for Tomato firmware. Put this little script into the Init script area (Administration -> Scripts -> Init). Now whenever the router reboots, a new password will be generated. You should also put this script either into a schedule so the password can change daily, or preferably, make a schedule to reboot the router daily.

As written the password is based on the current date. If you read the script below, you can see the password is based on a very simple formula: Year x Year x Month x Date, then use only the last eight digits. So if today is March 15, 2013, the password would be 82347605. You can vary the formula, for example, by using %U (week number) instead of %d to change the password weekly, or take out %d to change the password monthly. Just make sure the password is at least eight digits. I prepend the password with 00 in case the generated password is shorter than eight digits. It would be simple to make a spreadsheet with all possible future passwords, or even manually calculate the password.

The delay at the beginning of the scripts waits for the date to be retrieved by NTP. Note that if NTP time can not be retrieved, the Wi-Fi password will be the initial password, which is whatever you saved using the Basic -> Network configuration screen. My configuration is WPA2-PSK, other security types are untested. This script is tested on the ASUS WL500gP (v1 and v2) and the ASUS RT-N16.

You may have to change the nvram line depending on your Wi-Fi chipset if you have another Tomato supported router. The reason I set both wl and wl0 is that I needed both lines to support my notebook and my Android tablet. The wl line for my ThinkPad notebook, and the wl0 line for my Android tablet. If I don't have both lines, then only one device could connect.

Oh yeah, this is not a captive portal since there's no login screen for different users, but rather for changing the Wi-Fi password. As usual, no warranties.

cat > /tmp/wifi.sh << EOL
while [ \`date +%Y\` -lt 2010 ]
    sleep 10
YY=\`date +%Y\`
MM=\`date +%m\`
DD=\`date +%d\`
WIFIPW=\$(echo "00"\$SUMD | tail -c 9)
nvram set wl_wpa_psk=\$WIFIPW
nvram set wl0_wpa_psk=\$WIFIPW
service net restart
chmod a+x /tmp/wifi.sh
/tmp/wifi.sh &

Will update this page again when I have time to test if this script also works on the DD-WRT firmware.

March 10, 2013

Massive open online course

So, I was looking for some online Python tutorials when I came across edX and 6.00x Introduction to Computer Science and Programming. I've heard about massive open online courses ("free university") before, and I've certainly visited MIT's OpenCourseWare site frequentyly, but edX (what is it with adding X to everything these days?) seemed far more interesting than a self-study site, and 6.00x course just happened to be starting, so I registered for it to learn the Python language.

One thing lead to another, now I'm addicted to watching online lectures, and I've tried out courses in all three of the big MOOC players: Coursera, edX, and Udacity.

The difference between MOOC and other free learning resources is that they're operated like a real school. The courses run on a schedule and there are graded assignments. If you join the course too late you can't catch up, so it's best to wait until the next offering. At the end of the course you receive a PDF certificate if you reach the passing grade.

Even though they're free right now, but I imagine in the future it would cost some money to get a certificate, or perhaps a small monthly fee. In fact, as I type this I suddenly remember paying a $4.95 monthly fee for ZDnet University years ago. It was such a great idea back then, but eventually everything fell apart because the courses rarely got updated and they weren't structured like a real school, there was no wide support outside of ZD themselves, and the Internet was way too slow back then. I actually found a link that talks about ZDU. Good old days...

Anyway, Coursera is probably the most famous and with lots of partipating universities and hundreds of courses ranging from programming to biology to music appreciation. edX is owned by Harvard, MIT, and UC Berkeley and seems to be more technical and scientific. Udacity came out of Stanford and seems to have most "industry support" from technical leaders like Google or Intel and generally focuses on technical courses.

I really like Coursera's course offerings. I'm a technical person, but because IT is so much business now, I've been reading about the business aspects of IT, and I've been trying to hire someone into my team who didn't get started as a programmer. Coursera has everything I need. Unfortunately, Coursera's video player simply sucks. If I get any network hiccups and the video lecture pauses, attempting to resume the video just causes it to restart from the beginning. The video also plays in a pop-up window. If I accidentally click outside the pop-up window, the window closes, and if I click on the video again, it restarts too. This is quite unfortunate because all the videos I watched in Coursera appear to be really professionally made. They do offer a link to download the videos, but there are embedded quizzes inside the videos, and I believe I have to skip to the embedded quizzes to answer them even if I watch the videos offline. The web interface is really nicely made too, but apprently each course is free to do what they want with the organization, making things a bit confusing if you're taking more than one course.

(Edit: Also, because Coursera's courses are from so many different universities, each has its own stance on issuing certificates or credentials. I looked a bit and most don't seem to offer any credentials and seem to look at Coursera as an experiment to draw perspective students into their own paid online courses.)

I just wrote above that MOOC's are operated like a real school, but strangely enough, Udacity changed their policy recently to do-it-at-your-own-pace instead of scheduled classes. The reason being many people who are registered in these free classes are not full-time students, and often have trouble keeping up with the rigorous schedules more suitable for part-time or even full-time students. The problem with being at-your-own-pace though is that the forum discussions are totally messed up. I registered for a course and found many of the forum posts are from months ago, and it will get worse as time passes by. It also makes for people who just joins a course, does the final exam, and leaves with a certificate. Which is exactly what I did.

I guess this proves the certificate isn't worth much, and they should stick to scheduled courses and not open registration. But I've always had the same opinion about those MCSE and CCNA certificates. But hey, it might fool my boss. Other than that, all the videos I saw are amateurish, which isn't a problem to me since it actually feels like I'm in a meeting or a training session and not a classroom. But they could've made the slides just a bit more professional looking and not use handwritten papers for the presentations. (It does get hard to read at some points.) However, all these issues may be moot, since Udacity's courses are not based on actual courses, but they're all newly created specifically for the Udacity platform, and are often sponsored by IT industry giants, and all of Udacity's courses are computer or technology related at this point.

As for edX that I started with in the first place, it turns out that I prefer it the most. I'm enjoying the 6.00x Python course tremendously. I joined to learn the Python language and to refresh some computer science concepts, so the programming problems are really simple for me, and so I ended up spending most of the time in the forum trying to help others with their programming issues after I'm done submitting my homework. The video lectures are released on a schedule and programming homework have to be submitted on time. (The server crashed on the due time the first few times due to the sheer number of submissions.) Because everything is on a schedule, the forum discussions are current and viable. I have no trouble with the video player and if I do, I can click on a link and the video opens up in YouTube. The only drawback with edX is that they seem to have designed the site for people with huge monitors, I keep having to scroll up and down to view the course materials.

I tried a few different courses in edX and all the offerings have similar layouts, but it's still up to each course's designer how to organize their course material. 6.00x has really poor lecture notes, with each lecture's note separated into its own PDF file. But the CS188.1x AI course's lecture notes are organized into one large PDF file ready for printing out.

Speaking of printing out, one more cool thing about the 6.00x class is that the textbook (Introduction to Computation and Programming Using Python) used in the course is readable online inside the course material area. (And yeah, some of the Coursera courses I looked at seem more like disguised ads in order to sell the teachers' books.) When I first saw the textbook I noticed it looked pixelated instead of smooth like a PDF file. Sure enough, right clicking the page allowed saving the page as a 1700x2200 png file. The significance of that size is that it's a letter sized page at 200 dpi, perfectly suitable for printing out!