posted this in Linux, Redhat Centos, Server Setup, Ubuntu on May 20th, 2013 Example to egrep valid ip address
To egrep all valid ip addresses in current directory:
|
|
egrep -r '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' . |
posted this in Linux, Redhat Centos, Server Setup, Ubuntu on May 2nd, 2013 Getting SSL to work with neo4j can be very frustrating. The crux of the problem is that their documentation isn’t very robust.
Here’s what they don’t tell you:
Both the cert and the key MUST be in DER format!
example to convert a PEM formatted crt key to a der formatted crt key openssl x509 . . . → Read More: neo4j SSL howto
posted this in Linux, Redhat Centos, Server Setup, Tomcat, Ubuntu on April 30th, 2013 I spend hours trying to figure this out and here are the fruits of my labor
Howto: Import valid cert and key into a java keystore
note: use the same password in each step
Step 1: Export your key and cert to pkcs12 format
|
|
openssl pkcs12 -export -inkey some.key -in some.crt -out some.p12 |
Step 2: Import p12 file to java key store
|
|
keytool -importkeystore -srckeystore some.p12 -srcstoretype PKCS12 -destkeystore truststore.jks |
. . . → Read More: convert valid godaddy cert key to java keystore for tomcat
posted this in nginx, Redhat Centos, Server Setup, Ubuntu on January 30th, 2013 Objective
Remove the index.php prefix from your nginx code igniter instance.
Assumptions In your main nginx conf file you define how php is called (unix socket or ip:port) You will replace foo.example.com with whatever your domain name is The proper logging path will be defined per your system as opposed to the location i have . . . → Read More: nginx code igniter remove index.php prefix
Recently I tried passing a bash variable to perl command in bash script, it didn’t end well.
Troy Engel from http://tacticalvim.wordpress.com/ was nice enough to point out the issue:
use sed instead of perl for what you need; it’s simpler, faster and uses the bash variables easily.
I set up a test script /home/someuser/test.sh to show:
. . . → Read More: passing bash variable to perl command in bash script
posted this in Linux, Redhat Centos, Ubuntu on January 17th, 2013
Objective: Append multiline text with cat Examples Tell log rotate to start rotating the http log (this overwrites any existing file)
append text to end of file with cat
Q: What is this magical feature? A: Here Documents . . . → Read More: append text to end of file with cat
posted this in Linux, Redhat Centos on January 11th, 2013 To install geoip php centos follow these steps
Install Steps
|
|
# cd /tmp # wget http://pecl.php.net/get/geoip-1.0.8.tgz # tar -zxvf geoip-1.0.8.tgz # cd geoip-1.0.8.tgz # phpize # ./configure # make # make install # echo "extension=geoip.so" >> /etc/php.d/geo.ini |
Verify Installation
|
|
# php -r 'print_r(phpinfo());' | grep -i geoip geoip geoip support => enabled geoip extension version => 1.0.8 geoip library version => 1004005 geoip.custom_directory => no value => no value OLDPWD => /tmp/geoip-1.0.6 _SERVER["OLDPWD"] => /tmp/geoip-1.0.6 # |
posted this in Linux, Redhat Centos, Server Setup on November 8th, 2012 To install Django on Centos or Redhat
|
|
echo "Installing httpd and httpd-devel" yum -q -y --enablerepo=ius install httpd httpd-devel > /dev/null 2>&1 chkconfig httpd on sed -i 's/Listen 80/Listen 8080/g' /etc/httpd/conf/httpd.conf service varnish start service httpd start To Install Python 2.7.2 on redhat or centos |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
echo "Install Python 2.7.2" mkdir -p /usr/local/src/python.2.7.2.install cd /usr/local/src/python.2.7.2.install wget "http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz" tar xzvf ActivePython-2.7.2.5-linux-x86_64.tar.gz cd ActivePython-2.7.2.5-linux-x86_64 ./install.sh -I /opt/ActivePython-2.7 echo "Install mod_wsgi" wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz tar -zxvf mod_wsgi-3.3.tar.gz cd mod_wsgi-3.3 ./configure --enable-shared --prefix=/opt/mod_wsgi-3.3 --with-python=/opt/ActivePython-2.7/bin/python make make install echo "Installing memcached" yum -y --enablerepo=ius install memcached sed -i 's/1024/20480/g' /etc/sysconfig/memcached sed -i 's/64/1024/g' /etc/sysconfig/memcached service memcached restart echo "Installing Django" export PATHOLD=$PATH export PATH=/opt/ActivePython-2.7/bin:/root/.local/bin:$PATH pypm -g install django pypm -g install mysql-python pypm -g install python-memcached 1.48 export PATH=$PATHOLD |
posted this in Linux, Redhat Centos, Server Setup on November 8th, 2012 To Install Python 2.7.2 on redhat or centos
|
|
echo "Install Python 2.7.2" mkdir -p /usr/local/src/python.2.7.2.install cd /usr/local/src/python.2.7.2.install wget "http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz" tar xzvf ActivePython-2.7.2.5-linux-x86_64.tar.gz cd ActivePython-2.7.2.5-linux-x86_64 ./install.sh -I /opt/ActivePython-2.7 |
posted this in Linux, Redhat Centos on November 8th, 2012 To install varnish on centos or redhat
|
|
#!/bin/bash echo "Adding Varnish Repository and installing varnish" rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm > /dev/null 2>&1 yum -q -y install varnish echo "Varnish installed." chkconfig varnish on echo "Fetching standard Varnish config from Cloud Files..." sed -i 's/VARNISH_LISTEN_PORT=6081/VARNISH_LISTEN_PORT=80/g' /etc/sysconfig/varnish wget --quiet -P /etc/varnish/ http://c460059.r59.cf2.rackcdn.com/cent_default3.vcl mv -f /etc/varnish/default.vcl /etc/varnish/default.vcl.orig mv -f /etc/varnish/cent_default3.vcl /etc/varnish/default.vcl echo "Varnish Configured." |
|
|