11/02/10

Permalink 05:12:29 pm, by admin Email , 372 words, 3856 views   English (UK)
Categories: Hardware, Linux

Installing Ubuntu onto itself

What?

OK. Here's my situation. I have a laptop with a broken CDROM Drive, no floppy and a BIOS which does not support bootable USB. The only way to install was to load the HD with the installer and run from there. So:

  1. Remove the HD load it into a USB HD caddy and mount it on a working system (at this stage it can be either Windows or Linux depending on what Disk Partitioning tools you have - you'll need one that supports EXT3)

  2. Repartition the drive with a big EXT3 partition, a small (2Gb) EXT3 partition and a swap partition (2Gb)

  3. Download or create from an existing CD, an ISO for your distribution - I wanted Ubuntu Desktop 8.10 Intrepid Ibex

  4. Download, install and run UNetBootin

  5. Point UNetBootin to your small EXT3 partition and your ISO and let it do it's thing.

  6. Unmount the drive, install it back to the new machine and boot it

  7. The UNetbootin menu appears, select "Default" and let it boot. For my Distro, it booted into Ubunto Desktop Live mounted at /cdrom which gives you an "Install" icon on the Desktop.

  8. This is the key bit to allow the installer to work, start a Terminal window and run
    sudo umount -l -r -f /dev/sda2
    (where sda2 was the device mounted as cdrom)

  9. Click "install" on the Desktop and run through the prompts. If you didn't umount the device at /cdrom, the partition manager will be disabled so cancel the install and unmount it.

  10. When prompted reboot

  11. The newly installed Distro should now start via Grub. On mine, it didn't. Grub didn't have a menu item for my OS. To fix this, I visited http://users.bigpond.net.au/hermanzone/p15.htm#Second_method_configfile_boot which helped me use the Grub CLI to finally boot then fix the grub installation. One problem was a missing vmlinuz symlink. Rather than trying to fix that, I used the full path to the original file for the Distro's kernel version (Ubuntu 8.10 installs /boot/vmlinuz-2.6.27-7-generic on my system). Once you got grub to boot manually, edit the /boot/grub/menu.lst file and enable updatedefaultentry. Save & exit then run sudo update-grub. Thant should sort you out.

02/02/10

Permalink 12:50:07 pm, by admin Email , 121 words, 5894 views   English (UK)
Categories: Networking & Broadband, Hardware

Home Access Grant scheme - free computer and Internet access for low income families

On 11 January, the government launched the Home Access Grant scheme to provide grants to low income families to buy computer and/or internet packages. Families with children in state-maintained schools in England, in school years three to nine, who are entitled to free school meals or are in receipt of one of a number of qualifying benefits, will be able to apply for the grant. Carers and foster parents for 'looked after children' in school years one to thirteen are also likely to be eligible to apply for the grant. Families can call the Home Access Grant helpline on 0333 200 1004 to get an application form.

More information about the scheme is available on the Home Access website at www.homeaccess.org.uk

22/01/10

Permalink 12:50:15 pm, by admin Email , 493 words, 5333 views   English (UK)
Categories: Networking & Broadband

Understanding Business Broadband

Businesses can benefit considerably from a good broadband connection and because the requirements of most businesses differ to the average home broadband customer, there are a large number of specifically tailored packages which can provide business broadband that is flexible and versatile.

A broadband connection can allow a business to grow in a number of ways. It can facilitate remote working and help to create unified internet access for your business network, making all staff members linked in to the same system and allowing you to create servers that are accessible from any networked PC. It can also help you to promote your business and provide customers and clients with easy access to your services and products. However, with all of the business broadband providers and deals out there, coupled with the various technologies and confusing acronyms, it can be hard to pick a package that is right for your enterprise. If you are looking for solid advice on how to get started, this quick overview will definitely help.

For a basic business broadband package you will probably be looking to ADSL technology. This refers to an asymmetric digital subscriber line, which essentially means that download speeds will be much higher than upload speeds. If most of your traffic is going to be inbound and you are running a small or medium sized enterprise, then ADSL will usually be adequate to your needs. However, if you are going to be providing for a larger organisation, or want to allow interconnected networking between two different sites to form a unified internet hub then SDSL may be more suitable. This is a symmetric rather than asymmetric, which means both the upload and download speeds will be the same. As a result upload speeds will be 4 times faster than with basic ADSL. SDSL usually costs considerably more, but the benefits it offers will be obvious to those with big ambitions.

Business broadband packages will come with a wide variety of extra features to attract business-people looking to save money, including additions like free mobile broadband connectivity, free Wi-Fi access at hotspots around the UK and free technical support. Most ISPs will also include some basic web hosting as part of a standard business broadband bundle. This might be a sensible inclusion if you are looking to set up your first business website and do not want to pay for external hosting by a third party provider. However, if you establish your site on your ISP's hosting package, you will be tied in to that particular ISP for as long as you want to keep that site up and running. It is much more sensible to pick up a third party hosting package, as these can be inexpensive and more flexible than those offered by ISPs. They will also allow you to migrate provider and choose different business broadband deals without having to start your site from scratch with a new ISP and a new hosting package.

10/12/09

Permalink 02:27:05 pm, by admin Email , 171 words, 2699 views   English (US)
Categories: PHP

Button to "Select All" checkboxes in P4A

Given the following which creates a set of checkboxes:

$db =& P4A_DB::singleton();
$clientlist = array();
$items = $db->fetchAll("SELECT * FROM microsites WHERE status=1 ORDER BY sitetitle");
foreach ($items as $item) {
$ci = $item['user'];
$cd = $item['sitetitle'];
$clientlist[] = array('id' => $ci, 'desc' => $cd);
}

$client_array_source =& $this->build("p4a_array_source", "client_array_source");
$client_array_source->load($clientlist)
->setPk("id");


$selectallbutton = $this->build("p4a_button","selectallbutton")
->setLabel('Select All');
$this->intercept($selectallbutton, 'onClick', 'selectall');

$this->build("p4a_field","clients")
->setWidth(300)
->setType("multicheckbox")
->setSource($client_array_source)
->setSourceDescriptionField("desc")
->setSourceValueField("id");

This function will allow the user to click the "select all" button and have their checkboxes populated:

function selectall() {
$array_id = array();
$num_rows = $this->clients->data->getNumRows();
for ($i = 1; $i $#60;= $num_rows; $i++) {
$this->clients->data->row($i);
$array_id[$i] = $this->clients->data->getPkValues();
}
$this->clients->setNewValue($array_id);
$this->clients->load();
}

This works in P4A v3.4.1 but not 3.4.0. I've not tested on later versions.

Permalink 02:13:07 pm, by admin Email , 1138 words, 6442 views   English (US)
Categories: PHP

Basic native P4A File Manager

This code can be used as a P4A mask to provide very basic File Manager functionality outside of the RTE.

class fm extends p4a_base_mask
{
public $rootfolder = null;
public $htmlrootfolder = null;

//yes I know P4A has it's own system for this built around defined constants. Constants that we can't change! so lets do it here on a mask by mask basis.
public $valid_preview_images = array('gif','jpg','ico','png'); //'mp3','mp4','avi','pdf','doc','xls','odt','ods','txt'
public $valid_preview_text = array('txt');

public function __construct() {
parent::__construct();

$site = '/'.P4A::singleton()->user_data['user'];

$this->rootfolder = P4A_UPLOADS_DIR.$site;
$this->htmlrootfolder = P4A_UPLOADS_PATH.$site;

$iconpath = P4A_ROOT_URL.'/icons/default/16';
$this->setTitle('File Manager');

//File Handling
$this->build("P4A_Dir_Source", "fileset")
->setDir($this->rootfolder);

$this->build("P4A_Field", "upload_field")
->setLabel('Upload:')
->setUploadSubpath('')
->label->setWidth(50);
$this->upload_field->setType("file");
$this->intercept($this->upload_field, "afterUpload", "afterUpload");

$this->build("p4a_table",'table')
->setSource($this->fileset);
$this->table->addActionCol ('delete')
->cols->delete->setLabel('<img src="'.P4A_ROOT_URL.'/icons/default/16/actions/edit-delete.png" alt="[D]" title="Delete this file" />');
$this->intercept($this->table->cols->delete, 'afterClick', 'DeleteColClick');
$this->table->addActionCol ('preview')
->cols->preview->setLabel('<img src="'.P4A_ROOT_URL.'/icons/default/16/actions/thumbnail.png" alt="[P]" title="View this file" />');
$this->intercept($this->table->cols->preview, 'afterClick', 'TableRowClick');
$this->table->rows->addAction('afterClick');
$this->intercept($this->table->rows, 'afterClick', 'TableRowClick');

$this->build("P4A_Fieldset","f_table")
->setLabel('Files ['.str_replace($this->rootfolder,'.',$this->fileset->getDir()).']')
->anchorLeft($this->table)
->anchorCenter($this->upload_field);

//Directory Handling
$this->build("P4A_Toolbar","dtb")->setSize(16);
$this->dtb->addButton('new_',$iconpath.'/mimetypes/folder_green.png');
$this->dtb->addButton('home',$iconpath.'/actions/go-home.png');
$this->dtb->addButton('delete',$iconpath.'/actions/edit-delete.png');
$this->intercept($this->dtb->buttons->new_, 'onClick', 'createFolder');
$this->intercept($this->dtb->buttons->home, 'onClick', 'goFolderHome');
$this->intercept($this->dtb->buttons->delete, 'onClick', 'deleteFolder');

$navme = $this->build("P4A_Dir_Navigator","navme")
->setBaseDir($this->rootfolder);
$this->navme->addAction('afterClick');
$this->intercept($this->navme, 'afterClick', 'NavRowClick');

$this->build("P4A_Field", "create_folder_field")
->setWidth(100)
->label->setWidth(30)
->setLabel('New: ');

$this->build("P4A_Fieldset","f_navme")
->setLabel('Directory ['.str_replace($this->rootfolder,'.',$this->navme->getBaseDir()).']')
->setWidth(250)
->anchor($this->create_folder_field)
->anchorleft($this->dtb)
->anchor($this->navme);
//Preview Handling
$this->build("p4a_image","imagepreview")
->setStyleProperty('position','relative') //a bit of elbow room
->setStyleProperty('padding','10px'); //a bit of elbow room

$this->build("p4a_box","textpreview")
->setWidth(500)
->setStyleProperty('padding','10px'); //a bit of elbow room

$this->build("P4A_Button", "close_imagepreview_button")
->setSize(16)
->setLabel('Close Preview',false)
->setIcon($iconpath.'/actions/window-close.png')
->implement("onclick", $this, "closeImagePreview");

$this->build("P4A_Button", "close_textpreview_button")
->setSize(16)
->setLabel('Close Preview',false)
->setIcon($iconpath.'/actions/window-close.png')
->implement("onclick", $this, "closeTextPreview");

$this->build("P4A_Fieldset","f_imagepreview")
->setLabel('')
->setVisible(false)
->anchorRight($this->close_imagepreview_button)
->anchorCenter($this->imagepreview);

$this->build("P4A_Fieldset","f_textpreview")
->setLabel('')
->setVisible(false)
->anchorRight($this->close_textpreview_button)
->anchorCenter($this->textpreview);

//Display
$this->frame->anchor($this->f_navme)
->setWidth(700)
->addCssClass('mr_frame')
->addCssClass('ui-corner-all')
->anchorLeft($this->f_table)
->anchorCenter($this->f_imagepreview)
->anchorCenter($this->f_textpreview);

$this->build("P4A_Quit_Toolbar","toolbar");

$this->display("top",$this->toolbar);

$this->info('File Manager Loaded...');

}

public function closeImagePreview() {
$this->f_imagepreview->setVisible(false);
}
public function closeTextPreview() {
$this->f_textpreview->setVisible(false);
}

public function goFolderHome() {
$d = $this->rootfolder;
$this->f_navme->setLabel('Directory [.]');
$this->fileset->setDir($d)
->reload();
$this->navme->setCurrentSubdir($this->rootfolder);
$this->uploadfield->setUploadSubpath('');
$this->f_table->setLabel('Files [.]');
}

public function NavRowClick($a) {
$v = $this->navme->getCurrentSubdir();
$d = $this->rootfolder;
$this->f_table->setLabel('Files [./'.$v.']');
$this->f_navme->setLabel('Directory [./'.$v.']');
$this->fileset->setDir($d.'/'.$v)
->reload();
$this->uploadfield->setUploadSubpath($d.'/'.$v);
}

public function TableRowClick($o, $a) {
$f = $this->table->data->fields->filename->getValue();
$s = $this->table->data->fields->size->getValue();
$e = trim(end(explode(".", $f)));
if (in_array($e,$this->valid_preview_images)) {
$relativepathfilename = $this->navme->getCurrentSubdir().'/'.$f;
$this->imagepreview->setIcon($this->htmlrootfolder.'/'.$relativepathfilename);
$this->f_textpreview->setVisible(false);
$this->f_imagepreview->setLabel('Preview: '.$f)
->setVisible(true);
} elseif(in_array($e,$this->valid_preview_text)) {
$relativepathfilename = $this->navme->getCurrentSubdir().'/'.$f;
$fileContent = file_get_contents($this->rootfolder.'/'.$relativepathfilename,FILE_TEXT);
$this->textpreview->setValue('<pre>'.$fileContent.'</pre>');
$this->f_imagepreview->setVisible(false);
$this->f_textpreview->setLabel('Preview: '.$f)
->setVisible(true);

} else {
$this->info('Sorry. Preview unavailable for this file');
}
}

public function DeleteColClick($o, $a) {
$this->info('Deleting file...');
$fullpathfilename = $this->fileset->getDir().'/'.$this->table->data->fields->filename->getValue();
unlink($fullpathfilename);
$this->fileset->reload();
$this->info('Done...');
}

public function createFolder() {
$this->info('Creating...');
$v = $this->navme->getCurrentAbsoluteDir();
$folder = $this->create_folder_field->getNewValue();
if ($v == $this->rootfolder.'/') {
$fullnewpath = $v.$folder;
} else {
$fullnewpath = $v.'/'.$folder;
}
mkdir($fullnewpath,0777,true);
$this->create_folder_field->setNewValue(null);
$this->info('Done...');
}

public function afterUpload() {
$tmpname = $this->upload_field->getNewValue(0);
$name = $this->upload_field->getNewValue(6);
$fullpath = $this->fileset->getDir();

rename(P4A_UPLOADS_TMP_DIR . "/$tmpname", "$fullpath/".$name);
$this->upload_field->setNewValue(null);
$this->fileset->reload();
}

public function deleteFolder() {
$this->info('Deleting directory...');
$v = $this->navme->getCurrentAbsoluteDir();
$folder = $this->create_folder_field->getNewValue();
if ($v == $this->rootfolder.'/') {
$this->error('You cannot delete your root directory');
} else {
$fulldelpath = $v.'/'.$folder;
$oneup = realpath($fulldelpath.'/../');
$this->_delete_directory($fulldelpath);
$this->navme->setBaseDir($oneup); //move navme up one
$this->fileset->setDir($oneup) //move filelist up one
->reload();
$this->info('Done...');
}
}

function _delete_directory($dirname) { //remove containing files & directories then remove what I've asked for
if (is_dir($dirname))
$dir_handle = opendir($dirname);
if (!$dir_handle)
return false;
while($file = readdir($dir_handle)) {
if ($file != "." && $file != "..") {
if (!is_dir($dirname."/".$file))
unlink($dirname."/".$file);
else
$this->_delete_directory($dirname.'/'.$file);
}
}
closedir($dir_handle);
rmdir($dirname);
return true;
}

}

You may need to add the necessary icons to the correct location in the

./icons

directory. I used the Open Source Crystal iconset.

This was developed using P4A v3.4.1

I'm sure this can be improved upon, feel free to do so and let me know...

Permalink 01:42:01 pm, by admin Email , 218 words, 4194 views   English (UK)
Categories: PHP

Upgrading the P4A FCKEditor File Manager

I use P4A a lot. One thing I've found though is that the default File Manager which comes with it's implementation of FCKEditor is a bit basic for my customers.

As a result, I now use TinyBrowser as a replacement. This article outlines how to implement it.

First off, download the latest TinyBrowser from http://www.lunarvis.com, currently this is v1.41.

Extract the contents of the TinyBrowser download into
./themes/default/widgets/rich_textarea/editor/filemanager/browser/tinybrowser

Edit ./themes/default/widgets/rich_textarea/rich_textarea.php and place the following code inside the first PHP code block:


// Introduced by Fear of Mice to support tinybrowser
$mydir = P4A_UPLOADS_DIR. '/' . $this->getUploadSubpath(); //set
$prep = false;
if (substr($mydir, 0, 7) == 'http://' || substr($mydir, 0, 8) == 'https://') { //Strip_Slashes
$prep = TRUE;
}
$mydir = str_replace('https://','',$mydir);
$mydir = str_replace('http://','',$mydir);
$mydir = preg_replace('|(/)+|','/',$mydir);
if($prep === TRUE) {
$mydir = prep_url($mydir);
}
$mydir=base64_encode($mydir); //encode it

then replace:

rte.Config['LinkBrowserURL'] = rte.BasePath + 'editor/filemanager/browser/default/browser.html?Connector=<?php echo $connector ?>';

with

rte.Config['LinkBrowserURL'] = rte.BasePath + "editor/filemanager/browser/tinybrowser/tinybrowser.php?path=<?php echo $mydir ?>";

That's it. You should now have a nice File Manager which supports multiple uploads and thumbnails.

30/11/09

Permalink 12:40:10 pm, by admin Email , 51 words, 18947 views   English (UK)
Categories: PHP, Linux

CodeIgniter .htaccess for use with Heart Internet

Here's a working .htaccess file for CodeIgniter projects hosted on Heart Internet.

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]

*please note, I'm note endorsing the use of Heart Internet Hosting. You'll probably find better facilities elsewhere ;)

09/07/09

Permalink 01:33:25 pm, by admin Email , 417 words, 4734 views   English (UK)
Categories: Networking & Broadband

Rural Mobile Broadband - An Overview

Mobile broadband has the major benefit of allowing you to continue to use the Internet for all of things you would use it for whilst you are away from home. It is great for people who often travel or those who have to travel a long way to work. As long as the area you are in has at least decent coverage, it is possible to connect to the Internet through your mobile wherever you are. Mobile broadband doesn't require a fixed phone line, and there are plenty of options available where you only pay for the amount of time you spend on the Internet. Even if you don't subscribe to a mobile broadband service, you can still use either free WiFi hotspots to access mobile Internet or others by paying for the time you spend online by receiving a password.

If you live in a rural area, it is likely that your part of the country has yet to be equipped with 3G technology, and instead only has a second generation network, meaning you are likely to suffer with limited coverage of your mobile broadband. To have a chance of overcoming this problem of poor coverage in rural areas, visit different mobile broadband provider's websites and use their coverage checker to find out the standard of coverage you can expect from their service. That way, you can pick the provider who offers your area the highest amount of coverage. If you do live in a place where only a 2G network is available, you should still be able to check your e-mails and perform other simple tasks via your mobile broadband connection.

Another problem with rural mobile broadband mobile broadband is that you are unlikely to receive the maximum connection speed advertised by the mobile broadband supplier you choose to use. Connection speeds are usually affected by the amount of mobile broadband users connected to the network you use in your area and if there is any electrical interference present in your rural area. Slow connections again can result from the rural area in which you live not having a third generation network, and only having 2G. Again check on suppliers' websites to see if any of the providers offer a superior connection speed to your area compared to other providers. If there are no companies with 3G networks in your rural area, unfortunately mobile broadband is not probably the way to go if you want to use the Internet quickly and for many different purposes.

:: Next Page >>

fear of mice

This is the official blog of

We aim to post comments (and possibly solutions) to some of the more interesting IT Support issues we come across in our daily travels around the South Hams of Devon.

| Next >

September 2010
Mon Tue Wed Thu Fri Sat Sun
<< <     
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Search

Categories

Misc

XML Feeds

What is RSS?

Who's Online?

  • Guest Users: 2

powered by
b2evolution