Engineering and technology notes

HOWTO: Repair a broken Ext4 Superblock in Ubuntu | Linux Expresso

HOWTO: Repair a broken Ext4 Superblock in Ubuntu

31mar10

This has happened to me a few times, and it’s not a nice problem to find yourself in. You computer won’t boot, all your filesystem checks tell you you’ve a bad superblock, but you cant seem to find how to fix it. Well, here goes ?

This guide is for ext4 , though I’ll explain how other filesystems can be cured along the way. The easiest way to carry all this out, seeing as your computer probably won’t boot at this stage, is to download and burn a copy of Parted Magic. Boot from that, and you’ll access to a number of useful tools.

First, figure out what partition we’re dealing with.

1
sudo fdisk -l

The above will list all the partitions on all the drives in your computer. To recover a lost partition, your going to need Testdisk. Testdisk is included in Parted Magic, and there’s a great guide on their site. For this though, we just need the partition number, such as /dev/sda3 or /dev/hdb1.

Now, make sure your superblock is the problem, by starting a filesystem check, replacing xxx with your partition name. Here, you can change ext4 to ext3, or ext2 to suit the filesystem.

1
sudo fsck.ext4 -v /dev/xxx

If your superblock is corrupt, the output will look like this

Source: HOWTO: Repair a broken Ext4 Superblock in Ubuntu | Linux Expresso

php pass data to html form – Stack Overflow

I have php file that contains variables:$t1 = $_POST[‘t1’];$t2 = $_POST[‘t2’];and I need to pass these variables into the respective html form fields:form is located in different page than php file with variables. it’s url is “form.php”I guess I need to create php post command in my php file that redirects to url “form.php” and loads $t1 and $t2 into respective form fields “field_1” and “field_2”?Trying around but can not find right solution..Any ideas appreciated Brgds, Raivis

Source: php pass data to html form – Stack Overflow

html – How to call a JavaScript function, declared in , in the body when I want to call it – Stack Overflow

I have a working JavaScript function declared in the head of an HTML page. I know how to create a button and call the function when the user clicks the button. I want to call it myself some where on the page:myfunction();How do I do it?

Source: html – How to call a JavaScript function, declared in , in the body when I want to call it – Stack Overflow

How to call a PHP file from HTML or Javascript – Stack Overflow

I’ve looked around for a long while now and I can’t find anywhere that answers this seemingly basic question. I don’t care if the page reloads or displays the results immediately; I just want to have a button on my website make a PHP file run. That’s it. And I’ve found that all websites either tell you how to run the PHP code in your HTML directly or tell you to use ajax. I’ll use ajax if it turns out to be necessary, but there was a time before ajax existed that PHP was used, so I think there’s a simpler way. If I can write the code inside HTML just fine, why can’t I just reference the file for it in there or make a simple call for it in Javascript?If it does turn out that ajax is the only way forward, what do I need to know about it to call a PHP file that will create a text file on a button press? I’m making a simple blog site for myself and I’ve got the code for the site and the javascript that can take the post I write in a textarea and display it immediately. I just want to link it to a PHP file that will create the permanent blog post on the server so that when I reload the page, the post is still there.Thanks for taking the time to read and answer.

Source: How to call a PHP file from HTML or Javascript – Stack Overflow

Arduino – DhcpAddressPrinter

This sketch uses the DHCP extensions to the Ethernet library to get an IP address via DHCP and print the address obtained using an Arduino Ethernet shield. DHCP is used to assign an IP address when Ethernet.begin(mac) is called. Using DHCP significantly increases the size of a sketch. Using the localIP() function, the assigned IP address is sent out via the serial monitor.

Source: Arduino – DhcpAddressPrinter