Category Archives: Tech

Postgresql 9.5 and Red Hat Enterprise Linux 7.0

I used to use Postgresql 9.5 with Red Hat Enterprise Linux 6.6.

As quite a long time passed using them, I had change my server configuration. So, I tried to start using Postgresql 9.5 and Red Hat Enterprise Linux 7.0 . When started installing them, I found out that these completely new command set.  Here it goes,

wget https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-3.noarch.rpm
rpm -ivh pgdg-redhat95-9.5-3.noarch.rpm
yum install postgresql95-server.x86_64

Read more of this post

Advertisements

Check Linux Max Directory Size

Check Linux Max Directory Size

du -h –max-depth=1 | sort -hr

Tomcat – java.lang.OutOfMemoryError

Windows

find catalina.bat and add

# for out of memory
# Ensure that any user defined CLASSPATH variables are not used on startup,
# but allow them to be specified in setenv.sh, in rare case when it is needed.
CLASSPATH=

if [ -r “$CATALINA_BASE/bin/setenv.sh” ]; then
. “$CATALINA_BASE/bin/setenv.sh”
elif [ -r “$CATALINA_HOME/bin/setenv.sh” ]; then
. “$CATALINA_HOME/bin/setenv.sh”
fi

Read more of this post

Postgresql : moving data from windows to linux

I was trying to move my database from Windows server to Linux server. I thought it will be a simple process. But, it is not. It took backup from windows server via pgAdmin III. and tried to restore the backup to linux server via command line.

pg_restore -d dbname -U username -C /home/back1.backup

Then I got peer authentication error. so i fixed my pg_hba.conf file. It was

local   all             all                                     peer

I changed it to

local   all             all                                     trust

Then again I tried to run restore command. I got the following error.

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 2021; 1262 16483 DATABASE dbname dbname
pg_restore: [archiver (db)] could not execute query: ERROR: invalid locale name: “English_United States.1252”
Command was: CREATE DATABASE dbname WITH TEMPLATE = template0 ENCODING = ‘UTF8’ LC_COLLATE = ‘English_United States.1252’ LC_CTYPE = ‘Engli…
WARNING: errors ignored on restore: 1

Read more of this post

JDK installation in Redhat Linux

I had OpenJDK installed in my Redhat Linux. That openJDK was 1.6, i wanted to install jdk 1.7 from http://www.oracle.com/technetwork/es/java/javase/downloads/jdk7-downloads-1880260.html

So at first I had to uninstall OpenJDK. So,

yum remove java-1.6.0-openjdk.x86_64

Then I downloaded jdk-7u79-linux-x64.rpm from the above oracle.com link.

I copied the rpm to /usr/java and issued command as root

rpm -ivh jdk-7u79-linux-x64.rpm

after installation I issued

java -version

To check the installation.

The result. hmmmm….

java version “1.7.0_79”
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Looks like we are cool.

Subversion authz, passwd and svnserve.conf

I wanted to configure my subversion/svn server so that I can checkout or commit file with a specific user name and password. This type of authentication depends on three files. These are authz, passwd and svnserve.conf. Which are located in the corresponding repositories conf directory.

When we create a repository, these tree files are created automatically with default values. We have to add/edit some configurations to make work the repository properly.

svnserve.conf

I want to use a password file for authentication. So, I uncomment the following line to use the default password file.

password-db = passwd

I want  to use the default authorization file. So,

authz-db = authz

I also have to define anonymous access in my repository. I don’t want anyone to have read or write access to my repository.

anon-access=none

passwd

This password file contains the user name and password of authorized access in the repo.

So, I added my credentials.

fahmi=password

authz

This authorization file contains the

Increase MySQL max_connections for ‘too many connection error’

mysql -uroot -p

 

mysql> SHOW VARIABLES like ‘max_connections’;
+—————–+——-+
| Variable_name | Value |
+—————–+——-+
| max_connections | 100 |
+—————–+——-+
1 row in set (0.00 sec)

 

mysql> set global max_connections=500;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW VARIABLES like ‘max_connections’;
+—————–+——-+
| Variable_name | Value |
+—————–+——-+
| max_connections | 500 |
+—————–+——-+
1 row in set (0.00 sec)

WordPress Version Update

Get the latest WordPress zip (or tar.gz) file.
Unpack the zip file that you downloaded.
Deactivate plugins.
Delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access).
Using FTP or your shell access, upload the new wp-includes and wp-admin directories to your web host, in place of the previously deleted directories.
Upload the individual files from the new wp-content folder to your existing wp-content folder, overwriting existing files. Do NOT delete your existing wp-content folder. Do NOT delete any files or folders in your existing wp-content directory (except for the one being overwritten by new files).
Upload all new loose files from the root directory of the new version to your existing wordpress root directory.

Windows 7 Bootable USB Install

Insert Your USB flash drive.

Run cmd.exe as administrator. Read more of this post

SVN / Subversion Backup and Restore

My svn repo was at 172.17.1.62, now I want to sift it to 172.17.1.127

Previous one was hosted on Ubuntu platform, where subversion from tigris.org was installed.

The newer one is Red Hat linux and subversion is from apache.org

Both are the same source but version is different. Read more of this post