Musings, Ramblings and Other Assorted Rubbish

Just about anything that I can think of... 
Filed under

opensource

 

Replacing Notepad.exe with Notepad2.exe

I do not like notepad.exe... It will not behave the way I think it should so I replaced it with something better: Notepad2.exe
Hare are some of the features:

  - Syntax highlighting: HTML, XML, PHP, ASP (JS, VBS), CSS,
JavaScript, VBScript, C/C++, C#, Resource Script, Makefiles, Java,
Visual Basic, Pascal, Assembly, SQL, Perl, Python, Configuration
Files, Apache Config Files, Batch Files, Diff Files
- Drag & drop text editing inside and outside Notepad2
- Basic regular expression search and replace
- Useful word, line and block editing shortcuts
- Rectangular selection (Alt+Mouse)
- Brace matching, auto indent, long line marker, zoom functions
- Support for Unicode, UTF-8, Unix and Mac text files
- Open shell links
- Mostly adjustable
Below is a batch file I found to help speed things up (Wish I could remember where I found it to give credit) in replacing notepad.  You will notice that notepad2 has been renamed and is in the folder c:\notepad.  Also you will need to un-hide all system files. 
To install just copy the batch file below into a txt file and name it whatever.bat and run it.  That's it. Have fun.

@echo off
echo ****You must have Notepad2.exe in c:\notepad and named notepad.exe****
pause
copy /y %WinDir%\System32\dllcache\notepad.exe %WinDir%\System32\dllcache\notepad.exe.orig
copy /y %WinDir%\ServicePackFiles\i386\notepad.exe %WinDir%\ServicePackFiles\i386\notepad.exe.orig
copy /y %WinDir%\System32\notepad.exe %WinDir%\System32\notepad.exe.orig
copy /y %WinDir%\notepad.exe %WinDir%\notepad.exe.orig
copy /y C:\notepad\notepad.exe %WinDir%\System32\dllcache
copy /y C:\notepad\notepad.exe %WinDir%\ServicePackFiles\i386
copy /y C:\notepad\notepad.exe %WinDir%\System32
copy /y C:\notepad\notepad.exe %WinDir%
echo.
echo.
echo Write down the locations after the REG_MULTI_SZ or REG_SZ in case the batch file does not work.  If it does not work, you will need to look in the locations from below to find other copies of notepad.exe that are possibly being used to restore the original notepad.exe
echo.
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v "Installation Sources"
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v ServicePackSourcePath
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v SourcePath

twitter @dkirkland

Filed under  //   How To   Open Source  

Comments [0]

Ok, I have had it with IIS... Time to install Apache!

I was reluctant to install Apache because I always thought that it would be too hard.  Lot's of fiddly things to install, mucking about with a bunch of text files... the list went on and on, but as it turns out, I was wrong.  Just go to http://httpd.apache.org/  grab apache_2.2.10-win32-x86-openssl-0.9.8i.msi (at the time of this writing) and run the msi file.  The only change I made was to install everything and point the installer to something like x:\apache  (x being any drive you choose) for easy webroot access. 

This install will do everything! Unlike the PHP installer Apache will work as soon as the installer is finished.  Now the fiddly part that I was afraid of: Getting PHP and MySQL to play nice with it...
Add these three lines to your httpd.conf:

LoadModule php5_module "x:/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Do a search for DirectoryIndex and make it look like this: DirectoryIndex index.php index.html
That's it! You are done.

Ohh almost forgot if you have set anything to the Inetpub\wwwroot folder in the php.ini file (like upload_tmp_dir or session.save_path), you will need to change it to reflect your new webroot folder:x:\Apache\htdocs

Filed under  //   How To   MySQL   Open Source   PHP   Websites  

Comments [0]

PHP+MySQL+IIS Install

Here are the steps that I took to get PHP and MySQL on IIS:

Software Needed:

  • IIS: Installed on all Windows Servers and can be added to XP Pro via the Control Panel -> Add/Remove Programs -> Add Windows Components.
  • PHP: Can be downloaded from http://www.php.net/ (Be cure to get the Windows Binaries Zip Package NOT the installer package)
  • MySQL: Can be downloaded from http://www.mysql.com  Choose the Community Server download. Also grab the GUI-Tools Administrator while you are there.
  • IZArc: If you do not have an unzip tool this one is one of the best

 

PHP Install

Unzip the PHP binaries package (php-5.x.x-Win32.zip) to C:\PHP5 and do the following:

  • Copy php.ini-recommended to C:\windows\ and rename to php.ini.
  • Copy php5ts.dll to C:\windows\System32

 

Let IIS know you have PHP

 You have to tell IIS where PHP is and add the extensions:

  • Open IIS control panel and expand the computer name to reveal "Web Sites" right click to properties.
  • Click on the Home Directories tab and look for and click on the Configuration button
  • On the Mappings tab click Add button, browse to C:\php5 and select php5isapi.dll.  Then type .PHP in the extension field (Yes, type the period first)
  • Next go to the Documents tab and add index.php as a new document and move it up to the top of the list.
  • Add C:\PHP5 to your system Path
    • In a cmd windows type PATH C:\PHP5; %PATH%

 

Testing PHP
  • Go to your webroot folder (C:\Insetpub\wwwroot) and copy the following into a newly created text file phpinfo.php:

<?PHP phpinfo(); ?>

  • Open a web browser and point it to http://localhost/phpinfo.php You should see the PHP information page.  It contains all config variables that are loaded from the php.ini file.  If you see this page, PHP is installed and configured.

 

MySQL Install

Unzip the MySQL file that you downloaded earlier and run Setup.exe

  • Choose Compete Install and click NEXT till starts to copy files
  • Choose Configure the MySQL Server now
  • Pick Detailed Configuration
  • Select Server Machine
  • Choose Multifunctional Database
  • Leave the Default settings for InnoDB Tablespace
  • Pick Online Transaction Processing
  • Leave the networking options at the default settings
  • Choose Standard character set
  • Check Install as a service and include in to Path
  • Modify Security settings and choose a new root password
  • Click Execute to begin the configuration process
  • Press Finnish

 

Add a user to test with:

Open the SQL Administrator Command Line and type the next commands (hit enter after each line)

CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';

FLUSH PRIVILEGES;

This will create a user called test with a password of test

 

Bringing It All Together

Now we have to let PHP know that MySQL has been install:

 Open the php.ini file (Start -> Run -> php.ini) and either uncomment or add the following:

 extension=php_mbstring.dll

extension=php_mysql.dll

extension=php_mysqli.dll

 Save the php.ini file and restart IIS

 

 Testing PHP & MySQL Together

 Type the following in a text file and name it test.php

 <?php

// Let's connect and select a database

$link = mysql_connect('localhost', 'test', 'test')

 or die('Couldn't connect to the MySQL Server: ' . mysql_error());

mysql_select_db('mysql') or die('Couldn't Select the Database.<br><br>

The error returned by MySQL says: <br>' . mysql_error());

// See Ya!

mysql_close($link);

?>

 

This page will comeback with the errors:

 Couldn't Select the Database.
The error returned by MySQL says:
Access denied for user 'test'@'localhost' to database 'mysql'

 This was just to see if PHP could see the MySQL Server.  If you see this error it is install and working. 

Filed under  //   How To   MySQL   Open Source   PHP   Websites  

Comments [1]

Websites

I have been in a frenzy the past couple of weeks looking at different web templates for a site that I am thinking about.  As a Technology Director of a small school it is hard to find quality technology resources that I can afford and when none exist, I have to coble something together.  There are several good site templates out there, but I have focused on just two.. Joomla! and Wordpress.  Below is what I have found...

Rating:
Joomla - for the shininess of it.. NOT the install
Wordpress
- because it just works.

Joomla!:  This is one of the newer finds that was mentioned to me by a fellow Tech Director and was eager to try it out.  The installation was for the most part painless, if you are accustomed to white-hot pokers being stabbed in your eye (or else where) repeatedly.  Yes, they have a web based install method that looks very good.  It will walk you through setting up your site and associating it with a database.  That part is easy.  Where you start to run in to trouble is when you complete all the steps and hit the final Finish button.  There is a very small message at the bottom of the page that tells you that setup could not write to the configuration.php file while at the very top in large red letter it is telling you to completely remove the installation folder.  

What appears to be happing is that the Anonymous Internet User account does not have write access to the file.  Fine I can deal with that, give it write access with IIS and every thing is happy right? Wrong…  You have to go to the web-root folder and give it the permission from the security tab!.. Think about this.  Is it wise to leave a config file world writable?  IMHO - Nope. Then manually edit the file in a txt editor.  After you do this you can bring up the page.  However, when you log in to the Admin interface and try to make more global changes you will not be able to unless you leave the config file world writable.   Ohh, and just incase you have tried to install Joomla and wanted to go to the forums for help – forget it.  They will tell you to check to make sure that the config file is in the correct directory and go through the set up again.  Or the will move your post to another forum with out posting a link to where they moved it. 

Over all my impression was that the Joomla group is more interested in eye-candy than making a quality product that works.

Wordpress: I have used word press for quite awhile and have been very impressed with the install, support forums and easy of use. There are a lot of templates available to set your site up almost any way you want.  I know, Wordpress is a blogging suite, but it is not that hard to turn in to a stable and very usable web site.  I had one site that I wanted to work as a mobile gateway.  I looked on Wordpress and found an add-on for it.  In 5 minutes I had a site that was accessible to mobile phones. Give it a try, it may surprise you.

My over all impression was that Wordpress just works.  There are a lot of tweaks that you can do and a lot of templates to use.  If you want a no-hassle web site this is a good way to go.

I will be digging out an old web site suite that have used in the past to give another review soon.  It is called Plone and runs on Python and Zope.  I need to configure my web server to make it wok so bear with me.  From what I remember it is very customizable and fairly easy to use. 

More later…

Filed under  //   Open Source  

Comments [0]

Edge Device

I found a great Open Source product the other day while looking for a way to monitor me network @ work.. Untangle (UT).  Here were my requirements:

  • Had to be Open Source (schools have little enough funding)
  • Should have firewall and IDS/IPS components
  • Would be nice to have QOS
  • Must be transparent to my users
  • Must have good/active user forums
  • Must be Easy to maintain


I set UT up as a transparent bridge and stuffed it in between my last switch and router where it can see all traffic going into and out of my network. I tested it for a while in my office before deploying it on my network and decided that I liked the interface.  It's been up for about a week now and no problems in production.  I will caution you, that is you are going to run it headless, you will need to enable SSH.   I know it may sound goofy, but it didn't occur to me to do it during my testing because I had access to the console but 10 min. after I put it on the network I needed wanted to access something that was not on the web interface.   Also with SSH you can modify (with extensive help from the forum) the default install to add among other things nTop, a nifty little program to show bandwidth usage and network usage statistics. 

 

Considering I have nothing more than time invested in this machine, I would say it serves my needs quite well.


More Later...
--
twitter @dkirkland

Filed under  //   computers   Networking   Open Source  

Comments [1]