You may already know that a hard drive on Windows is formatted as Fat32 or NTFS partions. But how do you convert from a popular file system to one that you need in Linux? GParted is free software that through an easy to use interface allows the format and partition of an entire hard drive.
The supported file systems are:
- ext2
- ext3
- fat16
- fat32
- hfs
- hfs+
- jfs
- linux-swap
- ntfs
- reiser4
- reiserfs
- ufs
- xfs
The application is most easily downloaded as a Live CD (which is a CD that can be automatically booted during startup from the console). Before using this application, be sure to back up any information on the drive, as the operations will clear all data.
The application can be downloaded from their website at http://gparted.sourceforge.net/. The latest version as of the writing of this article is version 0.3.8
When using web technologies PHP and MySql on a web application, you may come across the need to add the current DateTime in your database. A simple way to get the server time in PHP is to use the $_SERVER['REQUEST_TIME'] function. It will return the time in seconds since January 1, 1970. In our example, we return the number of seconds to a variable $timestampInSeconds.
$timestampInSeconds = $_SERVER['REQUEST_TIME'];
The next step once you get the the seconds is to convert it into a format that MySql will understand. In particular, MySql DateTime is ‘2008-08-01 20:01:05′. Pay attention to the leading zeros in front of the month, day, hours, minutes, and seconds. Also note that the hour field is a twenty four hour field. To accomplish this string format in PHP, we can utilize the date function. The below example will store in $mySqlDateTimea date format MySql will understand.
$mySqlDateTime= date("Y-m-d H:i:s", $timestampInSeconds);
You now have a datetime variable stored in $mySqlDateTime that can be used in a sql statement for MySql.
To programmatically setup and use an iframe in C#, copy the below iframe code snippet into your aspx page. You are free to add or edit any of the iframe attributes below, but note that the id and the runat attributes are required!
<iframe id="myIframe" runat="server" scrolling="auto">
</iframe >
Now in the aspx page’s codebehind, you can access the control as myIframe. To set a new URL in the iframe during postback, use the below snippet. The example below will dynamically load http://www.victorchen.info in the iframe window.
myIframe.Attributes["src"] = http://www.victorchen.info
You now you have a working iframe in your C# code and accessible in your codebehind.