I Eat Rainbows

The random ramblings of a self-professed rainbow eater

Posts Tagged ‘linux

Ramdisks, Firefox, and the speeding up thereof

without comments

So this idea has been going around the internet, of putting your firefox profile directory into tmpfs, to get around sqlite’s insistence on reliability when speed is more important.

I implemented this, and liked it. Speed, nom.

But! I happen to be using an ailing old laptop, with roughly as much RAM as a toaster. It could just handle the extra load, but the profile directory was constantly spewing expletives at me – most notably, failing silently when trying to install addons.

There did exist RamFS, which grew and shrunk in RAM as needed. Still, that’s a lot of memory…

And, well, the idea itself didn’t seem that elegant to me. Storing an extra copy of your profile directory? and resynchronising it with the harddisk copy every so often? This is Linux, after all, the OS that gives you fine-grained control of your system should you so desire – surely there must be a cleaner way.

And then … from what I understood, SQLite was IO bound in writes. Reads shouldn’t really need locks or suchlike, right?

This is what I did:

$ x=[random junk firefox uses]
pushd
cd ~/.mozilla/firefox
mv $x.default $x.default.fs
mkdir $x.default.tmp
mkdir $x.default
echo firefox.tmp $(pwd)/$x.default.tmp ramfs noauto,user,exec 0 0 | sudo tee \
    -a /etc/fstab
echo firefox.cow $(pwd)/$x.default aufs \
    dirs=$(pwd)/$x.default.tmp:$(pwd)/$x.default.fs=ro,noauto,user,exec 0 0 | sudo \
    tee -a /etc/fstab
sudo sed -i 's/exit 0//' /etc/rc.local
echo "mount firefox.tmp\nmount firefox.cow\nchown -R $(whoami): \
    $(pwd)/$x.default.tmp\nexit 0" | sudo tee -a /etc/rc.local
echo rsync -av --delete $(pwd)/$x.default/ $(pwd)/$x.default.fs/ > ~/bin/cpfox
chmod +x ~/bin/cpfox
popd

Then crontab -e and add cpfox to it, maybe once every halfhour.

Neat, huh? At least the intent – aufs layering a dynamically growing ramfs on the filesystem, and the changes being synced across every so often. I’m not too sure if the actual implementation does what I want it to, and it could probably do with a ram-clear every now and then.

If anyone has any tips, please! Meanwhile, I hope this will help some people out there.

Written by Sohum

20.02.2009 at 21.53.46 (954)

Posted in linux, technology

Tagged with , , , , , ,

I love Linux

without comments

…if only for all the choice.

I am currently running my entire desktop in greyscale. Why? Because Linux (Specifically, Compiz|Beryl) allows me to, and I find it easier on my eyes at this general area in spacetime.

Written by Sohum

12.02.2007 at 21.25.56 (934)

Posted in linux

Tagged with

“Linux? That sucks!”

with one comment

I just had an experience, which I would deem to be typical of a large subset of “the average user”.
I was reading A Cost Analysis of Windows Vista Content Protection (if you haven’t read it, and will have something to do with Windows Vista in the future, even looking at a box, do so. Now.)
Guy walks up. “What’re you reading?”
I show him the title.
“Vista? Yeah, I heard about Vista. Didn’t it fail, or something?”
“What do you mean, fail? Anyway… the point is that Vista by it’s very existence deliberately cripples…”
“What do you use? Oh, I know, you use a Mac, right?”
I shake my head.
“So you use use Windows?
Head shaking repeats.
Sputter. “But what else do you use then? I mean, you have to use Windows or Mac…!”
“I use Linux.”
“Linux! That sucks! Isn’t it free? So how can it be good?”

The conversation was cut off here by circumstances out of my control (specifically, the arrival of my teacher).

This sort of people, who have either never heard of open-source or have very prejudiced ideas about it’s capability, is very common, in my informal survey.

Linux needs to reach out to these people as well, I think. Education is a large component of reaching the masses, and nothing educates better than a few well-designed clips of viral video, methinks…

Written by Sohum

12.02.2007 at 21.19.41 (930)

Posted in linux, suggestion, thoughts

Tagged with , ,

The iPhone, take 2

with 3 comments

There goes Jobs’ reality distortion field. Whoosh, it says. Wheee.
In the calm light of a couple of days later, the iPhone doesn’t look so hot — especially considering it won’t be user-developable.
US$500, + a 2yr contract, at minimum for a device with no 3G support.
Locked to Cingular.
In US in June; not in Asia until 2008.
Probably no Skype — Cingular would object.
Maximum 8 GB, for a device that’s supposed to be excellent for video.
Probably no Nike Sports kit
No one but those with Apple’s say-so can develop on it. According to Jobs,

These are devices that need to work, and you can’t do that if you load any software on them. That doesn’t mean there’s not going to be software to buy that you can load on them coming from us. It doesn’t mean we have to write it all, but it means it has to be more of a controlled environment.

I think mark, from [dive into mark], said it best when he said,

Translation: I made this beautiful thing, and I’ll be damned if I’m going to let you unbeautiful people fuck it up.

Me? I’m holding out for version three, or four. And only then if I can run Linux on it.

Written by Sohum

12.01.2007 at 18.43.24 (821)

The iPhone

without comments

Wake up. Yawn.
Sit at computer. Check email.
Check feeds.
THE iPHONE IS OUT AND IT’S COOLER THAN…
Ok, wait a minute. What?
*Gasp* The iPhone! It’s out! It runs *bleep* Mac OSX!
Look, I can’t tell you this in all its awesomeness properly. Go read Engadget’s live — and awesome — reporting.
To wrap up:
They’ve taken one iPod, made it widescreen, with one physical button (home).
They’ve changed the internals sufficiently to run Mac OS X on it. (Awesome feature #4590: True multitasking!)
It does CoverFlow.
They’ve integrated a phone into it. (BTW, if you’re listening to music and a call comes in, it fades out the music! Then, it fades it back in when you’re done!)
It has a 2.0 megapixel camera, WiFi (b|g), EDGE and Bluetooth.
Rechargeable battery.
They’re running Safari on it.
They’ve partnered (well, sort of) with Google and Yahoo, for search, maps, and mail.
It’s controlled with thumb-sliding and a touchscreen (hope the screen’s harder to smudge than my iPod’s).
It syncs with iTunes 8.
It’s only available with Cingular in the US.
It’s available from June in the US, Q4 in Europe, and 2008 in Asia (Take that, Japan!)
4GB iPhone + 2yr contract = US$499. 8GB iPhone + 2yr contract = US$599
No details about other countries (say, Australia? Come on Steve!), but it is GSM, with a SIM card…

The other part I’m interested in? If it runs Mac OS X, who’s to say, with some kernel hacking, you couldn’t run Linux on it?

Excellent…

Written by Sohum

10.01.2007 at 08.20.44 (389)

Ubuntu Satanic Edition

without comments

Hehe.. An “Ubuntu Satanic Edition” is out. It’s just a set of packages for Edgy, or, preferably, Ubuntu Christian Edition. I just installed it, and it looks trés awesome. Especially combined with the Beryl flame effect. Hehehehe….

Ubuntu Satanic Edition

Written by Sohum

04.01.2007 at 15.35.53 (691)

On the fragility of Linux machines given the root password

with 2 comments

So, yesterday, I downloaded the new svn of beryl. Compiles perfectly, but when I run it, it spits out an error.

[some random part] is at version X, while beryl is at version X+1. Sorry, no can do.

Some googling tells me that the simplest solution is to delete everything with ‘beryl’ or ‘emerald’ in the filename, and redownload and recompile.
I get… enthusiastic, and accidentally sudo rm my /usr/bin and my /usr/include.
Now, being the idiot that I am, I haven’t taken a recent backup. The latest one is an Ubuntu 6.06 one (and me running Ubuntu 6.10 now). Some nice folk on ##linux tell me that by far the easiest method is to backup important data and reinstall.
Backing up’s simple from a live cd. Backed up /home, /var, and /etc.
I’ll finish downloading the i386 install cd about 7 hrs from now (I’m downgrading from amd64 (it annoyed me), and we have odd off-peak hours for bandwidth). Till then, I’m stuck using Windows.
Now, my point is, how easy it is, and how easy it should be, to trash a linux system given the root password? It doesn’t complain at sudo rm -fdR /* (I haven’t tried it, but I assume it won’t).
I understand the philosophy behind the root password and everything (oh, if you are root or have sudo access, you’re assumed to be intelligent and careful and all that jazz), but the simple fact is, humans make mistakes. It shouldn’t be that easy to trash your system.
Something as simple as some sort of clarification mechanism on system critical files would go a long way towards alleviating this.
e.g.

bash$ sudo rm -fdR /usr/bin
You are attempting to delete system-critical files (like /usr/bin/sudo). Are you sure you want to continue? (y|n)

One example should be enough. Without an example, the user might figure what he wanted to delete is the system-protected file.
Maybe this functionality already exists. One guy on ##linux mentioned sudo’s ‘bitch mode’. This might be what I’m looking for. If it is, at the least it should be turned on by default.
As a digression, Beryl is très awesome. Very annoying to compile at times, but 0.1.3 should be available for your distribution now.

Written by Sohum

20.12.2006 at 05.08.00 (255)