How to Set Up an Access Point on Ubuntu Sharing a WPA-PSK Network Connection on a wireless usb key with iPad.

I won an iPad on Gild.com in a coding challenge :D

So now i have an iPad and I want to share the network connection of my wired laptop over a usb wireless card. Sure, i could use my wi-fi router but I should'nt write this article!!!

So, let's go :)

QR Bar Code for ostico.it

Only for spamming purpose and for fun, this is the Ostico's website QR BarCode!!

ostico.it

Nice, you don't??? :°D

PHP SQLite3::open() Bug on return Value

From PHP Manual on SQLite3 http://www.php.net/manual/en/sqlite3.open.php

As the Php Reference said:

SQLite3::open

(PHP 5 >= 5.3.0)

SQLite3::open — Opens an SQLite database

Return Values:

Returns TRUE on success, FALSE on failure to open the database.

But is not true, it returns NULL :

<?php

class testSQLite3 extends SQLite3{
	
	public function __construct(){
		var_dump( $this->open('test.sqlite') );
	}
	
}

new testSQLite3();

Bash Replace all occurrences of a string in files.

Some tools can perform a recursive "find and replace" of a string in all files of a directory.
Bash can do the same.

For security purposes, it's better to make a files back up.

For one file:

sed -e "s/SEARCH/REPLACE/g" > TARGETFILE

For more files or for a list of them:

flyUser@OnUsbSystem:~# grep -lre 'pattern' . | xargs -d'\n' sed -i 's/SEARCH/REPLACE/g'

GREP option -e (--regexp=PATTERN) for the name file is specified by POSIX.

Bash, replace a character in a file name list

Assume we have a long list of files and we have to replace a character occurrence in all file names. In this example we have a list oh html files and we have to replace all underscore chars with a dash.

This bash script may be useful:

flyUser@OnUsbSystem:/#\
> for i in *.html;
> do x=$( echo $i | grep '_' | sed 's/_/\-/g' );
> if [ -n "$x" ];
> then mv $i $x;
> fi;
> done;

How To Install ezPublish on Dreamhost.

Load ezpublish archive ( ezpublishcommunity-4.4.0-gpl.tar.gz in this case ) on site directory.

Log into DreamHost ssh:

flyuser@OnUsbSystem:/home/flyuser# ssh <user_name>@<server_name>.dreamhost.com

Once logged:

[<user_name>@<server_name> : ~] $ cd <site_name>/
[<user_name>@<server_name> : ~] $ tar -xvvf ezpublishcommunity-4.4.0-gpl.tar.gz 

Fatal Error: Cannot redeclare class Zend_Session

In my new application, i get this error:

Fatal error: Cannot redeclare class Zend_Session in /www/.../libs/Zend/Session.php on line 50 

My application tried to redeclare a class ( Zend_Session ), but where was it previously declared?

Surely Zend Class was previously declared by default from php.ini.

I made a simple dump of ini setting include_path:


#var_dump ( get_include_path() );

phpMyAdmin - Fatal Error: session_start()

When upgraded the system i found this error when i tried to start phpmyadmin on my server.

Fatal error: session_start() [function.session-start]: Failed to initialize storage module: files (path: ) in /usr/share/phpmyadmin/libraries/session.inc.php on line 75

I looked into my /usr/local/zend/etc/php.ini and i found that the save_path was commented (don't know why)

;session.save_path = "/tmp"

array_replace - Translate New PHP 5.3 Function in PHP < 5.3

From PHP reference we can see array_replace() function:

How To Change Default Aptitude Download Directory

Sometimes, on large upgrades, i need to change the default download directory of the apt package manager because i'm in a bootable usb key with obviously short dimensions.

We can change this directory from options on aptitude command line.

Suppose another usb mounted in another slot in /media/usbslot2 (or another drive in another position)
we have to create a dir in this drive and another subdirectory named partial inside them.

root@OnUsbSystem:/# mkdir -p /media/usbslot2/.apt/partial
Syndicate content