|
|
Index: Home | What Is Izumi | Misc Links | Random Thoughts | Too Much To Read | The Rant Vault | Quotes
I've been doing some Ruby again these last few days. I needed some scripts to do some server maintenance and writing them in bash looked too ugly. So I just rewrote them in Ruby and they look much much better.
Looking back on Ruby, the language is interesting. From an outside point of view
it looks a bit clumsy sometimes -- for example @var constructs. There's also
a lot of room for confusing syntax -- or better worded flexible syntax which can
generate confusing code. One example is the fact that you can call a method
without using parentheses. Pretty cool at first. If you come from any other
language that means that at first your see a construct such as blah.foo and
you don't know if foo is a member, a method, a variable, etc. Ruby's point
is that the difference is moot. I don't quite buy it as we're dealing with
procedural languages which work by generating side effects so you want to know
when side effects occur -- and Ruby's answer to that is that foo! generates
a side effect but foo should not. Well it may be.
In the end it's all a matter of conventions: learn the possible syntax and then decide what works for you and try to be consistent about it.
The libraries are also important and there are plenty around so they are not an issue.
Eventually maintenance in the long term is what matters. I'll see how it works.
Python, with its ugly need to write self.foo all
other the place, is at least very predictible and so far when coming back to an
old Python scripts aeons later I had no trouble remembering how it worked and I
could dive right in. I'm not quite sure about Ruby in this context, as even to
remember some basics I had to look at other code I wrote 6 month ago and needed
to open the book to remember the @var thing. However Python is too verbose
to do shell scripting whereas Ruby can be as consise and cryptic, err I meant
efficient, as one wants it too be.
Now don't get me wrong. I'm won't go as far as claim that Ruby is an acceptable LISP yet I'll claim that Ruby is good enough.
| Night lights. | Outside. |
| Dark. | Pretty. |
| I wait. | She's done. |
| I'd like too. | Not tonight. |
| Won't happen now. | Who knows. |
| Or maybe it will. | She does. |
And so I wait.
Sleepless.
Incomplete.
I wish the history project would come to a conclusion. I could really use the trail display to view browser history. Of course I could write a complex JavaScript extension for Firefox that does just that.
Or I could simply use something like this:
# grep " GET http://en.wikipedia.org/wiki/" /var/log/squid/access.log | sed 's/1.*GET //' | cut -d \ -f 1or
grep ": en.wikipedia.org/wiki/" /var/log/privoxy/logfile | sed 's@^.*: @http://@'
although there's not enough info to infer which link comes from which page.
In the end I'd like to end up with something like this:
Guglielmo Marconi > Invention of radio > History of radio > Spark-gap transmitter > Spark gap > Vacuum arc > Very low frequency > Whistler > Twenty second pulse > Superpulse > VLF transmitter DHO38 > Electromagnetic radiation > Electromagnetic spectrum > Extremely low frequency > Communication with submarines > Skin effect > Communication with submarines > Proximity effect > Tesla coil > Faraday cage > Heterodyne > Superheterodyne receiver
FFS > Unix File System > Soft updates > BSD > Plan9 > OSF/1 > VLSI Project > FreeSBIE > PC-BSD > Comparison of BSD operating systems > XNU
Lye > Sodium hydroxide > C4 > C4 > RDX > Slurry > Shaped Charge > Detonator > Blasting Cap > Plasticizer > Brisance > FofI > Glass Transition > Amorphous Ice > Thermoplastic > Cross Link
To make things more interesting, my goal is to try to use my aging Vaio PCG-R505TLK as a firewall box, connected to the ADSL, and then use a fresh Debian 2.6-based server behind this. The firewall would run either OpenBSD or FreeBSD, depending on what can actually install on this laptop and what hardware is supported -- I'll need both the integrated ethernet and an ethernet PCMCIA to work.
OpenBSD would be a natural choice for being the most secure out there (or so being advertised, it's not like I actually tried or would know how to break it), whereas FreeBSD would be a better choice for speed and also because a quick Google search indicates it will most likely support this hardware (assuming a PCG-R505DL is not too different, which remains to be seen).
Overall FreeBSD seems also to have a more accessible documentation (their handbook proves to be really valuable to getting started with the system) and there is a lot more material available on the web (i.e. FreeBSD vs OpenBSD but of course this is very relative.)
That being said, if it all works I might need to replace the Vaio CPU cooling fan again. Yep the original one broke (seems like the wheel bearing died) and the second one has a broken blade.
I've been playing with FreeBSD and OpenBSD recently. Currently the former one is winning.
I've been going back and forth on how I want to restructure my network here but finally I think I get an idea of what I want (which may not be what I end up doing anyway):
Ideally I'd have two Debian servers inside: one for mail & web and one for my dev and day-to-day hacking. Currently I'd do all of these functions on the firewall itself, which is a disaster waiting to happen. Since I want to limit the number of boxes I have around (there's already plenty enough) I might try to run Xen or OpenVZ to make two paravirtualized servers in the "file" server. I've been wanting to experiment with those for a while so that may be worth it.
We'll see what really happens. It's not like I have tons of free time anyway. But at least I have a clear plan now.
Several months ago I won a fight and managed to actually get NX to work between my two laptops, my desktop at home and my desktop at work. I was using the FreeNX 1.4/1.5 server on Linux in conjunction with the NX Client 1.5 on Windows.
Eventually last month, my setup kind of broke. First on the PC laptop, it stopped working after a Cygwin upgrade. Great. Then eventually my desktop at home did the same thing along with some other oddities breaking Cygwin in general and X11 in particular.
When using FreeNX 1.4/1.5 I also had this weird issue where resuming sessions would not quite work as intended, i.e. the session would resume but the Windows client would enter the floating window mode (i.e. floating Windows windows instead of having a big frame-buffer-like window.)
So anyway I bit the bullet and did a full reinstall of both Cygwin and NX but this time I upgraded to NX Server 2 and NX Client 2. Now the nice part is that NX makes the server available as a free (as in beer) download for Linux, so I don't need FreeNX anymore. It also means that since I got both matching pairs, the resume session thingy works like a charm.
Installing the client on a Windows box still requires the same old trick as
explained before, meaning as soon as you installed the binary,
go fish in the installed bin directory and remove the duplicated Cygwin DLLs
(you need to do that as soon as the install is finished before running it once,
or you risk registering the wrong Cygwin DLLs and after it's a big mess to get
it right.)
Now when I do that I get weird error messages when I start the NX Wizard on
windows, namely it complains cygwin1.dll cannot be found, among other
things, but if you just dismiss the dialog boxes it simply works. And there are
no error messages when actually trying to use a pre-created profile, so it's not
bothering me too much.
Oh and final point, I recently tried using NX over SSH in the shuttle with an 1xEDVO link and it works! There's quite some lag and it's barely usable (text- mode SSH is already tricky enough to use sometimes) but it was still impressive to see it work.
Everyone here as a cold, which started a couple weeks ago with babies and has been lingering around. Since Friday I was in a moderately bad shape, I took the day off as a sick day and we all went to the pediatrician, whom just confirmed the babies' cold (which is a good thing, meaning it's not pneumonia or anything too nasty.) I also managed to get an appointment with my doctor, whom also confirmed the cold. Apparently there's nothing much to do at this point but wait for it to go away. On the plus side, I got a flu shot. He also noticed my ears being full of wax -- something I knew but I never really managed to take care of. One thing I didn't know is that the nurse had a way to clean this, and she managed to get rid of two quite large block of hard wax. Not exactly pretty but really efficient and welcomed. The side effect is of course that I hear a lot better, as if someone had removed the low-pass filter that was stuck in my ears. I don't ear things any louder, the overall volume seems to be mostly the same but high frequencies sound really crisp now.
I would be interested in seeing the result of an audibility test. Back in the BeOS days I remember writing a tone generator and when testing I remember being able to easily hear up to 17 kHz using non-audiophile hardware. I feel like I could surely do a lot better than that today.
I found out that many time there's some piece of technology that's totally confusing me so logically I start writing an email to my friends.
Here's an example:
Quick question: I'm thinking of rebuilding my firewall (well for the past 6 months at least but it looks like I might actually do it before the end of the year!) and one of the things I want is to use a RAID 1 with 2 SATA drives.
Now I noticed that in my mobo there's a "RAID SATA" option (ABIT NF8-V PRO, apparently all nForce3 mobos have the same stuff). By looking a bit online, these seem to be classified as "fakeraids". The Wikipedia entry on raid explains that these mobos don't actually have a true RAID controller and that it's partially done by the OS.
So the question really is should I use a pure-software RAID solution or use the fakeraid solution provided by my mobo and check before hand it has support for the OS I want (in this case I'll go for OpenBSD/i386.)
At that point I fire a couple of Google searches to provide handy links. Generally I already did some search before hand but that yield nothing interesting, so now that I carefully phrased the problem I can issue better Google queries.
Let's see:
"Some of these chips are sometimes used in low-cost software-based RAID systems. This mode of operation is not supported in OpenBSD"
"Software Options: OpenBSD includes RAIDframe, a software RAID solution. Documentation for it can be found in the following places: [...] Non-Options: An often asked question on the mail lists is "Are the low-cost IDE or SATA RAID controllers [...] supported?". The answer is "No". These cards and chips are not true hardware RAID controllers, but rather BIOS-assisted boot of a software RAID. [...]"
So now I have all the answers to my questions. I can simply discard my (now useless) email! I like simple questions that have been over and over-answered and are marked as clearly as possible in FAQs :-)
So what happened during the last month? Quite a bit actually:
On the tech side:
Firefox 2 has landed a few week ago. If you like Firefox and still use the 1.5, don't hesitate to upgrade to 2.0. It's mostly evolutionary and overall it looks cleaner. It has many new features yet most of them are invisible to end-users (which is good: improvements don't have to radically change the UI and the workflow at each major release. This is not Office.) One of the features worth-mentioning is the integration of Google Safe Browsing, which detects phishing pages. This in itself justifies updating. Nobody would like landing on a fake bank page which is just there to steal your bank password or account information. Speaking of which, the latest Thunderbird 1.5 email client also has integrated phishing detection.
Another feature I like is that they integrated the ability to save tabs when closing. This means you can shut down your computer and when you'll start again Firefox will display the same pages you were looking at before.
Anyhow there are 2 extensions I need to be able to use Firefox correctly, namely SessionSaver and SwitchProxy.
As I write this they are still limited to Firefox 1.5 and refuse to work with 2.0. So I just took the official XPI files from the pages above and bumped the max version number to 2.5, and they seem to work just fine (your mileage may vary). They are available here:
Use at your own risk. Before you use these I encourage you to visit the official pages listed above to see if there are official versions that support Firefox 2.0.
Blog Archives:
Most recent posts
2006/11/04 - 2006/09/24
2006/09/24 - 2006/07/28
2006/07/27 - 2006/04/29
2006/04/24 - 2006/01/21
2006/01/21 - 2005/12/17
2005/12/12 - 2005/10/04
2005/09/25 - 2005/08/28
2005/08/28 - 2005/06/14
2005/06/11 - 2005/05/24
2005/05/17 - 2005/04/22
2005/04/14 - 2005/03/22
2005/03/18 - 2005/01/15
2005/01/13 - 2004/12/17
2004/12/16 - 2004/12/03
2004/12/02 - 2004/11/21
2004/11/21 - 2004/06/20
[RSS]
|
|

This work is licensed by Raphaël Moll under a Creative Commons License.
|
|
| Color Theme: | Gray | Blue | Black | Sand | Khaki | Egg | None |
|
|
|
|