A place to breathe

Friday, April 8, 2016

How to run Postgres in your Unix

Running postgres on Linux using the following command:

sudo -u postgres psql 

Technically, you're running a "psql" client command using user "postgres" .

Monday, April 4, 2016

How to download Perl modules the easy way

I have had very bad moment with the default "CPAN" client. All these while I never got it to work.

Frustrated, I search around the web for alternatives.

Fortunately, i found a client called "cpan minus" (or cpanm) which really does what you expect: downloading perl modules.

Follow these steps:

1. Download the App::cpanm :
    curl -L https://cpanmin.us | perl - --sudo App::cpanminus 

2. Copy to your bin location. in my case, I like to put it at /opt of my Cent OS machine:
    /opt/cpanm/ 

Now, this is the trickier part. In the documentation, it doesn't really say how you can run it. Now, after inspecting the script in the "bin" folder, I realize that it's just a perl module. So, running perl module, you run:

perl /opt/cpanm/bin/cpanm --self-upgrade --sudo 

Say you want download package LWP.
Now you can download perl module with joy:

sudo perl /opt/cpanm/bin/cpanm LWP

Done!


About Me

I'm currently a software engineer. My specific interest is games and networking. I'm running software company called Nusantara Software.