Posts

Showing posts from 2009

Mysql to CSV

Yesterday we have requirement to send report to our senior in excel format by retrieving data from database . Since there are only 10 rows so we can also manually create excel. But like other programmers, I am also very lazy, so that we create this script to export values from Mysql in csv format. mysql -u mysqlusername -p mysqlpass databsename -B -e "select * from \` tabalename \`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > mysql_exported_table.csv After that we fount that there are many other programming methods to perform this task.

Add new line after some text

Today I face a problem related with editing in css file. I downloaded one css file but when I open it in my fedora 11, I find that all code are written in an single line. Its very difficult to understand that code. First i try to format it manually, but then I decide to find some script or use replace feature of my favourite vi editor. After 5 minute struggle I found the solution, here it is- sample css code:- ================================================ BODY{background-color:#70a5cc;font-family:verdana, arial, helvetica,sans-erif;font-size:10pt;color:#333;margin:0 0 10px}ul{margin-left:25px}dl{margin-top:0;padding-left:1px}dt{margin-top:.5em;color:#009;font-weight:700} ================================================ Note: all are in single line Step 1: open file in vi editor. Step 2: In command mode type: a) :%s/{/{\r /gi explanation:- above line break the line after every '{' tag and give two space in new line. syntax:- :%s/ / /gi ...

Repair Ntldr in Windows Xp

To resolve this behavior, replace the Windows XP Ntldr and Ntdetect.com files. Follow these steps: Start the Recovery Console, type fixboot at the prompt, and then press ENTER. If the Recovery Console does not appear, follow these steps: Use one of the following methods to start the computer so that you can access the file system of the boot partition: Specify another operating system on the Boot menu. Start from the Windows XP CD-ROM, and then at the Windows Setup screen, press "R" to use the Recovery Console to repair the Windows installation. Use a Windows NT 4.0 boot disk that also contains the Windows XP boot files. If your boot partition is a basic disk that is formatted with the FAT file system, use an MS-DOS boot disk. Copy the Ntldr and Ntdetect.com files from the I386 folder on the Windows XP CD-ROM to the root folder of your boot drive. The boot drive is typically drive C. If you are using MS-DOS to perform this file replacement, you may have to remove the ...

Prevent USB Drives from Spreading Viruses

Disable the autorun feature 1. Launch the Registry editor ( Start | Run | regedit ); 2. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Policies\Explorer; 3. Double-click NoDriveTypeAutoRun in the right-hand pane and set its value to hexadecimal FF .

Phpize give error

I'm trying to execute phpize: phpize: line 57: aclocal: command not found I've just installed: automake autoconf by using RPMs.