So, as iconv() does not always work correctly, in most cases, much easier to use htmlentities().
Example: =htmlentities(file_get_contents("incoming.txt"), ENT_QUOTES, "Windows-1252"); file_put_contents("outbound.txt", html_entity_decode($content,ENT_QUOTES , "utf-8")); ?>Monday, March 17, 2014
To remove server information from header
For removing php version, need to off at expose_php at php.ini.
For removing web server version,
For Apache, at httpd.conf, change to below setting.
ServerSignature Off
ServerTokens Prod
For IIS,
- Install urlscan(IIS extensoin)
- change 1 to RemoveServerHeader at UrlScan.ini
- Add "" between "" tag at each .netframe's machine.config file.
Thursday, December 12, 2013
Monday, July 29, 2013
Tuesday, July 23, 2013
USB Modem Set up At Linux
groups
----------------------------------------------------------------------
chmod a+w /dev/ttyUSB0? This is not sure. ---------------------------------------------------------------------
$fd = fopen('/dev/ttyUSB0','w'); fwrite($fd,'AT+CMGS="+659223290"'.chr(13).'helloword'.chr(26)); fclose($fd);
Sunday, July 7, 2013
Setting Up PHP at Ubuntu
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart sudo apt-get install mysql-server
apt-get install php5-mysql mysql-client
Monday, February 11, 2013
Installing MySQL And Set Data Folder At Different Path At Windows Server
When installing MySQL, choose "Customer" type and choose different installation path. If you also want to set Data folder indifferent path, choose your designated path at choosing data path page. After that open my.inf and change the path of "datadir" to your designated path. And then stop mysql, and copy the Data folder from "C:\ProgramData\MySQL\Data" to your path using [xcopy "C:\ProgramData\MySQL\MySQL Server 5.1\data" F:\mydrivefolder\data /s]. And then start mysql again.
To start mysql, use [net start mysql] and use [net stop mysql] to stop.
To start mysql, use [net start mysql] and use [net stop mysql] to stop.
Monday, December 24, 2012
To set up virtual network
http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/thread/259c7ef2-3770-4212-8fca-c58936979851/
- very useful for web application which is set up at PC and which does not have internet connection.
- very useful for web application which is set up at PC and which does not have internet connection.
Monday, December 17, 2012
how to disable third party repositories
| Sam_ (and-sam) said : | #2 |
System administration -> software sources -> third party
https:/ /help.ubuntu. com/community/ Repositories/ Ubuntu# Third-Party% 20Software% 20Tab
## Fix broken packages
via CLI method (other apps, such as Synaptic, Software Sources, Update Manager should be closed):
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get --fix-missing install
## Clean up package cache
sudo apt-get autoclean
sudo apt-get autoremove
## Update
sudo apt-get update
sudo apt-get upgrade
Reference:
http:// library. gnome.org/ users/gnome- terminal/ stable/ gnome-terminal- get-started. html.en
https:/ /help.ubuntu. com/community/ RootSudo# Usage
https:/ /help.ubuntu. com/community/ AptGet/ Howto
https:/ /help.ubuntu. com/community/ SynapticHowto
From : https://answers.launchpad.net/ubuntu/+source/apt/+question/99388
https:/
## Fix broken packages
via CLI method (other apps, such as Synaptic, Software Sources, Update Manager should be closed):
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get --fix-missing install
## Clean up package cache
sudo apt-get autoclean
sudo apt-get autoremove
## Update
sudo apt-get update
sudo apt-get upgrade
Reference:
http://
https:/
https:/
https:/
From : https://answers.launchpad.net/ubuntu/+source/apt/+question/99388
Friday, September 21, 2012
Build Failed for Install Task in Tomcat
Class InstallTask is deprecated & replaced by DeployTask, so later version catalina-ant.jar (tomcat set up) doesn't have class InstallTask. It's just the case of replacing InstallTask by DeployTask to see it working again. For example, following entry in build.xml in spring mvc tutorial
should be replaced as
From http://www.coderanch.com/t/108375/tools/Failed-build-InstallTask-cannot-found
should be replaced as
From http://www.coderanch.com/t/108375/tools/Failed-build-InstallTask-cannot-found
Wednesday, September 12, 2012
Change Mysql Password in WAMP server
1.Install wamp2 server
2.Start->run->cmd->
3.Type cd\ and press enter
4.Locate your mysql directory(like this is my default directory C:\wamp
\bin\mysql\mysql5.1.36\bin)
5.After like this you should have do C:\wamp\bin\mysql\mysql5.1.36
\bin> mysql -u root -h 127.0.0.1 -P 3306 -p press enter after you got
Enter Password don't put anything simply click enter button
6.After like this mysql>
7.simply type mysql>use mysql;
mysql>show tables;
mysql>select * from user \G;
8.You can set your new password: mysql> UPDATE mysql.user SET
Password=PASSWORD('xxxx') WHERE User='root'; (where replace 'xxxx'
with your new password)
(eg.mysql> UPDATE mysql.user SET Password=PASSWORD('muthu') WHERE
User='root';)
9.Finally type mysql> FLUSH PRIVILEGES;
mysql>exit;
10.Check your settings: mysql> mysql -u root -p
enter password:*****
press enter button.....
Add/Change password in phpMyadmin's config file(named config.inc.php under phpMyadmin folder) and change false to change.
From : http://www.kirupa.com/forum/showthread.php?279644-How-to-reset-password-in-WAMP-server
2.Start->run->cmd->
3.Type cd\ and press enter
4.Locate your mysql directory(like this is my default directory C:\wamp
\bin\mysql\mysql5.1.36\bin)
5.After like this you should have do C:\wamp\bin\mysql\mysql5.1.36
\bin> mysql -u root -h 127.0.0.1 -P 3306 -p press enter after you got
Enter Password don't put anything simply click enter button
6.After like this mysql>
7.simply type mysql>use mysql;
mysql>show tables;
mysql>select * from user \G;
8.You can set your new password: mysql> UPDATE mysql.user SET
Password=PASSWORD('xxxx') WHERE User='root'; (where replace 'xxxx'
with your new password)
(eg.mysql> UPDATE mysql.user SET Password=PASSWORD('muthu') WHERE
User='root';)
9.Finally type mysql> FLUSH PRIVILEGES;
mysql>exit;
10.Check your settings: mysql> mysql -u root -p
enter password:*****
press enter button.....
Add/Change password in phpMyadmin's config file(named config.inc.php under phpMyadmin folder) and change false to change.
From : http://www.kirupa.com/forum/showthread.php?279644-How-to-reset-password-in-WAMP-server
Friday, August 24, 2012
CSS, JS, and Images are not accessible in Window Server 2008
It need to add Static Content server in the IIS. At window server 2008, need to right click on Web Server IIS > Add Role Services > tick on Static Contents and finish the installation. And then restart the IIS.
credited to : Henk De Groot from
http://www.dailycomputersolutions.com/blog/index.php/2010/04/23/iis-not-showing-images-and-css/
credited to : Henk De Groot from
http://www.dailycomputersolutions.com/blog/index.php/2010/04/23/iis-not-showing-images-and-css/
Henk De GrootCollapse
Wow man, many thanks....a real life saver.
To do this in windows 2008 R2, you need to go to the Server Manager.
Then select Add Role Services.
Now find the "Static Content" feature under the Webserver->Commen HTTP Features.
Enable this and complete the wizard.
Then select Add Role Services.
Now find the "Static Content" feature under the Webserver->Commen HTTP Features.
Enable this and complete the wizard.
Work for me and I can get some sleep now.
Wednesday, August 15, 2012
Saving \x text from Power Point to Excel into MySQL
FROM http://php.net/manual/en/function.iconv.php
berserk220 at mail dot ru 29-Feb-2008 06:44
berserk220 at mail dot ru 29-Feb-2008 06:44
Monday, August 6, 2012
Downloading CSV over https
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$filename\";" );
header("Content-Transfer-Encoding: binary");
print $out;
http://stackoverflow.com/questions/2232103/how-do-i-get-csv-file-to-download-on-ie-works-on-firefox
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$filename\";" );
header("Content-Transfer-Encoding: binary");
print $out;
http://stackoverflow.com/questions/2232103/how-do-i-get-csv-file-to-download-on-ie-works-on-firefox
Sunday, July 22, 2012
Tuesday, July 10, 2012
Adding and Removing Table Using Jquery
http://forum.jquery.com/topic/adding-removing-rows-from-table
Thursday, May 24, 2012
Jquery pop up boxes
http://www.shadowbox-js.com/index.html //can use for youtube
http://lokeshdhakar.com/projects/lightbox2/
http://lokeshdhakar.com/projects/lightbox2/
Sunday, May 6, 2012
The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine
You need to run Access database applications in a 32 bit asp.net application pool. You do that via your IIS admin.
Open IIS manager, select Application Pools, select the application pool you are using, click on Advanced Settings in the right-hand menu. Under General, set "Enable 32-Bit Applications" to "True".
http://social.expression.microsoft.com/Forums/en-US/web/thread/2111c297-fab8-482b-9439-53b1464b782e
Open IIS manager, select Application Pools, select the application pool you are using, click on Advanced Settings in the right-hand menu. Under General, set "Enable 32-Bit Applications" to "True".
http://social.expression.microsoft.com/Forums/en-US/web/thread/2111c297-fab8-482b-9439-53b1464b782e
Sunday, February 19, 2012
z-index problem in IE7
Add the following code, so menu will be show all over the object.
$(function() {
var zIndexNumber = 1000;
$('div').each(function() {
$(this).css('zIndex', zIndexNumber);
zIndexNumber -= 10;
});
});
From http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/
$(function() {
var zIndexNumber = 1000;
$('div').each(function() {
$(this).css('zIndex', zIndexNumber);
zIndexNumber -= 10;
});
});
From http://www.vancelucas.com/blog/fixing-ie7-z-index-issues-with-jquery/
Sunday, February 5, 2012
Delete all tables including foreign key
Deleting all table
exec sp_MSforeachtable "DROP TABLE ? PRINT '? dropped' "
If cannot delete because of foreign key
1. run
SELECT *
FROM sys.foreign_keys
WHERE referenced_object_id = object_id('user')
2. run and copy the result
SELECT
'ALTER TABLE ' + OBJECT_NAME(parent_object_id) +
' DROP CONSTRAINT ' + name
FROM sys.foreign_keys
WHERE referenced_object_id = object_id('user')
3. run copy lines
exec sp_MSforeachtable "DROP TABLE ? PRINT '? dropped' "
If cannot delete because of foreign key
1. run
SELECT *
FROM sys.foreign_keys
WHERE referenced_object_id = object_id('user')
2. run and copy the result
SELECT
'ALTER TABLE ' + OBJECT_NAME(parent_object_id) +
' DROP CONSTRAINT ' + name
FROM sys.foreign_keys
WHERE referenced_object_id = object_id('user')
3. run copy lines
Sunday, January 8, 2012
Removing shadow from input box for mac browser
You need to add "-webkit-appearance: none;" to input box's css
eg.
input,textarea{
margin:0;
outline:0;
font-family:inherit;
font-size:inherit;
color:inherit;
-webkit-appearance: none;
}
Subscribe to:
Posts (Atom)