Thursday, January 23, 2014

cron job

0 1 * * *   /bin/backup.sh
@daily root /bin/code.sh

code.sh

cd /path-to-file
tar -cvf drk-`date +%Y%m%d`.tar.gz  /path-to-file

backup.sh

#!/bin/sh
#backup.sh
ldir=$(mysqldump --routines --single-transaction -u Username -ppassword dbname > /path-to-file/drk_`date +"\%Y\%m\%d\%H\%M\%S"`.sql);

Friday, January 17, 2014

Add Godaddy SSL Certificate with Simple Control Panel

This task seems easy at first but it can become more tricky than what it looks. If you have a godaddy SSL and Simple Control Panel, this will make your life easier.

1. Go to Simple control panel and click on SSL Certificates
2. Click on CSR and fill in the form linking with appropriate domain. Set Key Length to 2048
3. After the record is created, edited and copy the CSR KEY
4. Log in to godaddy control panel.
5. Click on SSL Certificates and enter de SSL Certificate control panel.
6. Choose the desired certificate and click on Key or Re-Key.
7. Paste the CSR key and click next.
8. Download the certificate for Apache.
9. Open the downloaded files and go back to Simple Control Panel.
10. Edit the certificate previously generated.
11. There will be two fields filled up and two empty. Copy/paste the key of the certificate from file you downloaded into the Certificate box.
12. Finally copy the Intermediate Certificates from the gd_bundle file into the Intermediate Certificate box, and click Save.

Thursday, January 16, 2014

Connect to SQL Server Using Oracle SQL Developer

Step 1. Get the JDBC driver for MS SQL : If you don't already have one, download a JDBC driver for MS-SQL. I use the jTDS driver, which is open-source Java. It doesn't matter where you place it, but remember where.

First you need to get the right driver. You can find it here: http://sourceforge.net/projects/jtds/files/jtds/1.2.5/jtds-1.2.5-dist.zip/download
NOTE: For SQL Developer 4.0EA3 and SQL Developer Data Modeler 4.0 (production) you now need jtds-1.3.1. Get it here: http://sourceforge.net/projects/jtds/files/

Step 2. Load the JDBC driver : As explained in Oracle's tutorial, under Preferences, scroll down to Database and Third Party JDBC Drivers. Once you load the jtds-1.2 jar file you should see both SQL Server and it's aging uncle Sybase added to your list of options when creating a new database connection (You get Oracle and Access by default).

Step 3. Set up your new database connection : Now you can create a new MS SQL database connection the same you would an Oracle connection. The only difference is that you need to select the SQLServer tab instead of Oracle. If you don't see that tab, then something went wrong - either you got the wrong jar file or it didn't load correctly.