Thursday, May 31, 2012
pfsense restore configuration in cmd mode
once in your shell, you have to remount the /cf partition as writeable
make a note of the permissions on /cf/conf/config.xml
mount -u /cf
Then copy in your config
scp <source> /cf/conf/config.xml
make sure your permissions are okay
Then reload the config
/etc/rc.reload_all start
make a note of the permissions on /cf/conf/config.xml
mount -u /cf
Then copy in your config
scp <source> /cf/conf/config.xml
make sure your permissions are okay
Then reload the config
/etc/rc.reload_all start
Tuesday, May 29, 2012
How To Generate SSL Key, CSR and Self Signed Certificate For Apache
If you want to convert your website from HTTP to HTTPS, you need to get a SSL certificate from a valid organization like Verisign or Thawte. You can also generate self signed SSL certificate for testing purpose.
In this article, let us review how to generate private key file (server.key), certificate signing request file (server.csr) and webserver certificate file (server.crt) that can be used on Apache server with mod_ssl.
In this article, let us review how to generate private key file (server.key), certificate signing request file (server.csr) and webserver certificate file (server.crt) that can be used on Apache server with mod_ssl.
Key, CSR and CRT File Naming Convention
I typically like to name the files with the domain name of the HTTPS URL that will be using this certificate. This makes it easier to identify and maintain.
- Instead of server.key, I use www.thegeekstuff.com.key
- Instead of server.csr, I use www.thegeekstuff.com.csr
- Instead of server.crt, I use www.thegeekstuff.com.crt
1. Generate Private Key on the Server Running Apache + mod_ssl
First, generate a private key on the Linux server that runs Apache webserver using openssl command as shown below.
# openssl genrsa -des3 -out www.thegeekstuff.com.key 1024
Generating RSA private key, 1024 bit long modulus
.......................................++++++
...................................................++++++
e is 73547 (0x01001)
Enter pass phrase for www.thegeekstuff.com.key:
Verifying - Enter pass phrase for www.thegeekstuff.com.key:
# ls -ltr www.thegeekstuff.*
-rw-r--r-- 1 root root 963 Jun 13 20:26 www.thegeekstuff.com.key
The generated private key looks like the following.
# cat www.thegeekstuff.com.key
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,485B3C6371C9916E
ymehJu/RowzrclMcixAyxdbfzQphfUAk9oK9kK2
jadfoiyqthakLKNqw9z1MoaqkPyqeHevUm26no
AJKIETHKJADFS2BGb0n61/Ksk8isp7evLM4+QY
KAQETKjdiahteksMJOjXLq+vf5Ra299fZPON7yr
-----END RSA PRIVATE KEY-----
2. Generate a Certificate Signing Request (CSR)
Using the key generate above, you should generate a certificate request file (csr) using openssl as shown below.
# openssl req -new -key www.thegeekstuff.com.key -out www.thegeekstuff.com.csr
Enter pass phrase for www.thegeekstuff.com.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:US
State or Province Name (full name) [Berkshire]:California
Locality Name (eg, city) [Newbury]:Los Angeles
Organization Name (eg, company) [My Company Ltd]:The Geek Stuff
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server's hostname) []: thegeekstuff
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
# ls -ltr www.thegeekstuff.*
-rw-r--r-- 1 root root 963 Jun 13 20:26 www.thegeekstuff.com.key
-rw-r--r-- 1 root root 664 Jun 13 20:35 www.thegeekstuff.com.csr
3. Generate a Self-Signed SSL Certificate
For testing purpose, you can generate a self-signed SSL certificate that is valid for 1 year using openssl command as shown below.
# openssl x509 -req -days 365 -in www.thegeekstuff.com.csr -signkey www.thegeekstuff.com.key -out www.thegeekstuff.com.crt
Signature ok
subject=/C=US/ST=California/L=Los Angeles/O=thegeekstuff/OU=IT/CN=www.thegeekstuff.com
Getting Private key
Enter pass phrase for www.thegeekstuff.com.key:
# ls -l www.thegeekstuff*
-rw-r--r-- 1 root root 963 Jun 13 20:26 www.thegeekstuff.com.key
-rw-r--r-- 1 root root 664 Jun 13 20:35 www.thegeekstuff.com.csr
-rw-r--r-- 1 root root 879 Jun 13 20:43 www.thegeekstuff.com.crt
# cat www.thegeekstuff.com.crt
-----BEGIN CERTIFICATE-----
haidfshoaihsdfAKDJFAISHTEIHkjasdjadf9w0BAQUFADCB
kjadfijadfhWQIOUQERUNcMNasdkjfakljasdBgEFBQcDAQ
kjdghkjhfortoieriqqeurNZXCVMNCMN.MCNaGF3dGUuY29
-----END CERTIFICATE-----
You can use this method to generate Apache SSL Key, CSR and CRT file in most of the Linux, Unix systems including Ubuntu, Debian, CentOS, Fedora and Red Hat.
4. Get a Valid Trial SSL Certificate (Optional)
Instead of signing it youself, you can also generate a valid trial SSL certificate from thawte. i.e Before spending the money on purchasing a certificate, you can also get a valid fully functional 21 day trial SSL certificates from Thawte. Once this valid certificate works, you can either decide to purchase it from Thawte or any other SSL signing organization.
This step is optional and not really required. For testing purpose, you can always use the self-signed certificate that was generated from the above step.
Go to Thwate trial certificate request pageand do the following:
This step is optional and not really required. For testing purpose, you can always use the self-signed certificate that was generated from the above step.
Go to Thwate trial certificate request pageand do the following:
- Select “SSL Web Server Certificate (All servers)” under the “select your trial certificate”.
- Do not check the PKCS #7 check-box under the “configure certificate”
- Copy/Paste the *.csr file that you generate above in the textbox under “certificate signing request (CSR)”
- Click on next at the bottom, which will give you a 21-day free trial certificate.
Copy/Paste the trial certificate to the www.thegeekstuff.com.crt file as shown below.
# cat www.thegeekstuff.com.crt
-----BEGIN CERTIFICATE-----
haidfshoaihsdfAKDJFAISHTEIHkjasdjadf9w0BAQUFADCB
kjadfijadfhWQIOUQERUNcMNasdkjfakljasdBgEFBQcDAQ
kjdghkjhfortoieriqqeurNZXCVMNCMN.MCNaGF3dGUuY29
-----END CERTIFICATE-----
Thursday, May 24, 2012
Adding subversion to eclipse on linux (ubuntu)
You want to use subversion in eclipse? You will need a javahl implementation.
Ubuntu has a javahl package:
Then add this to your eclipse.ini:
Ubuntu has a javahl package:
sudo apt-get install libsvn-java
Then add this to your eclipse.ini:
-Djava.library.path=/usr/lib/jni
How To install Adobe Flash on Google Chrome - Ubuntu 11.10 - 64-bit
Google Chrome has inbuilt flash plugin now, but its only for 32-bit version of the browser, for 64-bit Google Chrome you must manually download and install flash into your Chrome.
- Download Adobe Flash Player from http://get.adobe.com/flashplayer
Select Operating System - Linux(64 bit)and version Ubuntu(apt) or (tar.gz)If you select apt your software center will automatically install Flash Player Plugin for ChromeBut in case if thats not working you can download tar.gz open it and follow the instructions as given below..
- Extract the libflashplayer.so file on your desktop
- Now open your Terminal and type
If the "plugins" folder is absent you can create it by
sudo mkdir /opt/google/chrome/plugins
Now restart the System, flash player should work now
Wednesday, May 9, 2012
What is the Purpose of Awk?
Awk is a stream editor, similar to Sed. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). While in some ways similar to an editor which permits scripted edits (such as ed), Awk works by making only one pass over the input(s), and is consequently more efficient. But it is Awk’s ability to filter text in a pipeline which particularly distinguishes it from other types of editors.
Awk may be started with complex scripts containing rules to transform input streams. This article is dedicated to one-line scripts, that are utilized most often in shell scripts to filter and transform data.
Basic Usage of Awk
Awk works on input streams or simple text files. You just have to feed Awk with text and you have to define what actions have to be performed. The output stream of Awk will contain the filtered and transformed data.
Thursday, May 3, 2012
How to increase memory allocated to the JVM
You can do this by changing catalina.sh (in Linux/Unix) or installservice.bat (for Windows). Open the file and search for the line where the minimum and maximum heap size for the JVM are being assigned.
This line would look something like this:
JAVA_OPTS=-Xms128m -Xmx256m
or
--JvmMs 128 --JvmMx 256
Subscribe to:
Posts (Atom)