Project Archive

My Playground on the web

Use PHP to zip (archive) a folder

Here is a very simple way to use PHP to zip up (archive) a folder.

How to get address URL

How to get the full address URL using PHP .. /**** * Get the url address */ function getAddress() { // check for https $protocol = (isset( $_SERVER[‘https’]) == ‘on’ ? ‘https’ : ‘http’); //return address return $protocol.’://’.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’]; } //usage… Continue Reading →

How to get and display wordpress comment details.

With wordpress sometimes we might like to output details to a seperate page or even outside of our wordpress folder. The following code is an example of how to grab the details for your comment details. I recently learned this… Continue Reading →

How to create a new database with PHP & PDO

Creating a new databse with PHP and PDO : <?php // Hosting details $host=”localhost”; $root=”root”; $root_password=”rootpass”; // New database user, password & database name $user=’newuser’; $pass=’newpass’; $db=”newdb”; // Create database connnection try { $dbh = new PDO(“mysql:host=$host”, $root, $root_password); //… Continue Reading →

PDO code to show all databases

Showing a list of all the databases using PHP and PDO. <?php $user = ‘root’; $pass = ‘password’; $server = ‘localhost’; $dbh = new PDO( “mysql:host=$server”, $user, $pass ); $dbs = $dbh->query( ‘SHOW DATABASES’ ); while( ( $db = $dbs->fetchColumn(… Continue Reading →

Stripping linux weezy raspbian Part 2

This is part 2 of Stripping linux weezy raspian Lets strip some more stuff out. sudo apt-get remove -purge xdg-utils sudo apt-get remove -purge x11.* sudo apt-get remove -purge scratch sudo apt-get remove -purge xserver.* sudo apt-get remove -purge xarchiver… Continue Reading →

Stripping linux weezy raspbian

I came across a post about stripping down a raspberry pi version of linux :  Stripping Linux Raspbian so I wonder how far can you go in your stripping before it breaks ? lets find out shall we .. Lets… Continue Reading →

List all installed Libraries

To get a list of all the libraries installed on your linux machine execute /sbin/ldconfig -p Lets output it to a log file for viewing with nano or another editor. /sbin/ldconfig -p > libraries.log  

Install Nano Text Editor on PiLFS

Pilfs does come with vi, but i personally prefer nano text editor so let compile config and install it. First we need to grab the tar file and extract it. wget tar -xzvf nano-2.4.1.tar.gz cd nano-2.4.1 Now lets install… Continue Reading →

Convert PiLFS to work with BerryBoot / Raspberry Pi

The Linux from scratch (LFS) project has been around for quite a while now, but how about LFS for the Raspberry Pi ? Well you’re in luck, there is a project and a manual for doing just that. PiLFS project… Continue Reading →