Category Archives: tip

PHPHOST BLOG

Web Hosting Related Articles You May Need

Example Bash Script which Monitors if a Program has Died, and Restarts it

Background

Here’s a quick script that might prove useful if you need to watch if a program is running and restart it if it stops for whatever reason. It is by no means fault tolerant, but could be adapted to be more so if needed.

Solution

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
 
# NAME: check_dropbox.bash
# DESC: watch if dropbox is running
 
check_process() {
[...] Continue reading

Posted in bash, monitoring, script, Syndicated, tip, tutorials | Leave a comment

[one-liner]: Commenting out a block in an XML file using sed

Background

This issue came up recently where I needed to programmatically comment out a section of tags in an XML file.

1
2
3
4
<login-module code="org.dcm4chex.archive.security.TrustLoginModule"
flag = "required" >
[...] Continue reading

Posted in one-liner, sed, Syndicated, tip, tips & tricks, XML | Leave a comment

[one-liner]: Calculating & Sorting Disk Usage Using du

Background

Occasionally I want to calculate how much disk space is being consumed with a directory. Here are a couple of simple yet powerful one-liners that achieve this.

Solutions

method #1

This first choice is inefficient in the sense that it basically runs du twice. Once to generate a sorted list of the directories & files by size and [...] Continue reading

Posted in bash, one-liner, shell, Syndicated, tip, tips & tricks | Leave a comment

[one-liner]: Adding the Oracle/Sun Java Plugin to Firefox on Ubuntu 11.04

Background

If you’d like to add the Oracle/Sun Java plugin to Firefox under Ubuntu here’s a quick tip on how to do it.

NOTE: If you need help installing Java see my previous post, Howto Install/Setup Oracle/Sun Java 1.6.X on Ubuntu 10.10.

Solution

Simply run the following command, which creates a link to the Java plugin, thus “installing it” [...] Continue reading

Posted in firefox, java, one-liner, Syndicated, tip, tips & tricks, Ubuntu | Leave a comment

[one-liner]: Fixing Favicons on Google Chrome’s Bookmark Toolbar

Background

I maintain a couple of blogs and on one of them I changed the favicon.ico file associated with it. I also keep a link to the blogs in Google Chrome’s bookmark toolbar. However after updating the favicon.ico file on the blog, I noticed that Chrome wasn’t getting this updated version of the .ico file. Here’s [...] Continue reading

Posted in chrome, favicon, Google, one-liner, Syndicated, tip, tips & tricks | Leave a comment

[one-liner]: Getting Thunderbird 5 to Play Nice on CentOS 5

Background

I’ve been using the Thunderbird 2.x & 3.x series for a while on CentOS 5 without issue for the last couple of years. Recently I received a dialog from Thunderbird saying that version 5 was available so I figured what the heck move up. The upgrade seemed to go smoothly but then I noticed that [...] Continue reading

Posted in centos, one-liner, Syndicated, Thunderbird, tip, tips & tricks | Leave a comment

[one-liner]: Command-line Fu … Useful Linux Commands (repost)

Background

Came across these commands on another blog and wanted to create my own personal copy of these useful command-line examples.

Commands

1
2
3
4
% sshfs name@server:/path/to/folder /path/to/mount/point
# Mount folder/filesystem through SSH
# Install SSHFS from http://fuse.sourceforge.net/sshfs.html
# Will allow you to mount a folder security over a network.

1
2
3
4
5
% !!:gs/foo/bar
# Runs previous command replacing foo by bar every time that foo appears
# [...] Continue reading

Posted in linux, one-liner, shell, Syndicated, sysadmin, tip, tips & tricks | Leave a comment

Improving the WordPress Plugin Statpress Reloaded’s Performance

Since setting up this blog some 2+ years ago I’ve been using the WordPress plugin, Statpress Reloaded, to keep tabs on how much traffic it receives. It’s purely just for vanity sake. Now for anyone that’s used Statpress Reloaded, you’ll know that it’s a nice plugin for what it shows, mainly real-time stats, but it’s [...] Continue reading

Posted in monitoring, performance, Syndicated, tip, tips & tricks, wordpress, wordpress plugin | Leave a comment

Getting the BlogTNG plugin working in Dokuwiki under CentOS 5

Background

BlogTNG is a blogging plugin that provides a pretty basic though usable blog within the wiki software, Dokuwiki. I wanted to try this out on one of the sites I support but when I installed the BlogTNG plugin my Dokuwiki install just started displaying blank pages. The only hint of a problem was in the [...] Continue reading

Posted in centos, dokuwiki, package management, PHP, plugins, redhat, rpm, Syndicated, tip, tips & tricks | Leave a comment

[one-liner]: Can’t Connect to VMware Server 2.x from Internet Explorer 8

Background

Recently I ran into a problem where I wasn’t able to connect to a VMware Server from IE 8. I was getting an error message that didn’t give me much to go on. Basically IE displayed a blank page and there was a little yellow exclamation point in the lower left corner of IE.

<p [...] Continue reading

Posted in one-liner, Syndicated, sysadmin, tip, tips & tricks, vmware | Leave a comment