Monday, September 2, 2013

Use tracepath instead of traceroute

Just wanted to note myself of this one,

$ tracepath 210.213.128.14
1: centos (10.0.1.19) 0.094ms pmtu 1500
1: maximum (10.0.1.1) 1.327ms
1: maximum (10.0.1.1) 1.866ms
2: dsl.49.145.0.1.pldt.net (49.145.0.1) 55.341ms
3: 122.2.135.37.pldt.net (122.2.135.37) 50.527ms
4: 210.213.135.17.static.pldt.net (210.213.135.17) 73.554ms
5: 210.213.128.62.static.pldt.net (210.213.128.62) 79.921ms
6: 210.213.129.33.static.pldt.net (210.213.129.33) 83.518ms
7: 210.213.128.45.static.pldt.net (210.213.128.45) 71.558ms
8: 210.213.131.93.static.pldt.net (210.213.131.93) 71.437ms asymm 9
9: 210.213.128.14.static.pldt.net (210.213.128.14) 211.873ms reached
Resume: pmtu 1500 hops 9 back 247


tracepath can be run without the need of any super user privileges.


Saturday, July 27, 2013

Is RAID 0 still beneficial or not?

Hmmm, I have no idea about this but if anyone might read about this, please check http://tweakers.net/reviews/515/1/raid-0-hype-or-blessing-raid-0-hype-or-blessing.html

That article is so very old but if you have a raid-0 setup either with SSD's in a RAID 0 setup vs SSD itself, any benchmark result you have, please share.

Monday, July 15, 2013

OSX VPN send all traffic over VPN via route command

Base on this inputs from stackoverflow
,
sudo /sbin/route add -host pandora.com -interface ppp0

In this example, "pandora.com" is the host that should be routed via the VPN and "ppp0" is the name of the VPN network interface (ifconfig shows you the list of network interfaces).

Friday, July 5, 2013

Problem with YAML in Perl

I have no idea why this fix but I was installing MySQLSandbox with an error occurred but this link helps me solve it,

http://www.linuxquestions.org/questions/linux-newbie-8/problem-in-upgrading-cpan-918683/

Anyhow, to be particular, this one helps me solve the problem

$ su -
# cpan
# cpan> install Bundle::CPAN
# cpan> reload cpan
# cpan> exit



Sunday, June 16, 2013

Setting global environment in Mac OS X

I just wanted to quote myself on setting the environment variable in Mac OS X.

From, http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x

This is stated as,

1) Open a terminal prompt
2) Type sudo vi /etc/launchd.conf (note: this file might not yet exist)
3) Put contents like the following into the file
# Set environment variables here so they are available globally to all apps
# (and Terminal), including those launched via Spotlight.
#
# After editing this file run the following command from the terminal to update 
# environment variables globally without needing to reboot.
# NOTE: You will still need to restart the relevant application (including 
# Terminal) to pick up the changes!
# grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl
#
# See http://www.digitaledgesw.com/node/31
# and http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x/
#
# Note that you must hardcode the paths below, don't use enviroment variables.
# You also need to surround multiple values in quotes, see MAVEN_OPTS example below.
#
setenv JAVA_VERSION 1.6
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
setenv GROOVY_HOME /Applications/Dev/groovy
setenv GRAILS_HOME /Applications/Dev/grails
setenv NEXUS_HOME /Applications/Dev/nexus/nexus-webapp
setenv JRUBY_HOME /Applications/Dev/jruby

setenv ANT_HOME /Applications/Dev/apache-ant
setenv ANT_OPTS -Xmx512M

setenv MAVEN_OPTS "-Xmx1024M -XX:MaxPermSize=512m"
setenv M2_HOME /Applications/Dev/apache-maven

setenv JMETER_HOME /Applications/Dev/jakarta-jmeter
4) Save your changes in VI and reboot your Mac. Or use the grep/xargs command show in the code comment above.
5) Prove that your variables are working by opening a Terminal window and typing export and you should see your new variables. These will also be available in IntelliJ and other GUI apps you launch via Spotlight.

Tuesday, May 28, 2013

MySQL: Running MySQL in command line thru mysqld

Just wanted to take note of this. Instead of running your MySQL as a service, or thru mysqld_safe, the command line you can run can actually be like this.


  1.  /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/macmini.local.err --pid-file=/usr/local/mysql/data/macmini.local.pid

Sunday, November 25, 2012

vim problems with ^M (caret M), due to file format incompatibility

The problem with ^M or caret M that you see in files during editing or modifying is that incompatibility with vim's default file format.

Usually, if I have a file edited or created in Mac OS X, and when its edited via Linux, I got ^M plus the lines are displayed as one line which is freaking hard to edit. To fix this, just do edit the file, then reload the file in vim,

:e ++ff=mac

or

:e ++ff=unix

if it was created in Unix. This will render with a great view editor of your file from what you expected it should be.

According to vim's Wiki,
"
unixLF only (each line ends with an LF character).
dosCRLF (each line ends with two characters, CR then LF).
macCR only (each line ends with a CR character).
CR is carriage return (return cursor to left margin), which is Ctrl-M or ^M or hex 0D
" 

You can read for more info for file format in this page http://vim.wikia.com/wiki/File_format