How to serve attachments from a free CDN (Coral)

You can use Coral free CDN to off-load the WordPress attachments (usually images). In order to use Coral you need to add “.nyud.net” to the site DNS address. For example, http://www.alekz.net will become http://www.alekz.net.nyud.net. Coral is usually too slow to serve all static content, so the most effective solution would be to use it only for the biggest files.

Here’s a simple solution. Add the following to functions.php of your current theme:

add_filter ('wp_get_attachment_url', 'freecdn_url');

function freecdn_url ($url)
{
    if (! is_attachment () ) return $url; 
    $cdn_url = ".nyud.net";
    $decomposed_url = explode ("/", $url);
    $decomposed_url[2] =  $decomposed_url[2] . $cdn_url;
    $url = implode("/", $decomposed_url);
    return $url;
}

Your theme (e.g. the bundled “TwentyTen”) must use wp_get_attachment_url(), of course. If not – you got the idea, didn’t you? 😉

Also, you can use freecdn_url () function to rewrite any URL you want to download from Coral.

dcpumon and dcpumonview

Found another cPanel application which you can safely turn off in order to safe some bytes and cycles.

By default dcpumon runs every 5 min to log CPU usage (“top” output) :

# crontab -l | fgrep cpu
*/5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
#

and stores the data into /var/log/dcpumon

You can view the report with dcpumonview command:

# /usr/local/cpanel/bin/dcpumonview
———————————————————–
|User |Domain |CPU%|MEM%|MySQL#|
———————————————————–
|alekz |alekz.net |17.72|37.07|0.3 |
| Top Process | 27.8 | /usr/bin/php |
| Top Process | 14.2 | /usr/bin/php |
| Top Process | 12.3 | /usr/bin/php |
|mysql | |11.47|3.05|0.0 |
| Top Process | 11.7 | /usr/sbin/mysqld –basedir/ –datadir/var/lib/mysql –usermysql –pid-file/var/lib/mysql/alekz.pid –skip-external-locking |

How to allow blank passwords for Vista Remote Desktop

Two methods:

1. Using regedit:

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa
“LimitBlankPasswordUse”=dword:00000000

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
“LimitBlankPasswordUse”=dword:00000000

2. Using Local Security Policy:

Control Panel -> Administrative Tools -> Local Security Policy (run as system administrator)
Local Security Policy -> Local Policies -> Security Options
Set “Accounts: Limit local account use of blank passwords to console logon only” to Disable

Useful links:

CheckPoint Firewall policy parsers and converters

Useful firefox settings

The default settings are in bold.

  • media.autoplay.enabled (true|false)
  • image.animation_mode (normal|once|none)
  • security.enable_java (true|false)
  • browser.sessionstore.interval (10000 in msecs, equivalent to 10secs)
  • gfx.color_management.enabled (true|false)
  • browser.tabs.closeButtons 1 ( 0 – on the active tab only, 1- all tabs, 2- no close button, 3- at the end of the tab strip)
  • dom.max_script_run_time (10 sec)
  • layout.spellcheckDefault (0 – disable the spell checker, 1 – spell checker for multi-lines text boxes only, 2 – enable the spell checker for all text boxes)
  • network.http.pipelining (true|false)
  • network.http.proxy.pipelining (true|false)
  • network.http.pipelining.maxrequests (4, 4-8)
  • network.http.max-connections (30)
  • network.http.max-connections-per-server (15)
  • extensions.checkCompatibility ( New -> Boolean)
  • security.dialog_enable_delay (2000 in msec, 0 – start installation immediately)
  • nglayout.initialpaint.delay (New -> Integer)
  • browser.blink_allowed (true|false)
  • middlemouse.paste (true|false)
  • ui.submenuDelay (New -> Integer)
  • network.prefetch-next (true|false)
  • browser. cache.check_doc_frequency (0 – check once per browser session, 1 – Check every time I view the page, 2 – Never check (always use cached page), 3 – Check when the page is out of date)

Documentation

How to replace the WP comment form with a WYSIWYG editor

You can replace the standard WordPress comment form with a built-in WYSIWYG editor TinyMCE.

Find the file where the comment form is defined. Usually it’s comment.php in your theme

For WP <3.0 it looks something like:

Solaris and external USB disks

Short tutorial on how to connect, format, mount, detach and reconnect external USB disks.

The used disk is WD20EARS connected to a USB port via Sharkoon Quickport Pro cradle.

Basically, you need only two commands:

  • rmformat – to determine the device name/path
  • zpool – to do the rest (create ZFS, mount, attach and detach)

Continue reading “Solaris and external USB disks”