Thursday, May 24, 2012

Adding postgres user and grant to a database

Adding postgres user and grant to a database

template1=# CREATE USER tom WITH PASSWORD 'myPassword';
template1=# CREATE DATABASE jerry;
template1=# GRANT ALL PRIVILEGES ON DATABASE jerry to tom;

Monday, May 7, 2012

Maintaining PHP session when using CURL.

Maintaining PHP session when using CURL.

 Put session_write_close() before you make the CURL request.

$strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/';
 
session_write_close();
 
$ch = curl_init($rssFeedLink);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt( $ch, CURLOPT_COOKIE, $strCookie );
$response = curl_exec($ch);
curl_close($ch);

Posted via email from Posterous

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...