Showing posts with label MacPorts. Show all posts
Showing posts with label MacPorts. Show all posts

2011-07-26

OSX - Macports upgrade outdated ports hits error

OS X Lion 10.7 just released and I've join in the club to upgrade my mac. As usual, macports needs to be refresh before knowing what it upgrade :
port -v selfupdate

Next, upgrade the ports as usual :

2011-04-22

Mysql - Error about packet too big while importing sql database












Q : While importing database in mysql, an error message pops out "ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes"
E.g.
$ mysql5 -u db_user -p db_table < db_table.sql 
Enter password: 
ERROR 1153 (08S01) at line 232: Got a packet bigger than 'max_allowed_packet' bytes
A : The file importing contains a statement that's probably too big, increase the value "max_allowed_packet" in my.cnf:

2010-09-24

Macports - After installing git-core, all packages depends on libssl breaks

Git is popular. Is like LinkedIn to working professionals and GitHub to programmers.




Before I'm able to play around git on my mac, "git-core" need to be installed first, through macports. As usual, installing port from macports is as easy as :
port -v selfupdate
port -v install git-core

After the installation, time to try git. When issue the command "git", it return an error message :
dyld: Library not loaded: /opt/local/lib/libssl.0.9.8.dylib
Referenced from: /opt/local/bin/git
Reason: image not found
Trace/BPT trap

In fact, all my other programs that installed through macports are having problem.
e.g.
Executing "svn" also return the same error :
dyld: Library not loaded: /opt/local/lib/libssl.0.9.8.dylib
Referenced from: /opt/local/bin/svn
Reason: image not found
Trace/BPT trap

Looking at the error message, my guts tells me that libssl has problem working with these programs. After messing around with the OpenSSL port, here's the solution :

2009-09-17

Network IP address calculator - for subnet and range of host

One of the task installing a new FreeBSD box was dealing with IP addresses. Usually, google a web based calculator would do the trick. But today's task is a bit different.

IPv6. A whole row of hexadecimal spinning in front of my eyes, just to figure out what is the range of IP that is usable. Web based IP calculator (based on java script) are not accessible using console based internet browser (links & lynx).

Spontaneously, searching the apt repository return some very interesting stuff.

Console based IP calculator. sipcalc.

Not only it is intelligent enough to figure out the input but also it is intelligent enough to generate useful output. Surprisingly, the output is scripting friendly (using grep and sed will parse the output).

These are the steps to install it under FreeBSD & Debian based distribution (e.g. Ubuntu) :

2009-04-21

mysql server - how to reduce disk space by moving mysql-bin.00000

One fine day, the server disk usage report that, the one of the partitions is almost full. After some searching, the database directory at /var/db/mysql/ (FreeBSD) or /var/lib/mysql/ (Linux) is occupying most disk space. Listing the directory only to found out that mysql-bin.0000* are the ones that is occupying the disk space. What are these files? Can it be remove it to reduce disk usage?

These mysql-bin.0000* files are the binary logs for your database. It contains all the statements of updating your database. It another words, it is the archived of your database. Removing it will need some preparations, which is not covered in this post. But the below does suggest a way to move it to another partition or disk :

2009-04-04

bash - send email with attachment or empty body with mutt

The mutt is not just an email client, it is also very useful in bash script. mutt's CLI (command line interface) parameter can be called and execute without starting the email client interactively, ideal to run it within bash script to send email. mutt is also able to control from config file, ~/.muttrc, with a rich feature set waiting to harness. Below is one of the possible way to send email with attachment, one or multiple, in a bash script :

2009-03-14

OSX - How to search/install/update Macports packages

Having to use a mac has been rewarding for the functionality of OS X, state of the art hardware, reasonable price, and most of all (to us open source monkeys), free software. Free software on mac have always been a problem if the developer did not make it available on mac. Even though the source of the software are made available, it could still be a hassle to compile and debug. Thanks to MacPorts, all of this can be done in just a few words of execution.

The installation of MacPorts can be found here. Below are the common usage of MacPorts :