kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Bad times, I had to use a book from the monitor stand today

Posted on July 16, 2010

Posted by Kieran

Installing memcached on CentOS (cPanel)

Posted on January 23, 2010

Posted by Kieran

Welcome to hell. No really, compared to installing memcached on Ubuntu, CentOSs really sucks. CentOS really sucks for package management.  Really sucks. Anyway, on to the point.

Here's how I installed memcached on CentOS, which I mainly use for cPanel.

Tagged as: Continue reading

[Snippet] Stop Windows Update irritating you to restart after updates

Posted on January 23, 2010

Posted by Kieran

I've been irritated to reboot my laptop every fifteen minutes to reboot my laptop. Its never convenient is it.

Click Start, Run and type net stop wuauserv

Tagged as: 1 Comment

Simple install of memcached on Ubuntu

Posted on January 22, 2010

Posted by Kieran

Memcached is a free, high performance distributed memory object caching system. In English, it can make your single server PHP applications faster or for a little more technical users you can write cache and share cache objects over a web server farm or cluster. Great, eh.

No seriously, it can really make your PHP faster.

Tagged as: Continue reading

Insert Coin

Posted on July 17, 2009

Posted by Kieran

Bored at work? This script connects to a JetDirect equipped HP printer and uses HP's control language to set the ready message on the LCD display. Takes an IP address and message on the command line. My favorite message is "INSERT COIN".

Keep in mind the limitations of the display when composing your clever verbiage.

insert_coin

#!/usr/bin/perl
# $Id: hpsetdisp.pl 11 2006-03-22 01:21:03Z yaakov $

# hpsetdisp.pl

use strict;
use warnings;

unless (@ARGV) { print "usage: $0 \"\"\n" ; exit }
if ($ARGV[3]) { print "Did you forget the quotes around your clever
message?\n" ; exit }

my $peeraddr = $ARGV[0];
my $rdymsg = $ARGV[1];
chomp $peeraddr;

use IO::Socket;
my $socket = IO::Socket::INET->new(
PeerAddr => $peeraddr,
PeerPort => "9100",
Proto => "tcp",
Type => SOCK_STREAM
) or die "Could not create socket: $!";

my $data = <
\e%-12345X\@PJL JOB
\@PJL RDYMSG DISPLAY="$rdymsg"
\@PJL EOJ
\e%-12345X
EOJ
;

print $socket $data;


Tagged as: , , , No Comments

Using SCP to copy files between Linux servers

Posted on April 4, 2009

Posted by Kieran

even a gnome shell can look goodSCP? SCP is a method of securely transferring files between a local and a remote host or between two remote hosts, using the Secure Shell (SSH) protocol.

Sounds confusing?

Tagged as: , Continue reading

Permanently mount a Windows share in Linux

Posted on April 4, 2009

Posted by Kieran

A Terrabyte?Sick of manually mounting a Windows share on Linux with "mount" for it to drop off randomly? Or not really knowing if it is mounted or not?

Then make a permanent mount in fstab.

Tagged as: Continue reading

Block Countries in Apache

Posted on November 18, 2008

Posted by Kieran

Assuming you have mod_geoip installed in apache we can block certain countries in 6 lines of code.

I had a client who was experiencing an inhumane amount of spam on their phpBB forums, which are notorious for bot attacks. Luckily this forum was geographically specific - so we can block all the countries we aren't interested in.

Install Imagemagick / Imagick for PHP on Ubuntu

Posted on July 7, 2008

Posted by Kieran

No problem if you want to install imagemagick on your server, Ubuntu makes this very easy for you with only a few simple commands.

Tagged as: Continue reading

Find text within files

Posted on May 1, 2008

Posted by Kieran

Stuck trying to find text within files on Linux?

cd /directory_tree_you_want_to_search
find . -type f -exec grep -l "string to find" {} \; -print

Easy!

Tagged as: 2 Comments
Page 1 of 41234