Posts

Installing swftools on FreeBSD using port tools

Doing a pkg_which swftools show nothing, and swftools needs to be installed. So what I did, I changed directory by cd /usr/ports/graphics/swftools/ then issued command   make install clean and encountered this error ===>   jpeg-8_1 depends on package: libtool>=2.2 - not found ===>   Found libtool-1.5.26, but you need to upgrade to libtool>=2.2. so I issued portupgrade command to upgrade my libtool by   portupgrade -r libtool then cd /usr/ports/graphics/swftools/ yet, another error I encountered. ===>   An older version of graphics/jpeg is already installed (jpeg-6b_7)       You may wish to ``make deinstall'' and install this port again       by ``make reinstall'' to upgrade it properly.       If you really wish to overwrite the old port of graphics/jpeg       without deleting it first, set the variable "FORCE_PKG_REGISTER"   ...

Using sed with backreference as the replacement pattern

Tinkering with sed, I have manage to try using regular expressions using backreferences using the most common \N where N is the number of position inside the parenthesis. Searches and replaces the zoo.color to zoo['color'] or zoo.animals to zoo['animals']: cat zoo.js | sed -E "s/(zoo)(\.)([a-zA-Z0-9]*)/\1['\3']/g"|less \1 = is the characters inside the first parenthesis w/c is the zoo \3 = is the characters inside the third parenthesis which involves alpha-numeric -E will interpret as regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's) Another example, you can use this for replacing such a string let say, in a SQL statement, example SQL string: CREATE DEFINER=`mysqluser`@`%` FUNCTION `total`(cost DOUBLE, income DOUBLE, lng2 DOUBLE) RETURNS double And you wanted to remove  DEFINER=`mysqluser`@`%`  and allow  FUNCTION  to be a dynamic string so you'll just need to catch tha...

What is Love and Importance of Love?

Image
First Letter to the Corinthians 12:31.13:1-13. Strive eagerly for the greatest  spiritual gifts . But I shall show you a still more excellent way. If I speak in human and angelic tongues but do not have love, I am a resounding gong or a clashing cymbal . And if I have the gift of prophecy and comprehend all mysteries and all knowledge; if I have all faith so as to move mountains but do not have love, I am nothing. If I give away everything I own, and if I hand my body over so that I may boast but do not have love, I gain nothing. Love is patient, love is kind. It is not jealous, (love) is not pompous, it is not inflated, it is not rude, it does not seek its own interests, it is not quick-tempered, it does not brood over injury, it does not rejoice over wrongdoing but rejoices with the truth. It bears all things, believes all things, hopes all things, endures all things. Love never fails. If there are prophecies, they will be brought to nothing; if tongues, they will cease; if know...

Mac OS X Install MySQL, Apache + mod_xsendfile, PHP with iconv, gd, pdo, and bug fixes, and PHPMyAdmin

apache: - for apache + mod_xsendfile, read the blog post regarding on mod_xsendfile compiling w/in mac os x for apache module php: sudo CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" './configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-config-file-path=/etc/' '--with-config-file-scan-dir=/opt/local/var/db/php5' '--enable-bcmath' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-hash' '--enable-json' '--enable-libxml' '--enable-pdo' '--enable-phar' '--enable-session' '--enable-simplexml' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-bz2=/opt/loca...

Mounting A Shared Folder from Mac OS X running samba to Linux

By executing the code below: mount -t cifs -o uid=1001,gid=100,username=boboyshariff //mymacosxnetbiosname/www ws_mac/www/ -t = cifs is the filing system rather than smbfs where CIFS stands for Common Internet File System (CIFS) is a protocol that lets programs make requests for files and services on remote computers on the Internet. When trying to use smbfs, you will be prompted by a kernel warning saying "smbfs is deprecated and will be removed from the 2.6.27 kernel. Please migrate to cifs" -o = if you specify some options specially when dealing with file permission and ownership or account credentials on accessing the smb server remotely. uid is what user id is to be used when it's shared to your linux local, gid where the group id to be used for the directory permission and username is the username from remote server running samba. Note that password will be prompted afterwards which is pretty secure. Note also that mymacosxnetbiosname can be an ip or a dom...

mod_xsendfile compiling in mac os x leopard and snow leopard for i386 or x86_64 arch type

Mod_Xsendfile  i s a small Apache2 module that processes X-SENDFILE headers registered by the original output handler." If you did encountered trouble integrating the module for XSendfile for Apache in Mac OS X, I manage to compile it by passing the flags which would suffice the architecture of the processor's model. apxs -cia -Wc,"-arch x86_64" -Wl,"-arch x86_64" mod_xsendfile.c -Wc           the compiler flags -Wl           the linker flags. That is applicable only if your arch type is x86_64 in Mac. I have Snow Leopard in my desktop, priorly it was Leopard 10.5.8. For Leopard 10.5.8, It does works when you pass "-arch i386" for compiler flags and linker flags. This works like a charm and Apache doesn't end up segmentation fault anymore. Hope this helps!

Java - make a jar file and include external classes or jar files, creating keystore, and signing a jar app

Compiling java app D:\java_apps\myapp>javac -verbose -sourcepath src_code_dir -classpath extlib\jai-1_1_4-pre-dr-b03-lib-windows-i586-28_Sep_2009\lib\ext\jai_codec.jar;"C:\Program Files\Java\jre6\lib\plugin.jar"; -d sod sod\org\myapp\ScanDriverApplet.java -d                destination directory for class files -verbose         includes information about each class loaded and each source                   file compiled. -classpath       Set the user class path, overriding the user class path in the                  CLASSPATH environment variable. If neither CLASSPATH or                   -classpath is specified, the user class path consists                   of the current di...