
I have a new blog.
This happened a while ago, but I never announced it here because I was hoping to migrate my old posts. I suppose I can do that later - also, I know I haven't been answering messages/comments here, which I will hopefully remedy in the next few weeks.
1 Comment | Post A Comment | Add to Memories | Tell a Friend | Link
I needed a shelless SSH server that would not honor shell requests or exec commands, because I wanted to provide SFTP access without allowing shell access. I'm only posting this because this may be useful to people - I don't know Twisted very well, and there may be a better way to do it, but this works:
from zope import interface
from twisted.cred import portal
from twisted.python import log
from twisted.conch.avatar import ConchUser
from twisted.conch.ssh import session
class ShelllessSSHRealm:
interface.implements(portal.IRealm)
def requestAvatar(self, avatarID, mind, *interfaces):
user = ShelllessUser()
return interfaces[0], user, user.logout
class ShelllessUser(ConchUser):
"""
A shell-less user that does not answer any global requests.
"""
def __init__(self, root=None):
ConchUser.__init__(self)
self.channelLookup["session"] = ShelllessSession
def logout(self):
pass # nothing to do
class ShelllessSession(session.SSHSession):
name = 'shellessSession'
def __init__(self, *args, **kw):
session.SSHSession.__init__(self, *args, **kw)
def _noshell(self):
if not self.closing:
self.write("This server does not provide shells "
"or allow command execution.\n")
self.loseConnection()
return 0
def request_shell(self, data):
log.msg("shell request rejected")
return self._noshell()
def request_exec(self, data):
log.msg("execution request rejected")
return self._noshell()
def request_pty_req(self, data):
log.msg("pty request rejected")
return self._noshell()
def request_window_change(self, data):
log.msg("window change request rejected")
return 0
I have tests for it and everything - I can post those if someone wants them.
2 Comments | Post A Comment | Add to Memories | Tell a Friend | Link
Now I can use the XO as an ebook reader (in tablet mode) when using Ubuntu.
I was having problems before because the rotation key on the XO, as well as the directional keypad (see this image, although the rotation key is labeled as "backlight control" for some reason). xev didn't even register anything when I hit the keys (oddly enough it did register the gamepad buttons). I knew that that the kernel recognized the key presses, since od /dev/input/event3 register events when the directional pad keys and rotation button (and any other key on the keyboard) is pressed. However, thanks to waba.be's tutorial, I got it working. ( Read more... )
3 Comments | Post A Comment | Add to Memories | Tell a Friend | Link
The wiki.laptop.org instructions for installing Ubuntu on the XO tell you to install Holger Levsen's backported Xorg AMD drivers. They gave me dependency errors so googled around and found that the AMD Geode driver project on x.org. Even more convenient is Martin-Éric's PPA for the Gutsy and Hardy drivers. Installing xserver-xorg-video-amd, and using the FreeLikeGnu xorg.conf, meant that xrandr now works flawlessly on the XO. Now to get X to even recognize those rotation keys on the XO.
Post A Comment | Add to Memories | Tell a Friend | Link
Thanks to several sources (wiki.laptop.org Ubuntu installation, wiki.laptop.org XFce, and OLPC News forums), I managed to get Ubuntu working on my OLPC.
The instructions were pretty straightforward, but the process wasn't entirely painless for me so I thought I'd post a few tips:
- 2G is absolutely fine. My Ubuntu installation with XFce takes up about 35% of my 2G disk.
- You can use the Ubuntu install image linked to from OLPC News forums (1.5G image), but if you want to make your own:
- When installing qemu you really do want to install the bochs firmware because if you don't, your disk driver won't be detected while doing the Ubuntu install. I missed that part in the instructions, and it was annoying simply because it took a while for the install to get up to that point.
- Back up your install images at certain stages so you can easily backtrack. For some reason my disk images got corrupted several times after (and during) the xserver install, and I was quite happy to not have to start all over. The Ubuntu install alone took a not insignificant amount of time.
- The how-to mentioned ata errors and says to ignore them. I thought it would be some small error during bootup, but no, ata errors were scrolling by every second during bootup. It was pretty scary. But yes, apparently it's harmless.
- After installing sysvinit, the qemu install wouldn't shut down, so I just closed the qemu window and booted back up. It was fine.
- I installed it on a microSD card - I have an SD card adapter and a USB adapter. OpenFirmware recognized the SD card, but didn't recognize the USB disk for some reason. My OLPC would mount the microSD/USB drive, but refused to boot off of it. I eventually figured out that it wasn't my olpc.fth, but rather my microSD/USB adapter. A different adapter worked just fine.
- Get the files off your OLPC onto a USB disk once (not the one your disk image is on), and copy it elsewhere. It will be much less painful than pulling the files off your OLPC and onto your bootable USB or SD card multiple times.
- You can use either the olpc.fth's on the wiki page or the one in the forums. My problem was that OpenFirmware would load the disk image from either the USB drive or the SD drive, but it would hang after loading ramdisk. I spent a huge amount of time reinstalling because I thought I had done something wrong. Apparently OpenFirmware freezes the display but Ubuntu doesn't know to unfreeze it even after the OS is loaded. The solution is to put the line "unfreeze" in your olpc.fth.
- It's easier to install xbindkeys and set up scripts, as well get your WPA PSK on your desktop than on the OLPC. The keyboard on the OLPC is a pain to use even for me.
- If you use WEP, the following in /etc/network/interfaces works just fine:
iface eth1 inet dhcp
wireless-essid SSID
wireless-key KEY
I do have some unresolved issues though - if anyone has any suggestions it would be great, as I haven't found solutions yet.
- hal-device does not seem to have a charge_level line in Ubuntu, so I haven't figured out how to display battery charge levels in Ubuntu xfce
- xrandr doesn't seem to work correctly in Ubuntu, so I can't rotate my display. I get the following error when executing xrandr -o right:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 154 (RANDR)
Minor opcode of failed request: 2 (RRSetScreenConfig)
Serial number of failed request: 12
Current serial number in output stream: 12 Oddly enough, I get the same error on my desktop and glyf's desktop as well.
1 Comment | Post A Comment | Add to Memories | Tell a Friend | Link
We've been fairly disappointed with the lack of good Wii games lately (and the low output resolution of the Wii) so we finally cleared out our games cabinet a bit, turned in our games and systems for store credit, and bought a PS3.
It's gorgeous! We also got Assassin's Creed, which got meh reviews but that I'm quite enjoying so far. What's neat is that you can download game demos in the background as you play; Devil May Cry 4 looks pretty awesome. I also really like that Folding@Home and "Install Other OS" are options on the main screen (although we haven't tried to install Linux yet).
I spent enough Friday/Saturday nights out that I'm tired of crowds and waiting in line for an hour for crowded trendy restaurants. Just sat around eating some chicken provencal and polenta (as opposed to my usual lazy pasta/mac-n-cheese and sausage/veggies dinner) and ran around base-jumping, dodging guards, and killing some manz.
Totally beats trying to get into Sonsie or Addis Red Sea.
Post A Comment | Add to Memories | Tell a Friend | Link
 |
|
I recently came across an article posted in the International Herald Tribune about an Icelandic woman who was detained by the Department of Homeland Security at JFK International Airport. She was kept awake for 72 hours, given only bread and porridge once, and otherwise mistreated and humiliated because she had overstayed her student visa by 3 weeks 10 years ago. When she was finally deported back to Iceland (and banned from entering the US again for 10 years), she wrote about her experience in her blog.
Overstaying your visa means that you have to apply for a special visa the next time you visit. She was not aware of this requirement because she had come back before without trouble. The crime clearly did not fit the punishment here - it was a (unfortunately legal) abuse of power by the DHS. Since a lot of my friends are foreign nationals, I just wanted to warn them to make sure all their paperwork was current and they were careful about visas and such.
And yes, I did email the US embassy in Iceland to check this story before I posted it.
Post A Comment | Add to Memories | Tell a Friend | Link
I have a 1GB Petito USB flash drive (and no, it is not bling-ed out nor do I wear it on a diamond necklace, but it is a small and aesthetically pleasing drive). Whenever I plug it in, two disks mount: a ~1GB disk on /dev/sdb, and a 512MB disk on /dev/sdc. All my data is on the ~1GB disk, since I can't seem to do anything with the 512MB one. It's magic, somehow. GPartEd thinks it's 512MB of unallocated space, but mount shows it as vfat file format.
It's not a huge problem, it's just annoying that whenever I plug in my USB disk, my data is randomly in either /media/disk-1 or /media/disk. And the other disk is completely useless - it can't be formatted, and I can't figure out how to get it to not mount automatically.
If anyone has any ideas, please let me know.
Post A Comment | Add to Memories | Tell a Friend | Link
You can read about it in this blog post. Basically, the Southwestern Baptist Theological Seminary has a Homemaker course/track for women. Ok, I lied - this is a horrible idea that is misogynistic and degrading. However, if you were to trim off all the religious bull regarding gender roles, and crunch it down into only one or two classes, and make said classes co-ed, it'd be a good idea.
But I do wish that actual schools have required life-skills courses, maybe named something else to remove the high school class stigma. I took Home Economics in junior high; they taught us how to make cookies and cake. The only useful bit I got from that class was "soak baking pans right away helps to remove burned-on crud."
What would have been more useful?
- Taking such a class somewhat later in life, when I actually started to get money to spend rather than having to ask my parents for toys or clothes or food. Granted, my parents spoiled me and bought stuff for me often rather than actually force me to budget for stuff I wanted, thus allowing me to pretend that I had "savings" (leftover money from allowance period to allowance period). However, actually having money gave me a frame of reference as to how much things cost in relation to each other.
- Actually learning to cook, rather than to bake deserts. For instance, learning about different types of spices, flavoring, maybe how much salt to use... how to plan and cook a nutritious meal, how to read food labels, etc. Instead, they gave us a copy of the food pyramid and recipes for cakes. Rather than just make you cook stuff over and over, the class could give you a list of resources to go to and teach you how to evaluate said recipes in terms of nutrition, difficulty, and expense.
- A class that included more economics... or at least personal finance and accounting. And none of that hand-wavy 'save money oowowoooh' crud either. You know, debt, interest rates, inflation, exchange rates, time value of money, expected value, risks, market volatility, etc. It doesn't ACTUALLY have to get into demand and monetary policies and all that, but anything involves real math and that gets the point about compounding credit card debt being bad would be effective.
Granted, my parents and living away at college taught me a lot of that stuff, but since American consumer debt >> American savings, I'm guessing that most people can't count on much of an education in this area.
Post A Comment | Add to Memories | Tell a Friend | Link
I've recently taken up knitting (I knit Matthew a scarf, which he dutifully wore once and now keeps at his desk because he is not a scarf person), and I've discovered that what I really want to do with my knitting is to eventually make this:  In other brain news, I recently found out that the Blue Brain Project (IBM and EPFL [Ecole Polytechnique Fédérale de Lausanne]) has managed to successfully model 10k neurons and 30 million synapses in a rat's neocortical column. Pretty damn awesome :D
2 Comments | Post A Comment | Add to Memories | Tell a Friend | Link
My photographs from France are mostly up. Now I still have to go through Iceland photos. There are already some gems though, including this one.
Matthew approves of the anti-cancer recycling pod.
1 Comment | Post A Comment | Add to Memories | Tell a Friend | Link
Looks like the subject of one of my favorite photos from my trip to Beijing is going to be no more, since the Starbucks in the Forbidden City is closing down.

The Starbucks was jarring and a bit disturbing to see, bringing to mind imagery from movies like Austin Powers 2. On the other hand the frappucchino (the caffeine and the excessive amounts of sugar) was a nice pick-me-up after four hours of walking around.
Post A Comment | Add to Memories | Tell a Friend | Link
Open source virtualization software + repositories for Feisty, Edgy, and Dapper = much happiness VirtualBox's UI is very much like VMWare's, sans the nastiness with the reconfiguring VMWare every time you upgrade your kernel. Did I mention that it's free (for personal use, anyway)? Good performance too.
Post A Comment | Add to Memories | Tell a Friend | Link
 |
|
glyf and I lost our TV remote and wanted a replacement to change the volume, the input settings, and to turn it on. We wanted a universal remote, but didn't want all the extra stuff like channels and whatnot. I saw this but alas, the product is no longer available even on eBay. So I'm was going to try to replicate it using Radioshack parts.
As it turns out, you don't actually need to record the IR signals for many TVs. This guy points out that the information can be taken from Pronto codes. If you don't know what Pronto is, they're exceptionally cool but hideously expensive home automation remotes made by Philips. Looking around though I could not find any codes for my particular TV, so I had to build my IR-receiver-to-audio-in device. This meant that I had to buy a new remote anyway. :(
You will need: a 1/8" mini stereo plug, 3 audio wires, and 1 IR receiver module. I found that rather than buying plugs and wires it is cheaper just to buy an audio to audio cable of whatever length and then cut this cable somewhere in the middle. Mic ports in soundcards kindly provide a steady 5V to mics, so I used this to power my IR receiver. I used an IR receiver module I got for $3.50 at Radioshack and just wired it to the audio cable. Then, point and click (and record) and voila!
We have a waveform! I used Audacity to record and view the audio - it's really a nice sound editor. You'll notice that it's clipped - it doesn't really matter though, since it can't really be used without being modified anyway. Or I guess it can, but I'm better at software than hardware. This really tells you all you need to know about that IR code. You only care about how long the waveform is positive and how long it's negative. The other differences in amplitude are from the capacitor in the IR module. Basically in pulse-width modulated IR signals like this one, bits are encoded by a burst of transmission followed by a burst of silence. The way Sony encodes signals is that the high bits consist of a 48 cycles (carrier signal cycles) of transmission followed by 24 cycles of silence, and the low bits consist of 24 cycles of transmission followed by 24 cycles of silence. So all I really did, after verifying that the durations were what they should be given Sony's 40kHz carrier frequency, was look at the width of each of the pulses. This is all really badly explained, but the link above provides a very thorough explanation. The picture above isn't very good quality so I'll explain what you see: it's the pulse for "Power" being sent three times. You can't see the individual highs and lows in the pulse since I didn't zoom in before taking a screenshot but as far as I can determine, so long as you hold the button down on the remote, it sends out the same pulse over and over. Apparently some other remotes send out different pulses if you hold down the button vs just tapping it. So that's it! I managed to record all the buttons that I needed. I have yet to generate a clean signal or build the transmitter, but as I now have an actual remote the urgency is somewhat less. I'm still interested in building a poor man's version of the $500 Pronto but basically my TV is my only IR device. ( diagrams on how to wire the audio cable to the IR receiver module )
Post A Comment | Add to Memories | Tell a Friend | Link
 |
|
Inspired by my friends Natasha and Nick (who appropriated a bit of green space near an MIT parking lot for their vegetable garden) I decided that I could use my balcony as more than storage space for my bike... if my bike hadn't been stolen. I went to Home Depot and picked up a lightweight planter, some dirt, and some vegetable plants. I've never really tried to keep a plant before, except for one fern that died, so I'm not sure what kind of light, temperature, etc. cucumbers and zucchini need. I figured a few hours of direct sunlight in the morning would be fine and if not - well, the plants were cheap.
I forgot to take into account how windy it is out on my balcony. I nearly lost a sneaker out there. Even though I tried to protect my plants by rooting them deeply, they got blown over after an hour. Not wanting the plants to die the day I bought them, I brought the whole planter inside so that they could recover from the stress of being re-potted without having to contend with the wind as well. They perked up after a day.
Now I'm entertaining ideas of building a mini greenhouse out there, although it would serve more as a windbreak than anything else. I was thinking of putting the planter in a tall fish tank but I'd rather not put anything as breakable as glass on my balcony. The last thing I need is a pebble picked up by the wind to shatter the fish tank. Some glass would probably also be picked up by the wind and injure either person or property. I could also buy a large clear plastic tub in which to put the planter, but I'd rather not pay very much (if at all) for the windbreak.
Post A Comment | Add to Memories | Tell a Friend | Link
I've been looking at various ways to reduce energy consumption, etc. lately (ever since I received a huge electric bill for all the computers running in our apartment). Getting suspend to work on my desktops at home has been a challenge, and still fails sometimes. I haven't been able to get Wake On Lan to work reliably in Ubuntu at all.
But that got me thinking about alternative energy sources, recycling, etc., and I thought I'd post a few links that might be helpful for anyone else living in the Massachusetts:
- Massachusetts State Tax incentives for putting in renewable energy sources in your residence or business.
- MotorWind urban wind turbines - for those of us who don't live on a giant property where you can put up a 30-foot wind turbine, Lucien Gambarota has developed small arrays of wind turbines that can be put up on a balcony or a roof. His business is based out of HK, and currently shipping to the US costs about $300 USD. When I emailed him he said that he is trying to get distributors in my area (whether he means Massachusetts or the Northeastern US in general I'm not sure) and that they will sell a set of 20 wind turbines for $250.
I like that the system is very modular, and that you can buy the wind turbines and go shopping for everything else at Radio Shack. The problem for me is that I can think of no way to power my apartment conveniently with these; there is no outlet outside on my balcony and no way I can run a wire inside my apartment without leaving my balcony door open (and waste more energy either heating or cooling my apartment). I'd have to charge up a battery and physically bring the battery inside to run stuff off it - I guess we can power my TV off of a battery, since we use the TV only sporadically.
- LED light bulbs and strip lighting - basically these are clusters of LEDs that can be used in place of incandescent bulbs. They use less power and last longer, although they are a lot more expensive than regular bulbs. I wish there were LED replacements for halogen light bulbs as well.
- A map I'm maintaining of places you can donate/sell/recycle used items - this is in no way complete. At first I had to keep going to the Goodwill Store, but lugging 20 lb boxes of books or somewhat-lighter-but-still-heavy bags of clothing on the MBTA is not really feasible or convenient and parking is also inconvenient. I recently found a store that has clothing drop boxes in the parking lot though. Where I grew up (NY, suburbia) almost every grocery shopping center had donation boxes in the parking lot, but it's less popular in Boston. I guess there isn't as much open space.
- If you can't find anyplace else, you can also cart electronic items and/or books to MIT campus, dump them in an out-of-the-way corner indoors or on a loading dock, and post to the reuse mailing list (r e u s e {at} m i t {dot} e d u). Make sure to post a sign above them that says "reuse", put your pile well away from piles of stuff that do not say "reuse" on them, and include the location in the post (MIT buildings go by numbers).
Post A Comment | Add to Memories | Tell a Friend | Link
|
 |
|
 |
 |