Skip to content

it.megocollector.com

The information technology compendium

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....
Continue reading ...

code

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 than one minute!...
Continue reading ...

code

A fantastic writeup 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 is called BatchSubstitute.bat....
Continue reading ...

There are several steps to preparing the BlackBerry 9530 phone prior to resale. Remove the old phone number from the phone, factory reset, wipe, unlock, remove the SIM and SD cards. After reviewing many resources, YouTube videos, and finally a couple of interesting utilities, this is all possible....
Continue reading ...

code

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 zero. A month that does not exist. Therefore, if the month equals zero set it to 12. Another obvious condition is that if the month equals 12, then the year must also be subtracted by one. A couple of other hurdles, that were not readily considered is having to pad the value of 1 through 9 with a 0. The date /T command already pads 1 through 9, however, when passing through the set /a command and switch, the padded value became a single digit. However, the date value of 08 or 09 could not pass through the set /a command with switch without throwing an error. The error has to do with octal notation values. The remedy is to set the for 08 and 09 to 8 and 9 prior to passing through the set /a command and switch. The result is the following code....
Continue reading ...

wordpress-4

With time your Wordpress database may grow out of control. A couple contibuting factors are post revisions, RSS feeds fed through the dashboard. There are plugins that handle basic database optimizations, however, the command line is a quick and dirty way to handle some of these....
Continue reading ...

Most FTP users use an FTP client to access their FTP server. While there may be a client that is capable of deleting files with wildcards, FileZilla Client does not. After a little research, there is a command available to Windows and Linux users accessible via command line. The command is simply called FTP....
Continue reading ...

linux-penguin

Every now and again, a server may lose its date and time. One pesky server is continuously using the incorrect date and time. The easiest way to correct this is by using a simple little command called - date....
Continue reading ...