Showing posts with label :: Mac OS X. Show all posts
Showing posts with label :: Mac OS X. Show all posts

Friday, November 21, 2014

Enable / disable horizontal scroll on Textmate

Just simple way, to enable or disable horizontal scroller on the Textmate, just type:
CMD + OPTION + W

Wednesday, February 12, 2014

Installing wget on Mac OS X

Install via MacPort:
sudo port install wget

Installing htop on Mac OS X

Just simple way to installing htop via MacPort:
sudo port install htop

Download manually

curl -O http://themainframe.ca/wp-content/uploads/2011/06/htop.zip
unzip htop.zip
sudo mv htop /bin
Done, and test it..
htop

Tuesday, January 21, 2014

How to remove rest files after uninstall netbeans on Mac

1. Shotdown the software


2. Drag the Netbeans folder in /Applications to the Trash


3. Delete some file with terminal


rm -rf ~/Library/Application\ Support/NetBeans/7.4
rm -rf ~/Library/Caches/NetBeans/7.4
sudo rm -rfv /private/var/db/receipts/org.netbeans.*

Thursday, January 16, 2014

Library not loaded: libmysqlclient.18.dylib (LoadError) on Mac OS

When installed raisl 4.0.1, it's raise some error:
/opt/local/lib/ruby2.0/gems/2.0.0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require': dlopen(/opt/local/lib/ruby2.0/gems/2.0.0/extensions/x86_64-darwin-13/2.0.0/mysql2-0.3.14/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /opt/local/lib/ruby2.0/gems/2.0.0/extensions/x86_64-darwin-13/2.0.0/mysql2-0.3.14/mysql2/mysql2.bundle
  Reason: no suitable image found.  Did find
to fix this problem, type command below:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

Installing MySQL on Mac OS X

Before you are download, ensure your architecture of Mac:
Oper your terminal and type
uname -a
and the result are:
Darwin aruls-mbp 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
The "RELEASE_X86_64 x86_64", it's mean your computer is using 64 Bit architecture computer.

Firstly, download the MySQL 64 Bit software





Double click at file "mysql-5.6.15-osx10.7-x86_64.dmg" and will appear popup like this:













Ok, next step is:

Install the mysql-5.6.15-osx10.7-x86_64.dmg
Install the MySQLStartupItem.pkg
Install the MySQL.prefpane

















Then click "Start MySQL Server" and "Check Automatically Start on startup"
We need do something to using "mysql" command work on the Terminal, follow the step
Open up your terminal:
vi ~/.profile
Use the "i" key, to insert mode, then paste this line:
"export PATH=$PATH:/usr/local/mysql/bin"


















Hit the ‘Esc’ key to exit insert mode and type “:wq” and hit enter to write and quit the editor. Close the terminal window and open a new one. You can then enter this command:
mysql -u root -p
Set MySQL password
/usr/local/mysql/bin/mysqladmin -u root password SECRET
Setting the Socket The last command we'll need to run in terminal will allow Apache and PHP to access MySQL:
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Tuesday, November 12, 2013

How to Unhide folder on Mac from Terminal

Open up your terminal and change current location:
chflags nohidden *

Friday, October 18, 2013

Could not find 'railties' (>= 0) among 8 total gem(s) (Gem::LoadError) when installing Rails 4 on Mac Lion

Found this issue after installed Rails 4 and using RVM for manage the Ruby version

when i type :
rails -v
it's make rise some errors like the below:
.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'railties' (>= 0) among 8 total gem(s) (Gem::LoadError)
after googling about this issue, i have some references for solve the issue
possibility i was installing many times version ROR on mycomputer.
but i try the resolve my self, solved this.
here we go

1. Remove RVM

rvm implode

2. Check gem environment

gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.0
  - RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-9
  - GEM PATHS:
     - /Library/Ruby/Gems/1.8
     - /Users/matt/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/

3. Cleanup all old Ruby

rm -rf /Library/Ruby/Gems/1.8
rm -rf /System/Library/Frameworks/Ruby.framework/Versions/1.8
rm -rf /Users/your_username/.gem/ruby/1.8
rm -rf /usr/lib/ruby/gems/1.8

4. Reinstalling Rails 4

Follow this link to install Rails 4

Thursday, October 10, 2013

Installing Ruby on Rails 4 on Mac



For installing Rails 4, you must install or upgrade your Ruby version.
The Ruby must be higher then 1.9.3, read more
In this section i'm using Ruby 2.0







Step 1: Installing Ruby 2.0

I think you must install XCode firstly, after installed the XCode GCC was included,
it's make easy when installing Ruby.
To install Ruby here's have two ways:

  • Installing Ruby with Macports
  • Installing Ruby with RVM


Step 2: Installing Rails

sudo gem install rails

How to install Ruby 2.0 using Port on Mac (Macports)

Step 1: Install Macports

Firstly, let's install the Macport

Step 2: Install Ruby 2.0

port selfupdate -v
port list | grep ruby
sudo port install ruby20

Step 3: Make symbolic link

sudo port select --set ruby ruby20
or
cd /opt/local/bin
sudo ln -s ruby20 ruby

How to install Ruby 2.0 on Mac using RVM

Step 1: Installing RVM


Installing the stable release version:
\curl -L https://get.rvm.io | bash -s stable
For more options follow rvm guide

Step 2: Restart Terminal


To use the "rvm" command, let's restart the Terminal (cmd + q)
ensure the "rvm" command work, type that code on your Terminal
rvm

Step 3: Download Ruby 2.0


rvm list known

Step 4: Installing Ruby 2.0


rvm install 2.0.0

Step 5: Make default Ruby 2.0


rvm use 2.0.0 --default 

Saturday, September 28, 2013

Setting Virtual Host (VHost) on Mac OS X

1. Preparation

In this section i'm used local.mysite.dev for sample
Start Apache
1. Go to System Preferences
2. Select "sharing"
3. Check the box "Web Sharing" -- for starting the apache

2. Edit the Host file

For editing you can use nano or mate text editor for command line
sudo nano /etc/hosts
or
sudo nano /private/etc/hosts
You can see the following codes:
#
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
add new host local.mysite.dev at end of line
#
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
127.0.0.1       local.mysite.dev


3. Switch in the httpd.conf file

sudo nano /etc/apache2/httpd.conf
find the "# Virtual hosts" string using ctl + w and type "# Virtual hosts" without (")
# Virtual hosts 
#Include /private/etc/apache2/extra/httpd-vhosts.conf
un comment the code to enable the VHost
# Virtual hosts 
Include /private/etc/apache2/extra/httpd-vhosts.conf


4. Add virtual host in apache

sudo nano /private/etc/apache2/extra/httpd-vhosts.conf
add these codes:
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any  block.
#
                                                                                                   
< VirtualHost *:80>
  ServerName localhost
  DocumentRoot "/Library/WebServer/Documents"
< /VirtualHost>

< VirtualHost *:80>
  ServerAdmin local@mysite.dev
  DocumentRoot "/Library/WebServer/Documents/mysite/webroot/"
  ServerName local.mysite.dev
    < directory "/Library/WebServer/Documents/mysite/webroot/">
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      Allow from all
    < /directory>
  ErrorLog "/private/var/log/apache2/local.mysite.dev.com-error_log"
< /VirtualHost>


5. Restart Apache

finally, restart the Apache
sudo apachectl restart
Open your browser the type the url (http://local.mysite.dev) --for example

How to run TextMate command in terminal on Mac OS

I have installed TextMate on my Mac,
i wanna edit some file in terminal using TextMate, googling that issue and found some tutorial
here's the step:
Open your Terminal and type
sudo ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/bin
now, you can call TextMat app with "mate" command:
mate /path/file_you_want_to_edit.txt
for more help, just type:
mate --help

Thursday, May 2, 2013

Turn off warnings and notice on PHP on Mac







To clear this issue, follow the step:
sudo cp -rf /etc/php.ini.default /etc/php.ini
sudo nano /etc/php.ini
then find and edit error_reporting
CTRL+W to find error_reporting module the change that code like the bellow line:
error_reporting = E_ALL & ~E_NOTICE
Restart your apache
sudo apachectl restart
that's all, reload your page.

Forbidden You don't have permission to access / on this server







I got this issue on Mac Lion OS X.
to fix this issue, just simple step.. here we go

Oper your terminal and type:
sudo nano /etc/apache2/extra/httpd-vhosts.conf 
add these line of codes:
< VirtualHost *:80>
   DocumentRoot "/Library/WebServer/Documents"
< /VirtualHost>
Restart your apache
sudo apachectl restart

Wednesday, April 24, 2013

Customize your Mac Finder with XtraFinder

With Xtrafinder, you can custom your Finder like enable Tab, Cut.. etc.
simple way, download and install. donwload Xtrafinder