Articles tagged with: bash
Below is the SQL script that will attempt to identify and remove duplicate posts in your WordPress database. This script can be useful for autoblogging. If you use plugins like WP-o-Matic to pull full-text RSS …
Whenever a new WordPress version comes out, I get an itch to upgrade as quickly as possible. Generally, this is not a good idea, unless you enjoy working out new software bugs and dealing with …
This is the second installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters. You can view the first part of the guide here.
Searching, Replacing, Comparing
Try to work with a large cluster and …
This is the first installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters.
“For” and “While” Loop Constructs
The main challenge of supporting a Linux cluster is ensuring a homogeneous environment. Aside from small …
Let’s say you downloaded a long list of Web proxy servers. Now you are stuck with the task of weeding out the proxies that are dead, slow, fake, or otherwise unusable. There are some applications …
As you may already know, Wget is a popular (particularly in the Unix world) command-line downloader and Web crawler application. You can read more about Wget in one of my earlier posts on the subject. …
Whenever you upgrade your WordPress installation or do development work, it is always a good idea to be working on a copy of your main site and not on the real thing. Copying WordPress installation …
Heavy traffic, hungry SQL queries, leaky applications will eventually leave your server low on memory. Apache will go on a hunt for swap space and MySQL will start freezing in thoughtful contemplation. Your hard drives …
A day will eventually come when your need to find and replace a string of text in your database. You don’t know which row, or which column, or which table. Heck, you may not even …
Running MySQL commands from a shell script is a relatively simple task that has a lot of people baffled. Some say its too complicated and suggest using PHP or Perl, others claim doing so is …
This is a rather peculiar little script with a purpose that may not be immediately apparent. The script will look for files in the specified folder; it will then pick one at random from the …
Never ever upgrade WordPress to the latest version as soon as it comes out, unless you want to be the guinea pig dealing with the new bugs and incompatible plugins. Even if the new version …
Let’s say you moved your server to a new network and now it has a different IP address. You know your users have a habit of hard-coding the server’s IP into their scripts. So you …
Many WordPress theme designers choose to cut some corners with their creations. One of the more important things they skip over is print.css – the stylesheet that controls your blog’s appearance when you print it. …
A simple one-line command to perform find and replace operations in MySQL:
update TABLE set COLUMN = replace(COLUMN, ‘OLD_VALUE’, ‘NEW_VALUE’);
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet …
To executes commands with ‘find’ use the ‘-exec’ option. Example:
find /var – type f -name "*.log" -mtime -2 -exec ls -als {} \;
English translation: Find files in /var that end with “.log” and have been …
Here’s the correct way to page four commands so they’re all controlled by “more”:
(date; netstat -i; whodo; ps -ef) | more
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with …
cd to start point (is acceptable) and as super user run: ls -ailR | sort -rn +5 | more
Sample output under SuSE Linux:
deathstar:/opt # ls -ailR | sort -rn +5 | more
247704 -rwxr-xr-x 1 …
Here is a quick example showing how to count users logged in on a particular date using the “last” command on Linux.
truss -vlstat -tlstat ls -l [file name]
Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post


