Category: Scripts

A Custom SyntaxHighlighter 2.0 brush for INNO Setup

Using the SyntaxHighlighter Evolved Plugin (version 2.x) for WordPress has really given the code on this site more curb appeal. As many brushes that come with the plugin and searching through the third-party brushes throughout the Internet, I could not track down a brush for INNO Setup scripts. After a couple of hours and many attempts at this, I have…

Read More »

How to change the IP address of a Linux computer using a script

There was a CentOS server where the IP address needed to be changed. Searches through the Internet revealed a series of commands that would do the trick. This script incorporates these commands into a single utility or bash script. This may not be all inclusive, but it did work for me on a CentOS 5.8 server. To use this script,…

Read More »

How to rename the host name of a Linux computer using a script

There was a CentOS server where the name needed to be changed. Searches through the Internet revealed a series of commands that would do the trick. This script incorporates these commands into a single utility or bash script. This may not be all inclusive, but it did work for me on a CentOS 5.8 server. To use this script, simply…

Read More »

Add SyntaxHighlighter Evolved Plugin Third Party Brushes To Your WordPress Installation

SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without losing it’s formatting or making any manual changes. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev. It is prepackaged with a select handful of brushes, which includes several third-party brushes. There are many more third-party brushes that are available and not part of the plug-in package….

Read More »

Delete Local Printers via a Script

A case where a Microsoft Windows print server may once existed and a new print server had been put into place; the local workstations that accessed the printer shares of the original print server no longer require those shares. Here is a script to remove all local printers prior to adding new printers. Source www.experts-exchange.com

Read More »

A Julian and Gregorian Calculator using AutoIt

I know that there is a Julian Day Converter that has been around for years. It, however, is no longer supported. The window can sometimes be a little messy to re-size and it is expressed by dd/mm/yyyy not mm/dd/yyyy for which I am more used to. Well, here is my attempt at a calculator using AutoIt and Koda. This calculator…

Read More »

Julian Day Calculator with AutoIT

I know that there is a Julian Day Converter that has been around for years. It, however, is no longer supported. The window can sometimes be a little messy to resize and it is expressed by dd/mm/yyyy not mm/dd/yyyy for which I am more used to. Well, here is my attempt at a calculator using AutoIt and Koda. This calculator…

Read More »

Useful DOS Commands

From time to time a DOS batch (“bat” or “cmd”) file needs to be written to perform some task or series of tasks. There are various commands that I seem to consistantly search for on the Internet. Here is a list of some of those useful DOS batch commands. How to delete files equal to zero bytes in size. Delete…

Read More »

Delete Files and Subfolders from Folder but not that Folder Itself

If you would ever want to use a command line delete all the files and folders from within a folder without deleting the folder itself, a batch file can be constructed. Warning: There are a few things that I discovered while testing this script. Firstly, the CD command, which is part of this script will accept a / character as…

Read More »

How to search and replace text from a very large XML file

There are many ‘solutions’ that exist that will parse through a text file and other utilities that have specific functions designed to parse through an XML file. After trying several applications only one was capable of effeciently search and replace text within (in this case) an XML file that is over 300 MB in size. The whole process took less…

Read More »

DOS Batch – Find and Replace all occurrences of a string with another string

A fantastic write-up for a batch file, DOS Batch – Find and Replace, that allows string substitution in a text file. It parses each line of a text file for a particular string and replaces it with another string. For example, to replace all occurrences of “red” in “color.txt” with “blue” and put the output on the screen. The script…

Read More »

Use DOS Batch to show last month date with the date command

Use a DOS script to automate a process where by using the date /T command would return the previous month, rather than the current month. This actually sounds easier than it is. For the desired results, a couple of conditions were considered. Firstly, if in the month of January or one, then the subtracted value of one minus one equals…

Read More »

Use forefiles.exe and 7zip to archive files older than X number of days

On a Microsoft Windows server, there is a folder that contains 1000s of logfiles. Each logfile varies by name and size. I wanted a script that would compress all logfiles into a single zip file that were older than seven days. After the compression is completed and the zip file is created, all logs older than seven days will be…

Read More »

Install Java JDK on CentOS without prompts using an automated script!

If you have ever installed Java Development Kit (“JDK”) on a Red Hat Enterprise Linux (“RHEL”) 5.x or CentOS 5.x operating system (“OS”), then you are aware of how manual the installation can be. Prompt after prompt to install. After a lot of research and testing, here is a completely automated script to install JDK on a CentOS or RHEL…

Read More »

Change a Linux Network Configuration from DHCP to Static IP Address

If you CentOS network configuration is set at DHCP and you want to change your network configuration to a static IP address, then read on. The network configuration settings are generatlly found and edited in two places. Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 to resemble the following (replace the network addresses with your own). Edit the /etc/sysconfig/network to resemble the following (replace the…

Read More »

Icinga – How to add the check_yum plugin

Icinga, an open source monitoring tool, monitors networks and its resource, can send notifications, and generate reports. Icinga is scalable and can monitor small to large network environments. Icinga is a fork of Nagios and is backward compatible. Nagios configurations, plugins and addons can be used with Icinga. Icinga has retained the existing features of Nagios, however, is actively maintained…

Read More »

Windows command for file size only

I needed a list of files from a folder with only filesize. The first choice of commands was the DIR command, however, there is no command line switch or combination that will allow for this type of output. I didn’t want to have to install any third party application or Microsoft extras to get the desired result. Since, I am…

Read More »