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

iPhone: Screen Capture on iPhone

wow, quite impressive, i didn’t know i can do this!
i was pressing on the home button on the iphone when i accidentally hit the off button, and the screen goes into a flash. so i was like, what’s this!? my iphone was in the silent mode then, so today, i was bored and was trying to figure it out, it goes *click* jus like the sound mac will produce when u do a screen capture! and volia, it capture the screen and store it in the photos.

To capture screen in iPhone,
Press the Power button followed by the Home button, the screen will flash and volia, you have it in your photos.

Comments

iPhone: Backup while Sync-in

to stop backing up when syncing iphone,

close itunes, and enter the following command into terminal.
defaults write com.apple.itunes DeviceBackupsDisabled -bool YES

to enable back, same thing, close itunes and enter the following command into terminal.
defaults write com.apple.itunes DeviceBackupsDisabled -bool NO

tat’s all folks

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: Connecting to msSQL Server on Mac

This is for ppl who are mac lover and mysql lover but due to work requirement have to conenct to mssql server on their mac.

if you had installed PHP Apache Module from Entropy.ch the following instruction is for you, else, you may try my earlier post on installing msSQL extension for php in *nix/Centos Server, largely used by WHM/cPanel.

entropy’s php for the version i install for mac is still in beta. but it comes with freeTDS installed, i am not too sure about the earlier versions. so to conenct to mssql server you jus have to configure your freetds.conf file which should be located in, the path,

/usr/local/php5/etc/freetds.conf

you may had name “php5″ with something else instead.

vi this file or open with a text editor and insert the following line at the end.

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

note that MSHOSTNAME for both case mus be the same, and is something like 192.168.0.100 or mssql.somehost.com etc. it should be the hostname you are connecting to probably in your php script.

ie: $link = mssql_connect(‘MSHOSTNAME’,'username’,'password’) or die(‘Damn! Unable to connect to msSQL Server!’);

tds version depends on the mssql server version you are connecting to, gennerally 8.0, and port is standard 1433 unless your remote mssql server connects on weird port number.

save, and you are done!

Comments (3)

Mac: Apple Remote

so you jus brought an apple remote and you want to pair it with your macbook, macbook pro etc, what do you do?

from Apple, it says:
1. Log in as an Admin user.
2. Get extra close to your Mac (about 3 or 4 inches away).
3. Point the remote at the Apple logo on the front of your Mac.
4. Press and hold the Menu and Next/Fast-forward buttons simultaneously on the remote for 5 seconds.

well, it got me trying for hours and still nothing works, until i found this webpage!

So, if the above 4 steps dun work for you,
replace step 4 with:
Press and hold the Menu and Play buttons simultaneously on the remote for 5 seconds.

simple! it is time apple update their support articles!

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

Mac: Show or Hide Hidden Files in Mac

a mac addict already, i should be having writing quite a lot of post on mac related stuff.

you generally wun need to see the hidden files in mac except prolly if you are using subversion, cos i was attempting to delete the .svn folder. which is by default and definitely hidden.

to show hidden files, open Terminal, and type the following:

1. defaults write com.apple.finder AppleShowAllFiles TRUE
2. killall Finder

omit “1.” or “2.”
statement 1. will state show hidden to TRUE, so to hide hidden files, jus do the same 2 line with FALSE.
statment 2. kill all “Finder” forcing a restart, warning! dun killall Finder if you are moving files or copying, etc.

Source: Slash Dot Dash

Comments

Mac: Coverting from Outlook to Mac Mail

so like i said in the previous post, i m migrating to mac, and having email being a important communication with my clients, i desperately need to export my mail over to mac and start getting things gng here.

so being desperately googling around for a tool which can convert outlook pst to something mac mail or ms entourage can read.. seriously they should allow direct import from pst.. well.. sadly, i cannot find any free tool, but then found this O2M by littlemachines.com

LittleMachines.com

it cost US$10, which i can consider is pretty cheap considering it let u test to make sure your outlook works well with the program and create sample mbox file for u to test importing into mac mail. if you are looking for something to convert from outlook to mac mail, i can say, look no further, jus pay that 10 bucks and get it done, i spent the whole nite and this is really the best solution already. work very smoothly for me.

the only thing that can be improved is if it can directly create sub folders for entourage, not too sure mac mail have sub folders, haven really try it out, but yes, if the folder structure can be retained that will be the best.

Comments

Mac: Switching off the Startup Sound of Mac OS X

i recently jus migrate over to mac. apple is more healthy than anything else.

but then there is this thing tat is very irritating, the loud startup sound. that u cannot really switch off, it still jus blast away even when you earpiece is plugged in, so did a goggle search and found this cool website which have a plug-in to system preference which will do just the job!

http://www5e.biglobe.ne.jp/~arcana/index.en.html

check them out.
you can switch off the startup sound, or adjust the volume to way max of too soft. or u can even mute it, which is very much the same as disabling the startup sound.

Comments