Change PHP Mapping for .php File Extension
by Wil Neumann on Aug.20, 2010, under PHP/MySQL
Applies to: PHP, Apache
Let’s imagine your apache webhost has both PHP4 and PHP5 installed, and the default mapping for .php files is linked to PHP4. Now the question is, how do you change that mapping to get PHP5 linked to .php files? (assuming you don’t have administrative priviledges on the webhost)
Workaround: You may choose to simply name your php files with the .php5 file extension if there are only a few scripts that require PHP5 (not really the answer to our problem).
Solution: If you don’t want to rename all your scripts to .php5, create a .htaccess file (or edit the existing .htaccess file, if you already have one). You can create this file using a text editor such as Notepad, WordPad, vi, nano, etc. and place the following line in the text file:
AddType x-mapp-php5 .php
Save the text file as .htaccess in the folder where you need to use PHP5 (or upload the file to the correct folder). The settings specified in the .htaccess file are recursive meaning that the settings will apply to the current folder where the file is saved as well as all subfolders.
Have fun!
Display entries in Windows DNS cache
by Wil Neumann on Aug.19, 2010, under Windows
Applies to: Windows
DNS search results are cached on local systems to prevent a lookup every time the search is required. Sometimes during troubleshooting it is helpful to see the contents of the DNS client cache. This recipe describes the process of viewing the Windows DNS cache.
To view the DNS cache on the local system, type the following command from a command prompt:
ipconfig /displaydns | more
The | more is optional and will pause the output after each screenful which may be helpful since the DNS cache can get large and the output format uses several lines per record.
A sample output from this command is shown below. This is an address lookup for the host microsoft.com. The Record Name and A (Host) Record lines show the request and answer. The Time To Live field shows the number of seconds before this entry expires.
microsoft.com
—————————————-
Record Name . . . . . : microsoft.com
Record Type . . . . . : 1
Time To Live . . . . : 3597
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 207.46.197.32
Delete Windows Live from Windows Mobile
by Wil Neumann on Aug.19, 2010, under Mobile
Applies to: Windows Mobile 6
Once Windows Live is configured on the device, it appears that it’s impossible to delete it.
Here’s how to do it:
Open Windows Live in Start – Programs on the device. In the Menu, select Account Options and select Switch Accounts. This will remove all emails from your device. When done, the EULA page will appear. On that screen, make sure you select REJECT. Windows Live setup will stop and you will be taken back to Windows Live main page. Check in Messaging and Windows Live mailbox is gone.
Communicator and OCS Connectivity Analyzer
by Wil Neumann on Jul.08, 2010, under OCS/UC
Applies to: Office Communications Server, Communicator
Similar to the Exchange Connectivity Test Tool (https://testexchangeconnectivity.com/), Microsoft has an online tool to test external connectivity for Communicator and OCS.
Here it is: https://www.testocsconnectivity.com/
Please note, the site is still in beta. It’s recommended not to use your normal account, but create a test account that you’ll delete when you’re done with testing on that site.
Clear DNS Cache Manually
by Wil Neumann on Jun.24, 2010, under Cisco, Windows
Applies to: Windows, Cisco
When you use DNS to resolve hostnames to IP addresses or services end point addresses, you sometime may want to clear the DNS cache manually.
On Windows you can clear the DNS cache with the “ ipconfig /flushdns ” command.
On Cisco gear you can use the “ clear hosts * ” in enable mode.
File Name Search in PowerShell
by Wil Neumann on Jun.21, 2010, under PowerShell
Applies to: Microsoft PowerShell
Here a simple but effective command to retrieve a list of all files in a directory tree containing a specific text in the file name.
dir c:\users\ -r -i “*yourtext*”
Explanation
- The first argument is the directory to search (c:\users).
- Process all sub-directories with the –r switch.
- The -i switch is used to specify which file names to search for, in this case all files containing yourtext
File Content Search in PowerShell
by Wil Neumann on Jun.18, 2010, under PowerShell
There is a way to use Powershell to search the contents of a file. This method will not use the Windows index so it will be slow, but it does work.
get-childitem c:\users\ -filter *.txt -recurse | select-string -list -pattern “yourtext” | foreach {$_.Path}
Explanation
- get-childitem: Get the children for a container. In this example the container is a folder on the file system.
- The first argument is the directory to search (c:\users).
- The –filter switch is used to limit what files to search, in this example it will search files with a txt extension.
- Process all sub-directories with the –recurse switch.
- select-string: Find text in strings or files.
- The –list switch stops the search within the source once the match is found. In other words it will not waste time looking for other occurrences of the text.
- The –pattern switch is where you specify the search text. Regex is permitted.
- foreach: Iterate the resulting files.
- $_.Path: Output the full path for the file.
Green Hosting
by Wil Neumann on Feb.13, 2010, under _Misc
Wil is proud to announce that this website is using Green Hosting.
Some information about the 1&1 Green Program:
1&1 has partnered with the Bonneville Environmental Foundation (BEF) to offset 100% of the energy usage of our data center in Lenexa, Kansas by purchasing Renewable Energy Certificates (RECs). The majority of the RECs will be sourced from the Bowersock Mills and Power Company’s hydroelectric facility in Lawrence, Kansas. This hydroelectric facility is certified low impact by the Low Impact Hydro Institute (LIHI).
1&1’s renewable energy purchase for the facility is enough clean energy to power at least 300 U.S. homes for one year!
1&1 and BEF work in tandem with Green-e, the nation’s leading voluntary certification program for renewable energy, to power our data center with clean, renewable energy. Green-e certifies renewable energy that meets environmental and consumer protection standards that it developed in conjunction with leading environmental, energy and policy organizations.
1&1 has also been recognized by the U.S. Environmental Protection Agency (EPA) as a Green Power Partner for its annual purchase of 17.5 million kilowatt-hours (kWh) of green power (electricity that is generated from environmentally preferable renewable resources, like wind, solar, hydroelectric and geothermal).
Missing Security Tab in Windows XP
by Wil Neumann on Feb.13, 2010, under Windows
Applies to: Windows XP
If you have Windows XP, and your hard drive is formatted as NTFS, you can set permissions on files so that only users you specify can access them. However, if your Windows XP computer is not part of a Domain on a network, you may notice that there is no Security tab when you right-click a file and choose Properties. For some reason, the default for Windows XP computers that are part of a Domain is to have that visible.
For Windows XP computers that are not part of a Domain (they are stand-alone, or part of a workgroup), the default is to have the Security tab hidden.
To reveal the Security tab follow three simple steps:
- Open Windows Explorer, and choose Folder Options from the Tools menu.
- On the View tab, scroll to the bottom of the Advanced Settings and clear (click) the check box next to “Use Simple File Sharing.”
- Click OK to apply the change, and you should now have a Security tab when viewing the properties of a file on an NTFS volume.
Clear Cisco Router Logs
by Wil Neumann on Dec.14, 2009, under Cisco
Applies to: Cisco Routers and Firewalls
To clear the router’s log, use this command in enable mode:
clear logging

