Running postgres on Linux using the following command:
sudo -u postgres psql
Technically, you're running a "psql" client command using user "postgres" .
A place to breathe
Friday, April 8, 2016
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!
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!
Sunday, January 10, 2016
Unable to connect to PostgreSQL server
I recently installed PostgreSQL on my server and trying out their configurations. All these while, I just play with MySQL. For some reason, I decided to use PostgreSQL for my current project.
PostgreSQL come with a user called postgres . If you want to use it with PHP, you might end up using the following from its documentation:
$dbconn2 = pg_connect("host=localhost port=5432 dbname=mary");
Bad news, it doesn't work on me.
pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user
To fix the error, all you need to do is to omit the "host" and the port parameter so that you just use something like this:
$dbconn2 = pg_connect("dbname=mary user=postgres password="yourpassword");
PostgreSQL come with a user called postgres . If you want to use it with PHP, you might end up using the following from its documentation:
$dbconn2 = pg_connect("host=localhost port=5432 dbname=mary");
Bad news, it doesn't work on me.
pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user
To fix the error, all you need to do is to omit the "host" and the port parameter so that you just use something like this:
$dbconn2 = pg_connect("dbname=mary user=postgres password="yourpassword");
Monday, January 4, 2016
How to install PHP packages with broken dependencies
Cent OS 6 is stable. Most of the people are familiar with it. So I decided to use the Cent OS 6 instead of Cent OS 7. I'm an middle-age ( i mean, mid 30s) software engineer. I don't want too much risk.
Assuming you've upgraded your repositories to Remi. For example, I want to install a PHP PostgreSQL.
Requires: php-common(x86-64) = 5.4.45-2.el6.remi
Installed: php-common-5.5.30-1.el6.remi.x86_64 (@remi-php55)
You need to issue the following instead:
Assuming you've upgraded your repositories to Remi. For example, I want to install a PHP PostgreSQL.
sudo yum install php-pgsql
If you get the following error:
Requires: php-common(x86-64) = 5.4.45-2.el6.remi
Installed: php-common-5.5.30-1.el6.remi.x86_64 (@remi-php55)
You need to issue the following instead:
sudo yum --enablerepo=remi-php55 install php-pgsql
Friday, January 1, 2016
Welcome to 2016
Hello 2016 !
Welcome to an exciting journey ! I can't wait to explore so many things this year.
2015 has been rough but rewarding. I thank God for everything wonderful in 2015.
Welcome to an exciting journey ! I can't wait to explore so many things this year.
2015 has been rough but rewarding. I thank God for everything wonderful in 2015.
Thursday, January 29, 2015
How to create a specific branch from previous commits
This is how you can create a specific branch from previous commits:
Where the last one is your commit SHA1 key
git checkout -b mergeprojects 3454qfxcc
Where the last one is your commit SHA1 key
Tuesday, December 16, 2014
How to install Facebook SDK the hard way
In case if you get an error installing Facebook SDK, try the following "forceful" command:
sudo CM_BUILD=CM_BUILD COMMAND_LINE_INSTALL=1 installer -verbose -pkg facebook-ios-3.1.16..pkg -target /
Then check your ~/Document folder.
The FacebookSDK folder and Bolt.framework should magically appear there!
sudo CM_BUILD=CM_BUILD COMMAND_LINE_INSTALL=1 installer -verbose -pkg facebook-ios-3.1.16.
Then check your ~/Document folder.
The FacebookSDK folder and Bolt.framework should magically appear there!
Subscribe to:
Posts (Atom)
About Me
- syamsulhasran
- I'm currently a software engineer. My specific interest is games and networking. I'm running software company called Nusantara Software.