raid5: cannot start dirty degraded array for mdN

rebuilding a software raid array and stuck with this error? for example, I was rebuilding on a live array and the server took a dive.

try tricking the array into believing its clean, then try to add a new drive or start the array again.


echo "clean" > /sys/block/md0/md/array_state
mdadm /dev/mdN -a /dev/sdXN
or
mdadm --manage /dev/md0 --run

then do a cat /proc/mdstat

raid should be rebuilding!

replace dolphin with konqueror

Dolphin is still missing some features that I have set up in Konqueror.

But EVEN AFTER changing your preferred “file browsing” application to Konqueror under System Settings ->Default Applications, Dolphin still runs on mostly any folder operation. I found that the easiest way to get Konqueror to run instead was to symlink dolphin to konqueror. as root:


cd /usr/bin
mv dolphin dolphinx
ln -s konqueror dolphin

Now Konqueror runs for everything.

PowerGenix NiZn batteries

nizn battery

I managed to pick up a PowerGenix 4-pack of NiZn (Nickel-Zinc) rechargeable batteries and a charger while I was at the International CES in Las Vegas – I saw them demoed at Lunch@Pieros and they were nice enough to donate a pack.

Well, that was back at the beginning of January. I’ve had them in my Wiimote since then, and my battery is still at 100% from a full charge. I thought they were full of bologna, telling me that it was the “next generation” of battery technology, geared towards high-draw use – seriously, how many times have we heard this in the past?

I have a pack of NiCds gathering dust now. They would be on their 37th charge if I was using them in my Wiimote this long.

It seems like we’ve finally seen a STRONG contender towards alkaline AA’s. These batteries even put out 1.6v, a little more than most AA’s, and the same as the best high-capacity lithiums. I really don’t have to mention that it puts the 1.2v of NiCd rechargables to shame.

And another thing, they are cheap.

Intel HDA/Realtek ALC800 surround sound in linux

actually just posting this so I’ll google it in the future and will get to this page. for some reason sound only comes out of the front speakers and is impossible to route to any others. adding this model parameter makes it happen.

/etc/modprobe.d/local.conf

options snd-hda-intel model=6stack

rinse and repeat, I mean, reboot

ten what?

A man goes in to see his doctor, and after some tests, the doctor says, “I’m sorry, but you have a fatal disease.”

Man: “That’s terrible! How long have I got?”

Doctor: “Ten.”

Man: “Ten? What kind of answer is that? Ten months? Ten years? Ten what?”

The doctor looks at his watch. “Nine.”

mysqli prepared statements

one way to make sure that sql injections NEVER happen is to use a prepared statement

perl has been doing it for ages, so by now it should be mainstream, yeah? I wish. but if you’re behind the curve, no worries, here’s how to do it. this is for a simple contact form.

$stmt = $mysqli->stmt_init();
//prepare the statement, use ?'s for where you want to put variables
$stmt->prepare("insert into tbl_contact(contact_fullname,contact_phone,contact_email)
							values (?,?,?)");
//bind your variables to the statement, in order. "sss" means string-string-string
$stmt->bind_param("sss", $_POST['fullname'], $_POST['phone'], $_POST['email']);
$stmt->execute();
  • use a question mark for every time you want to use a variable
  • for bind_param, the “sss” means I am going to be substituting 3 strings for the question marks. if I said “sis” that would mean I have one string, then an integer, then a string