Archive for software

Snow Leopard: SpotLight

a while back, i disabled spotlight cause the process mds was totally consuming too much ram.
with improved spotlight in snow leopard, i decided to give it a chance, but totally forget how to enable it back!
so here’s for the reference:

To turn Spotlight Indexing OFF in MAC OS X 10.6 Snow Leopard
sudo mdutil -a -i off

To turn Spotlight Indexing ON in MAC OS X 10.6 Snow Leopard
sudo mdutil -a -i on

Just type the respective command in terminal.
If this don’t help you may follow the instruction on the link in reference.

Reference: Spotlight won’t work?

Comments

Vacuuming iPhoto database

with lots of photos events and album in iphoto, really need optimisation! vacuuming do helps quite a bit.

Inside the iPhoto Library Package, there are four SQLite databases (face_blob.db, face.db, iPhotoAux.db and iPhotoMain.db). I found that by vacuuming all four of these databases, I restored iPhoto ’09’s performance back to something on par with its predecessor.

Open Terminal and cd into your iPhoto Library (by default, cd “~/Pictures/iPhoto Library”). Once there, execute the following command:
for dbase in *.db; do sqlite3 $dbase “vacuum;”; done

Source: macosxhints : Speed up iPhoto ‘09 by vacuuming its databases

Comments

emptying large log files

my apache error_log file was like getting over 400mb! and go googling to figure how to empty these error messages and found this!

# cat /dev/null > /private/var/log/apache2/error_log

that simple! and the error_log file is emptied.
simplest method, fast and easy way to empty any file

Comments

Mac: Lynx Text Web Browser and SEO-Browser

Being trying out some seo stuff, well, have yet to optimise this site, but was workin on a wordpress site for a client, many interesting reads. one pretty good one will be this:
WordPress SEO by Joost de Valk
well if u googled, he will probably be among the top few in the PR for that search term.

Being using Lynx through SSH on my unix server, so now that i got a mac, Lynx on mac!
a very easy install

may want to check out this cool page SEO Browser
what i find so interesting is that it show you how your site is redirected like those permanently moved 301 and stuff. very good, in fact, i am trying to do something like this now. but more for searching for orphans links, missing images etc.

Comments

Mac: Installing mySQL in Leopard

phew! mySQL is finally working on my Mac OS X 10.5

Leopard comes with Apache and PHP installed but you will need to start Apache
by opening terminal and run:
apachectl -k start

to enable php
refer to Foundation PHP

to auto start apache, go to “System Preference” and under “Sharing”, check on “Web Sharing” this will auto start Apache on bootup

to install mySQL, the pretty challenging part here.
if not done correctly, u probably will get permission error on data, failure to start automatically etc.
jus follow the instruction here:
Installing MySQL on Leopard – Red91.com
will archieve the tutorial here when i can find more time.

Comments

How To: Install mssql extension for php on unix

woh! okie.. this installation is gng to be long a tough.. took me a few days of google crawling and testing before i finally get it to work.

okie, why will u need to install mssql extension on php? possibly becos u need to connect to a ms sql server of ur vendor or something like that. for integration i hope. cos unix works best w php and mysql, ie, installation, it is almost already thr. correct me if i m wrong.

so wad you need?
if your server is jus fresh out of the box or say u had installed whm/cpanel there will be quite a far bit of stuff u will need.

1. Txt2man
2. unixODBC
3. freeTDS
4. PHP mssql.so

if this point if you are wondering if i m using any rpm for installation?
sorry,i m not, cos my server centos installed w whm/cpanel seems to be poorly equipped or configured for rpm installation, too many dependencies required. so jus download all the binary and upload them onto ur server.

Setup 1: Install unixODBC package

Install unixODBC first. Download the software in your home directory or anywhere you like and uncompress and untar the software.

You can do this by using following command

# tar -xvzf unixODBC-2.2.12.tar.gz

Once it is done, go to the unixODBCxxxx dir and run the configure command.

# ./configure -prefix=/usr/local -enable-gui=no

Note: If you dont use enable-gui option and dont have Qt package, you will get the error. So make sure you use it if no Qt is installed.

After configure is successfully completed, run the make and then make install commands.

# make

Install it

# make install

Step 1.1: Installing Txt2man
this step is optional if your server already have txt2man installed.
txt2man is required by freeTDS to man it documentation, i do find this portion pretty useless though.
else jus download the package, and run the make

# make

Install it

# make install

Step 2: Install freeTDS package

Download the freeTDS package and untar and uncompress it.

# tar -xvzf freetds-stable.tgz

Run the configure.

# ./configure -with-tdsver=8.0 -with-unixODBC=/usr/local

Run the make

# make

Install it

# make install

Step 3: Configuration freeTDS
Start configuration with freeTDS. Look for the freetds.conf file and add the entry for the MS SQL server.

[MSHOSTNAME]
host = MSHOSTNAME
port = 1433
tds version = 8.0

Sql server standard port is the 1433. The tds version for MS SQL server 2000 is 8. You can try 8.0 with new version as well.
Important: the host need to be the same as the declaration. ie
if you have [mssql.hostname.com], ur host will be = mssql.hostname.com

Step 4: Configuration – unixODBC

The unixODBC need two main configuration files called odbcinst.ini and odbc.ini. These files should be in the /etc/ dir.

I. The first file odbcinst.ini contain the definition of ODBC driver.

[TDS]
Description = FreeTDS driver
Driver = /usr/local/lib/libtdsodbc.so
Setup = /usr/local/lib/libtdsodbc.so
Trace = Yes
TraceFile = /tmp/freetds.log
FileUsage = 1

Note: Before making above entries, make sure libtdsodbc.so exists in the /usr/local/lib dir.
In the above configuration, we have define TDS as driver.

II. The second file is odbc.ini. This file has information about your MS SQL database.

[MSHOSTNAME]
Driver = TDS
Description = MS SQL Test
Trace = Yes
TraceFile = /tmp/mstest.log
Servername = 192.168.1.100
Database = testdb
Port = 1433

You can notice above that the freeTDS driver is the name defined in odbcinst.ini while servername is the one defined in freetds.conf.

Step 5: Test MS SQL connectivity from Linux box
Check if you can connect to MS SQL database using unixODBC tool called isql.

# isql -v mstest satest satest
+—————————————+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+—————————————+
SQL> select * from “sysObjects”;

If you see the results, you are connected.

Step 6: Getting your mssql.so file
Update: I came back to follow this to create an .so file and realise, mmm, this instruction wasn’t too clear. So here it goes. From PHP.net Download page, download the source code, then if you unzip, you will find a folder “ext” and “mssql” in the “ext” folder. tat’s the folder i m referring to, ‘cd’ to this folder and then run phpize as below mentioned.

Add: for the benefits of those who just need the .so file, you can download the mssql.so from here. however, i don’t assure, compatibility with you php version. is built with php 5.2.10 binaries.

php.net is not distrubuting the binary version of php package for *nix server, so you will have to create the .so extension file yourself. download the source file for php and upload the folder /ext/mssql/ into your server
then

# cd /uploaded_path/mssql/
# phpize
# ./configure
# make
# make install

this commands will automatically create a copy of mssql.so in the installed extension folder.
you can check your extension folder from

<?php
phpinfo();
?>

Step 7: Enabling the extension

# echo “extension=mssql.so” > /usr/local/lib/php.ini

or you can use a texteditor and add that value manually into php.ini

Step 8: Restarting Apache Server!
dependin on version installed and location

# /etc/init.d/httpd restart

and you are done!
do drop me an email should you face any problem at any step!
i know the pain in gettin this extension installed on unix. and considering rpm fails to work in the first place.
i will say, this is the best way to get it installed, cos u have full control over it. and didn’t fail me, of cos, after hell lots of googling around.

Source:
dpacool.com
unixodbc.org
Scott’s Blog
PHP PECL

Comments (52)