Posts

How to install Homebrew in Mac OSX (High Sierra)

Homebrew setup guide This guide describes how to install Homebrew and few ferequently used Homebrew commands. Using Homebrew you can install software very easily. It is like linux "yum" command. Install Homebrew (The missing package manager for OS X): $/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $brew doctor   (You should see "Your system is ready to brew." on the console output. Do not move forward unless you see this.) Common commands: Check version of brew:    $brew --version Search Homebrew repo: $brew search %app name% (i.e: I want to check "wget" is available or not. $brew search wget) Check app information:    $brew info %app name% (i.e: $brew info wget) Install software package: $brew install %app name% (brew install tree) Uninstall software package: $brew uninstall %app name% (brew uninstall tree) Check installed packages in your system: $brew list Ins...

Programmer's PC Specifications

When I was studying at university, I had a dream that I would built a PC by myself. I was waiting for the opportunity to build a PC. Many years later, I have got the opportunity to build my own PC. It was very pleasing event. Someone wants to argue in this day nobody build PC unless it is a gaming rig. Actually, I do not want to argue about it. I just want to say, build by own hand give me inner peace. Today, I would like to share few thought about programmer's PC. As a programmer, I have few preference. Before building a PC you need money, without money you cannot buy parts. As a Java web application developer, I use Spring framework, JEE libraries, database system, Jetty, Nginx and Eclipse IDE every day. I am not building gaming rig. If you go to the Youtube , you will see most of the people demonstrating about gaming rigs. After watching almost all the "PC building guide for beginners", I have got feeling that everybody use PC for gaming, at present. Hello, I am a...

exFAT support in CentOS 7

exFat support in CentOS 7: "sudo yum install exfat-utils fuse-exfat"

Linux grep command

I have a file, called test.txt which contains the bellow contents: Mouse eats cheese. Cat eats mouse. Dog eats cat. Lamb eats dog. Worm eats lamb. Print the line where "Dog" is availabe: grep 'Dog' test.txt The output will be:   Dog eats cat. Show line above and below of "Dog": grep -C 1 'Dog' test.txt The output will be:   Cat eats mouse.   Dog eats cat.   Lamb eats dog. If I provide - C 2 then output contains 2 lines above and below of the "Dog".

How to reduce pdf file size from linux

Today, I have faced a weird problem about pdf file size. I had to send email to someone with pdf file attachment. The pdf file size was too big for the mail server. I am in linux platform. I have a tool to reduce the size. Yeah...........do it..........Hmm, what is the command please? gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile=small.pdf big.pdf

JavaScript module pattern and "new" keyword

It is an old post based on old idea, it is not so relevant anymore.   I have just encountered an article about JavaScript module pattern. As a Java developer, it blows my thinking about JavaScript. So far, it is the excellent article about JavaScript module pattern, according to my point of view. I added the link of the article for me and who wants to learn module pattern. https://toddmotto.com/mastering-the-module-pattern/ However, the self invoked function creates only one object in the memory. As a Java developer, it looks like Java singleton or static method kind of thing. You cannot create multiple objects using self invoked function. In this post, I am trying to demonstrate the situation step by step using simple example and potential solution of this issue.  For example: var Name = (function(){ var firstName = "Ted"; var lastName = "Bid"; var nameObject = {}; nameObject.setFirstName = function(fn){ ...

WGET: Downloading an Entire Web Site

I like to read online tutorial very much. Sometime, I would like to download whole site to view offline because tomorrow, the entire site may be down.  In Linux, it is very easy. Using wget command anyone can download whole site and it is very fast also.    $ wget --recursive www.website.com