Wednesday, December 14, 2011

Missing mysql.sock on mac lion with Zend server

If you have MySQL server installed on Mac OS X Lion and after you install Zend Server
maybe you have this error:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
to fix this error you need to make this link:

sudo ln -s /private/tmp/mysql.sock /usr/local/zend/mysql/tmp/mysql.sock

Good luck :)

Monday, December 12, 2011

Run Jdeveloper on mac lion

To run JDeveloper on mac lion you need :

1- create file and name it java_setting.sh
2- put this in file


#!/bin/bash 

mkdir /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6

mkdir /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/bin

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/bin/java /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/bin/java

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/bin/javac /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/bin/javac

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/bin/javap /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/bin/javap

ln -s /System/Library/Java/Support/Deploy.bundle/Contents/Home/bin/javaws /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/bin/javaws

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/bin/jar /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/bin/jar

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/bin/xjc /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/bin/xjc

mkdir /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/lib

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/classes/classes.jar /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/lib/tools.jar

mkdir /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/jre

mkdir /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/jre/bin

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/bin/java /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/jre/bin/java

mkdir /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/jre/lib

ln -s /system/library/java/javavirtualmachines/1.6.0.jdk/contents/classes/classes.jar /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/jdk6/jre/lib/rt.jar

3- chmod +x java_setting.sh
4- sudo ./java_setting.sh

After that run jdevstudio11121install.jar and install .

thanks

Install mysql server 5.5 on mac lion

To install mysql server NOT MAMP only mysql server follow this link :

http://www.djangoapp.com/blog/2011/07/24/installation-of-mysql-server-on-mac-os-x-lion/

Sunday, December 11, 2011

Compare two columns using like syntax In MYSQL



if you have two tables:
emp (id , name, grad)
grad (id, name)

 and you want to compare column (emp.name and grad.name) with LIKE % use this:

select e.name, g.name 
from emp e inner join grad g 
ON e.grad like CONCAT('%',g.name, '%');

Saturday, December 3, 2011

Good example for CRUD OOP for PHP and MYSQL

By creating a MySQL CRUD class you can easily create, read, update and delete entries in any of your projects, regardless of how the database is designed.

This is good example for CRUD OOP for PHP and MYSQL: 


http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/

Thursday, December 1, 2011

Arabic problem in mysql command line client

To make mysql show arabic in command line use add this command :

mysql -u root -p --default-character-set=utf8

Fix "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"

If you use Zend server or MAMP and when you trying to connect to MySQL and got this error above just check the path to mysql.sock and link it in /tmp/ folder like this:

sudo ln -s /usr/local/zend/mysql/tmp/mysql.sock /tmp/mysql.sock





Sunday, November 20, 2011

How to make FreeBSD radio station web server

I like internet radio station and it`s sound good to have your owen Station 

So i find this site here it will guid you to build a FreeBSD server with radio station.

Good luck :)

Friday, November 18, 2011

Color Mac OSX Terminal Like Gentoo or Other

Edit:
~/.bash_profile
or
~/.profile
 
To set Gentoo-like colors on bash prompt, edit ~/.profile (or /etc/profile for system-wide defaults) and add the following:
if [[ ${EUID} == 0 ]] ; then
       PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' 
else
      PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' 
fi

and add the following two lines:
export CLICOLOR=1
 
#Dark blue
#export LSCOLORS=ExFxCxDxBxegedabagacad
 
#Gentoo Color
export LSCOLORS=ExGxFxDxCxDxDxhbhdacEc
 
#Light Blue Color
#export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx

source site here 



Saturday, October 15, 2011

MySQL configuration for Zend Framework

To use MySql database in your zend project u should add the following code to application/configs/application.ini under "[production]":


resources.db.adapter = "PDO_MYSQL"
resources.db.params.host = "localhost"
resources.db.params.username = "USERNAME"
resources.db.params.password = "PASSWORD"
resources.db.params.dbname = "DATABASE_NAME"
// for Arabic or other language you should add this lines below  //
resources.db.params.charset = "utf8"
resources.db.params.driver_options.1002 = "SET NAMES utf8"

Tuesday, September 20, 2011

Ubuntu 11.04 black screen on startup



At startup when you are going to choose the operating system that you want to boot:
  1. Select Ubuntu
  2. press E to edit boot command
  3. Change the word "quiet splash" to "nomodeset"
  4. press Ctrl + x to save and boot
Good luck.

Saturday, September 10, 2011

Enable APN settings for ios 5 beta 7


Setup, Enable, Edit APN for iOS 5 beta 7 EDGE Connection – The iOS 5 which still in beta version is expected to bring some more awesome features. Recently, the iOS 5 beta 7 is seeded and available for download. But one small lack of iOS 5 beta is the APN setting has been disabled by default.
To connect to Internet by custom APN, iPhone users will usually go to Settings >> General >> Network >> Cellular Data Network then enter new APN there. But on iOS 5 beta 7, you;ll not be able to see that option or editing Internet connection APN.
So how to enable custom APN / edit APN on your iPhone iOS 5 beta 7? Luckily a new web based service named as Benm.at offer a simple way to enable a install a custom APN profile on your iPhone by simply visiting that page (pretty similar way with userland jailbreak like JailbreakMe).
apn setting install

How to Edit APN Setting on iPhone iOS 5 b7

Step 1. On your iPhone >> launch Safari browser >> and open this link (http://help.benm.at/).
Step 2. Scroll down the page >> Features >> tap on [Tethering].
Step 3. Scroll down and tap on “Create Your Own” Generator.
Step 4. Now enter the APN settings in the field. You can find out what APN should you use via your carrier (simply ask the operator)
Step 5. Finally tap on [Download]
Step 6. Tap on [Install] >> confirm the modal alert >> restart your iPhone
Finally give it a try by enabling your Network Settings and try browsing websites on Safari. [via]

------------------------------------------------------------------------------------------------------

Source site

Friday, August 12, 2011

How to download Flash 10.2 video streams in Linux.


1- Download this Script here .


2- change mod the file to be executed
Type: chmod +x flashcache


3- load the video in a browser (wait until the video complete load), and check the output of the following command:
lsof | grep -i flash

 
This came out with a predictable, and very useful single line:
plugin-co 25646 n00b 17u REG 8,2 31286337 787220 /tmp/FlashXXepl6qa (deleted)


The second field of the output tells us which process currently has the file descriptor open, and the fourth tells us which number the file descriptor has taken. This is all we need to access the file itself.

4- run the script and put the secound field(25646) to script like this:
./flashcache 25646

If the script found the video it will show you this message:
/proc/25646/fd/27 -> foundflash.1.flv

That it, Good Luck.

-----------------------------------------------------------------------------------------------------

http://n00bsys0p.wordpress.com/2011/02/10/how-to-download-flash-10-2-video-streams-in-linux/

Thursday, August 11, 2011

SAVE STREAMING VIDEO, SAVE FLASH VIDEO... no program needed ON Mac

THIS TUTORIAL WILL COVER HOW TO SAVE FLASH VIDEOS FROM ANY SITE.

When you watch a video from youtube, google...ect the video once COMPLETELY downlaoded is ALREADY SAVED to your computer in a hidden directory. ALL YOU HAVE TO DO IS MOVE IT.

Use the TERMINAL application from applications/utilities folder...its easy. You will only need 3 commands: cd (change directory=change folder), ls (list whats in the folder), and cp (copy)

Tiger
*you can copy and paste these commands into the terminal window*

1. Start Terminal type "cd /private/var/tmp/folders.501/TemporaryItems" enter

2. This will take you to the folder with the flash video(s) type "ls" enter this will show the contents of the folder. (The flash videos will be FlashTmp1, FlashTmp2...and so on) Choose video 2 for example.

3. type "cp FlashTmp2 ~/Desktop" enter

THATS IT! The file will be moved to your desktop; play it with an flv player, covert it, delete it...ect.


Leopard (slightly more difficult)

1. Start Terminal type "cd /private/var/folders/" enter

2. Type "ls -R | grep "TemporaryItems" enter
it will give you the path for TemporaryItems folder .

3. Remove "./" from first of the path and enter to it by this command
Type "cd eeQUOonjE-GWvpRuzmR29+++TI/TemporaryItems" enter

4. This will take you to the folder with the flash video type "ls" enter this will show the contents of the folder. (The flash videos will be FlashTmp1, FlashTmp2...and so on) Choose video 2 for example.

5. type "cp FlashTmp2 ~/Desktop/FlashTemp2.flv" enter

THATS IT! The file will be moved to your desktop; play it, covert it, ect

---------------------------------------------------------------------------------------------------------------------
http://forums.macrumors.com/showthread.php?t=403792