Showing posts with label geeky. Show all posts
Showing posts with label geeky. Show all posts

Sunday, April 25, 2010

File server and backups

So I bought this cheap little network-attached storage (NAS) device the other day (http://bit.ly/dns-323). It's got a 500MHz ARM processor and 64MB memory. There's a nice wiki (http://wiki.dns323.info/) with howtos for the power user.

It includes a web interface, UPnP server, iTunes server, FTP server, Samba server, and add-ons from D-Link that you can install. The latest firmware runs a 2.6.12 kernel. I installed a debian chroot onto it and so now I can ssh into it and run a bittorrent client.

I've read that with both drives spinning, it will will use roughly 25W.

So, I store almost everything on the file server and access files over the network.

RAID is for redundancy, not backup! Therefore, I opted to format the drives separately and backup one drive to the other. I heard about a nice idea to buy another drive, store it offset, and rotate it with the backup drive every month. I might consider doing this in the future.

Friday, January 29, 2010

My beef with Linux RAID

I have used software RAID in Linux in the past, via mdadm. I believe it has resulted in lost data more times than it has saved me from losing data. I have since switched to ZFS (on FreeBSD) and have survived many situations that could have resulted in lost data.

I'd like to be able to switch back to using Linux, so I have been doing some research on Linux RAID. Today I came across this article, which contains the following text:

For a RAID-1 config with two disks...If both blocks were readable (i.e. were read from the disk, without the disk indicating any sort of error condition), but there was a mis-compare, then the data from the highest-numbered disk is copied to the other disk. This results in a 50-50 chance that good data was over-written by bad. Furthermore, this is done silently: no syslog messages indicate either a mis-compare, or that a repair action was taken.
That's right! mdadm doesn't checksum your data to prevent this from happening! ZFS does. So, for example, you could write random data to one of your drives:

cat /dev/random > /dev/hda1

In ZFS, no problem! In RAID-1.... fail?

Reblog this post [with Zemanta]

Friday, January 22, 2010

YouTube Offers Experimental Opt-In HTML5 Video

Click here to opt-in to the HTML5 beta on YouTube. I tried it out and found that with HTML5 enabled, my CPU utilization is 1/3rd.

YouTube Offers Experimental Opt-In HTML5 Video: "bonch writes 'YouTube is now offering the experimental option to view all YouTube videos using HTML5 in H.264 format. Supported browsers are Chrome, Safari, and the ChromeFrame plug-in for Internet Explorer. Captions, ads, and annotations aren't yet supported but are coming soon.'

Read more of this story at Slashdot.

"

Saturday, January 09, 2010

Golden Ratio Discovered In a Quantum World

My dad and I like the Golden Ratio. Here's something neat.

Golden Ratio Discovered In a Quantum World: "FiReaNGeL writes 'Scientists have for the first time observed a nanoscale symmetry hidden in solid state matter. 'In order to study these nanoscale quantum effects, the researchers have focused on the magnetic material cobalt niobate. It consists of linked magnetic atoms, which form chains just like a very thin bar magnet, but only one atom wide.' By artificially introducing more quantum uncertainty, the researchers observed that the chain acts like a nanoscale guitar string. The first two notes show a perfect relationship with each other. Their frequencies (pitch) are in the ratio of 1.618, which is the golden ratio famous from art and architecture. The observed resonant states in cobalt niobate are a dramatic laboratory illustration of the way in which mathematical theories developed for particle physics may find application in nanoscale science and ultimately in future technology.'

Read more of this story at Slashdot.

"

Thursday, December 24, 2009

Yeah, um... boooo FileVault.

I kept trying to deactivate FileVault, but if OS X failed to decrypt any corrupted files, then it would abort and refuse to deactivate FileVault. So, I had to manually decrypt the files (mv them out of my home directory) before OS X would allow me to deactivate OS X.

My conclusion: Do not use FileVault.

Friday, December 18, 2009

IO-related freeze

My Macbook Pro is misbehaving. Every few minutes, it will freeze for about 10-15 seconds while accessing the hard drive. I recently enabled file vault for my home directory. I have run the disk utility on both the hard drive and the sparse image of my home directory. Not sure what is going on here. I guess I will create a new account that doesn't have file vault and see if it behaves the same way.

org-mode speed keys

I use org-mode in Emacs, and today I discovered "speed commands":

org-use-speed-commands is a variable defined in `org.el'.
Its value is t

Documentation:
Non-nil means, activate single letter commands at beginning of a headline. This may also be a function to test for appropriate locations where speed commands should be active.
So, when you put your cursor at the beginning of a headline, then many commands are accessible by a single key.

Sunday, November 29, 2009

My new headphones

A friend shared via Google Reader Giving Experiences, Not Things, This Holiday Season.

I've wanted a nice pair of headphones for a long time, and decided they might as well be wireless, but was always overwhelmed trying to figure out what to get. Erinne's gift to me for Christmas is a pair of Motorola S805 headphones. Her real gift is the time and effort she spent finding me the ideal headphones at a very nice price.

They have all the controls you need for playing music and making calls. They have an invisible microphone. They work very well with my phone. They sound awesome. You can plug them in and use them in to any device as wired headphones without using the batteries.

They have a significant amount of static and hissing when I pair them with my Macbook Pro or with Erinne's Macbook, but they sound absolutely wonderful when I pair them with Erinne's G1. What's up with that?

Friday, October 09, 2009

DotA

While browsing a few Wikipedia articles, I discovered that Valve has hired IceFrog, who has been developing and maintaining Defense of the Ancients (DotA) since 2005, and that we may see Valve produce a DotA title...
Reblog this post [with Zemanta]

Sunday, September 20, 2009

Video Game Nostalgia

I had Thunder Force III on Sega Genesis when I was a kid. I tried over and over to beat it, then I watched a friend beat it, and after that it was easy. The greatest part about this game is the ending. Hilarious.

In a flash the planet of ORN
disappeared completely.

ORN could no longer control
the huge amount of energy
that had accumulated
after he lost his owner.

The Emperor ORN
had been disturbing
the Union of the Milky Way
for a long time.
What was his true character?
It was a huge bio-computer which
had been made in the beginning
of the space age.

Besides,his computer brain was
developing extraordinary,and he began
to have his own will.

He denied the existence of human
beings and finally he exercised
a program to kill
the whole human race.
It was evidently human beings
who had given him this idea.
Therefore human beings should
think of the meaning deeply.

Anyway the war was over.

And a peaceful time came soon.
It might be for a short time.
Human beings,think about
what you have done.

After the important mission was
completed,STYX turned over
his airframe to the base
fellows waiting for them.
Jean and Sherry,you might aware of
the real meaning of
"true peace"


Friday, August 28, 2009

iTerm and Terminal

One of the first things I did after getting OS X (It was an iBook G4) was to switch to iTerm, an alternative to the Terminal.app that ships with OS X. One of the main reasons for doing this was support for tabs.

I kept using iTerm, from that iBook G4 to a white Macbook, to a unibody Macbook Pro.

But iTerm has disappointed me too many times over the last few months. It tends to crash every now and then. More recently, I've noticed that when I hold down a key, the key repeats without refreshing the screen. That is, I don't see the result until after I let go of the key. This is unacceptable.

Apparently Terminal.app has come a long way, including adding support for tabs (though I cannot select a specific tab with a keyboard shortcut like I can on iTerm). It also seem much smoother, both in the rendering of fonts and in the response time to my input. So, I am giving it another try.

Reblog this post [with Zemanta]

Thursday, August 27, 2009

Wireless Security

WEP has been deprecated and insecure for a long time. Cracking WEP is as easy as this.

But now researchers have demonstrated a way to crack WPA in just one minute (here).

It only works on TKIP, so switch your wireless access point (typically your router) to use AES.

Wednesday, August 26, 2009

Tabs or Spaces!

I use Emacs. My coworker/boss uses Vi. Actually, he uses a Vi mode inside XEmacs.

I use spaces. He uses tabs. Our other coworker is the guy in red as shown here.

EDIT: Fortunately, we all use OS X.

Tuesday, August 25, 2009

Verilog Woes

As a language, Verilog is decent. It's a little too low level for my tastes, which is why I used to use Cryptol and now use my employer's fork of Cryptol called Quattro. Cryptol/Quattro allow us to write much more abstract, generic, and parametrized code, and to do so usually with no loss in performance.

Then there's the inconsistencies between simulation and synthesis tools, especially if your tools come from different companies. A language construct might be supported by your simulation tool but not your synthesis tool, or vice versa.

And then there's the case where your tool just does something batty. For example, lets say that I have an integer parameter P in module A, and I a string parameter P in module B, and I want to instantiate B inside A and have A's parameter determine B's parameter. So, I have something like this:
defparam B_inst.P = (P == 0) ? "TRUE" : "FALSE";
Fine and dandy right?

For whatever reason, my Verilog simulator decided that the two branches of the expression, the two strings, had to be the same length. So, it padded "TRUE" with a space at the beginning to become " TRUE". I did a lot of experimenting to verify that this is in fact what is happening. For example, if I change "FALSE" to a string of 4 characters when P is 0, it works fine.

Reblog this post [with Zemanta]

When to automate, abstract, generalize?

When you have a repetitive task to perform, at what point is it worth it to write a script to automate the task? When is it appropriate to abstract away the details? When should you write one highly parametrized function, and when should you write several specialized functions?

More importantly, how should you go about answering these questions beforehand so that you don't go down the wrong (i.e. inefficient) path?

At a conference a couple years ago I attended a talk that addressed some of these questions, but I do not really remember much about it...

I found myself dealing with all of these questions today. I had written some highly parametrized Verilog modules, but it was very tedious to support each variation. Furthermore, I ran into a bug in the simulator (described at the end of my next post), and I decided to circumvent the bug by splitting each module into a few specialized modules. I was then faced with the tedious task of factoring each module into its specialized variants, so I decided to write some elisp to do it for me.

So, in the end I found that I had made the wrong decision to implement parametrized modules, though I could not have predicted the ridiculous bug that I ran into and so was justified in the decision. I feel like writing the elisp to automate the rewrites of each module saved a lot of time, but I cannot really be sure.
Reblog this post [with Zemanta]

Saturday, August 15, 2009

Emacs 23

Emacs version 23.1 is now stable. I have deployed it on several Linux machines and on my Macbook Pro. Emacs 23 natively supports OS X [1] (support for the NeXTstep APIs was integrated into CVS in July 2008 [2]), so building on OS X gives me an Emacs.app that runs as a Cocoa app.

Emacs 23 adds support for daemon mode (via "emacs --daemon"), which is like Emacs Server in that you can connect to it and open files using emacsclient, except that you do not have to have any frame open. I use the following shell aliases to send files to the daemon, run Emacs commands, and open new frames:
# start a windowed frame
alias ec="emacsclient -n -c -a emacs"

# start a terminal frame
alias em="emacsclient -t -a emacs -nw"

# do not start a new frame
alias ea="emacsclient -n -a emacs"
I also set EDITOR so that most programs use the daemon to open files:
export EDITOR="emacsclient -t"
I use daemon mode like GNU Screen, though I also leave Emacs terminal frames open inside Screen windows.

Starcraft 2 (Tower Defense)

http://starcraft2.pro/beta

Fun times.
Reblog this post [with Zemanta]

Y2k (Fear and the Media)

I do not watch news programs that contribute to a culture of fear (so basically I only watch the Daily Show). It is a despicable practice.

Thanks to the media, ten years ago computer illiterate people everywhere were panicking about the Y2K bug. I found the following quote on Computer Stupidities: Y2K from a TV news program.
You open your eyes, slowly waking up. It's Saturday, January 1st, 2000. What time is it? You look at your bedside clock, but it's blank. Is the power off? You check your digital watch. It's blank, too. The coffee maker, which runs on computer microchips just like your wristwatch, doesn't work. The same for the microwave oven and the stove. Your three-year-old computer-controlled car won't start.
You cannot excuse that as ignorance.

Reblog this post [with Zemanta]

Monday, July 13, 2009

iPod Touch Bluetooth

Dear Apple,

I bought the OS 3.0 update for my iPod Touch because you advertised stereo bluetooth support. However, my first generation iPod Touch has no bluetooth support at all. I am disappointed. I hate you. You make me cry.

- Philip

Saturday, April 04, 2009

Stupid Google

A few days ago I created a virtual portfolio on Google Finance, and I gave myself $100,000 to play around with. Today I sold some shares, and then noticed something odd. Although the "market value" column is correct, the "cost basis" and "gain" columns are, well, see for yourself: