eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)
Internet is vague. It has nothing left to be covered now. However, things get messed up sometimes and I forgot where I used to find the materials I had just searched for some days ago. So, I am now gathering all those into this blog. This is just my bookmark or my scrapbook or anything you wish to say. If you think these are helpful, you can take references, no any rights to be defined here. No styles and no colorful designs, just an area to jot down some scraps and all. Enjoy
Pages
Tuesday, June 9, 2009
Wednesday, May 6, 2009
low level formatting in linux
Source: http://tldp.org/LDP/LGNET/issue37/tag/38.html
dd if=/dev/zero of=/dev/hda
... to wipe out the whole first IDE drive, or
dd if=/dev/zero of=/dev/sda
... to wipe out the whole first SCSI drive.
Actually you could just blow away one sector on these drives using
dd if=/dev/zero of=/dev/sda count=1
It wouldn't make sense to do this to other drives (/dev/hdb, /dev/hdc, /dev/sdb, etc) since their boot sectors aren't referenced as code and you can reformat those drives with normal DOS or Linux commands to re-make your filesystems on them. However, you can issue this command for all of your drives if you like. In fact you should be able to do something like:
for i in a b c d; do
dd if=/dev/zero of=/dev/hd$i
done
... to get four IDE drives or
for i in a b c d e f g ; do
dd if=/dev/zero of=/dev/hd$i
done
... to wipe out all seven disks on a SCSI chain.
Labels:
Command Help,
Formatting,
Harddisk,
Linux,
System Support,
Tips and Tricks
Thursday, April 30, 2009
select maximum value from an auto increment field
$table_name = "jos_menu";
$resultset = mysql_query("desc $table_name");
while($a = mysql_fetch_assoc($resultset))
{
if($a["Extra"] == "auto_increment"){
$query = "SELECT max(".$a["Field"].") as auto from $table_name";
$resultset1 = mysql_query($query);
$answer = mysql_fetch_assoc($resultset1);
die($answer["auto"]);
break;
}
}
Note: It can be done just by subtracting 1 from the current Auto_increment value in a table. But, I never found this justifiable because what if the last row is deleted.
$resultset = mysql_query("desc $table_name");
while($a = mysql_fetch_assoc($resultset))
{
if($a["Extra"] == "auto_increment"){
$query = "SELECT max(".$a["Field"].") as auto from $table_name";
$resultset1 = mysql_query($query);
$answer = mysql_fetch_assoc($resultset1);
die($answer["auto"]);
break;
}
}
Note: It can be done just by subtracting 1 from the current Auto_increment value in a table. But, I never found this justifiable because what if the last row is deleted.
Thursday, March 12, 2009
DGC Modem installation
I tried my internal modem in MSI VR420 Notebook. I could not do configure that goddam thing.
So, I burrowed an USB Fax Modem and installed it.
It was a DGC Modem type so, for my ubuntu pc of 2.6.24-16 Kernel Version
This was the Almighty http://www.linuxant.com/drivers/dgc/downloads-ubuntu-x86.php
Then very easy process.
Unzip the file
sudo dpkg -i dgcmodem_{version,etc}.deb
sudo /usr/sbin/dgcconfig
then dmesg produces good logs
and finally wvdial connects with modem /dev/modem
WOW
So, I burrowed an USB Fax Modem and installed it.
It was a DGC Modem type so, for my ubuntu pc of 2.6.24-16 Kernel Version
This was the Almighty http://www.linuxant.com/drivers/dgc/downloads-ubuntu-x86.php
Then very easy process.
Unzip the file
sudo dpkg -i dgcmodem_{version,etc}.deb
sudo /usr/sbin/dgcconfig
then dmesg produces good logs
and finally wvdial connects with modem /dev/modem
WOW
Monday, February 16, 2009
Flash for linux
Two tools I found available to use here for Linux.
Flasm
Haxe
Have not explored properly, will post more if found any more.
Flasm
Haxe
Have not explored properly, will post more if found any more.
Friday, January 23, 2009
Sound in MSI VR 420 Laptop
After I bought my first laptop MSI VR 420 with genuine Vista installed, I installed Kubuntu 8.04 Hardy. Everything one fine except the sound was not working.
dmesg produced this error
... ... ...
lots of headaches
... ... ....
And finally,
This was how I made it working.
And it worked.
The first thing I played was
http://www.meronepalma.com/song/425
dmesg produced this error
hda_codec: Unknown model for ALC883, trying auto-probe from BIOS..
... ... ...
lots of headaches
... ... ....
And finally,
This was how I made it working.
modprobe -r snd_hda_intel
modprobe snd_hda_intel model=3stack-dig
And it worked.
The first thing I played was
http://www.meronepalma.com/song/425
Labels:
audio,
Command Help,
HowTO,
Laptop,
Linux,
MSI VR 420,
Tips and Tricks
Friday, November 7, 2008
Pass Sessions between subdomains in php
If needed to be able to pass session data between subdomains, add the following to the php.ini file.
session.cookie_domain = .mydomain.com
If unable to modify the the php.ini file, add the following before the session.start() function on any page which creates the session cookie.
ini_set("session.cookie_domain", ".mydomain.com")
Labels:
Domains,
Dynamic programming,
Internet,
PHP,
Programming,
website
Subscribe to:
Posts (Atom)