PHP Recursive File Copy Function

I couldn’t find a function online that copies folders recursively in PHP and actually works, so I wrote my own: function recursiveCopy($src, $dest) { if (is_dir($src)) $dir = opendir($src); while ($file = readdir($dir)) { if ($file != ‘.’ && $file != ‘..’) { if (!is_dir($src.’/’.$file)) copy($src.’/’.$file, $dest.’/’.$file); else { @mkdir($dest.’/’.$file,… Continue reading

Javascript (JQuery): Social networking feeds – new Facebook authentication

After my previous post, Javascript (JQuery): Social networking feeds all in one place, Facebook went and added authentication to the feed retrieval. After much head-scratching, this is how to enable the Facebook feed under the new OAuth system. You need an access token to get to the data, so what… Continue reading

Javascript (JQuery): Social networking feeds all in one place

Today we are going to get feeds from Twitter, Facebook, Youtube and Flickr all in one place for your website using JSON and the JQuery library: Be careful on this page with wrapped lines! Firstly we declare the jquery library in our head section (obviously download it first and change… Continue reading

Roundcube: Vacation message with Virtualmin Plugin

None of the vacation/forwarding plugins work with Virtualmin so this is my workaround. Firstly, users need to be created as Mail and FTP users, since we will be using FTP to place the .forward files. Download and unzip the plugin: wget http://downloads.sourceforge.net/project/rcubevacation/vacation-1.9.9.zip?use_mirror=ovh&ts=1280145947 unzip vacation-1.9.9.zip cd vacation vi config.ini We are… Continue reading

Roundcube: Change Virtualmin Password Plugin

I can never get the Virtualmin binary file compilation to work properly, so here’s my workaround to enable changing a user’s Virtualmin password in Roundcube Webmail. Firstly, let’s go to the plugins/password directory (your path will be different): cd ~username/public_html/webmail/plugins/password cp config.inc.php.dist config.inc.php vi config.inc.php We need to change the… Continue reading

CentOs: Install ffmpeg & ffmpeg-php 0.6

The ffmpeg installed by yum cannot be used with ffmpeg-php, so we need to download and compile it: cd ~admin/software wget http://www.ffmpeg.org/releases/ffmpeg-0.6.tar.gz tar zxfv ffmpeg-0.6.tar.gz cd ffmpeg-0.6 ./configure –enable-shared make make install Now we need to download and configure ffmpeg-php: cd ~admin/software wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=puzzle&ts=1278667907 tar -xjf ffmpeg-php-0.6.0.tbz2 cd ffmpeg-php-0.6.0 phpize… Continue reading

Matrox RT.X100 project in Adobe Premiere RT.X2

If you open an old Matrox RT.X100 project using an RT.X2 installation, it opens as a standard Adobe Premiere project – without using any hardware acceleration, thus losing the entire point of the system. The answer is simple, but not documented anywhere: Step 1: Create a new Matrox-based Project as… Continue reading

Secure new CentOs install

Step 1: Secure SSH Log in as root to your server and type the following commands to backup and then edit the SSH configuration: cp /etc/ssh/ssh_config /etc/ssh/ssh_config.bak; cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak vi /etc/ssh/ssh_config Hit the i key to enter insert mode. Then uncomment all the lines after (and including) Host *… Continue reading