Friday, July 26, 2013

HowTo Enable or disable modules in Apache

You can enable or disable any apache module using a2enmod and a2dismod. You don’t need to edit the conf file for that unless you are having some problem with this method. The syntax of these commands is really simple:
To enable a module:
sudo a2enmod module_name
To disable a module:
sudo a2dismod module_name

For instance, to enable mod_expires, execute sudo a2enmod expires in the terminal. If you see the following output, you can be sure that it has been enabled.
dpac@dpac-laptop:~$ sudo a2enmod expires
Enabling module expires.
Run '/etc/init.d/apache2 restart' to activate new configuration!
To disable mod_expires:
sudo a2dismod expires
Restart the server after enabling the module.
sudo service apache2 restart
Or
sudo /etc/init.d/apache2 restart
PS: On linux systems, you can use auto-complete feature by pressing tab with a2enmod and a2dismod. It will show list of mods installed on your system.

Monday, July 8, 2013

How to trouble shoot Joomla CMS:

Somtime when you transfer your joomla website from one to another host joomla website stop responding and sometime show blank index and admin pages. This may be to conflicting somting,

So how we can check exactly which plugin or component or module is causing the problem?

Here is a Quick Method:

1..Install new joomla
2..on this new joomla installation Install as much component and plugins and module you

have that was in previous faulty CMS. (specially install K2).
3..upload your backup files into "Backup" folder.
4..Import your backup database into mysql.
5..take backup of all new joomla installation files and folder into "joomla" folder.
6..edit joomla configuration file and connect with your backup database.
7..copy template folder from "Backup" folder.
8..refresh the home page.
9..now copy one by one subfolders of plugin, Component, modules from "Backup".
and refresh the home page each time you copy the folder to see the effect.

when you see page blank or any error after copying any folder, revert it back from

"joomla" folder and note down the module or plugin folder name which is causing problem.

10..when you found the exact plugin or modules you can just disable from joomla admin panel.

The Best thing of this method, you can login from admin panel and you will see all option where you can disable SEF URL (which usualy caused problem) and all module, component  and plugins.

Sunday, July 7, 2013

How to Disable GUI Boot in Ubuntu 12.04

Following the steps I followed to enable console boot in Ubuntu 12.04
Step 1 First update your repository by running
sudo apt-get update
Step 2 There is some bug in old version of lightdm, so we need to upgrade the same. To do so run,
sudo apt-get install lightdm
Step 3 Now we have to modify grub config.
Step 3a Open /etc/default/grub with your faviourite editor and change
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to
GRUB_CMDLINE_LINUX_DEFAULT="text"
Step 3b Also comment GRUB_HIDDEN_TIMEOUT=0 This line is for unhiding the GRUB menu

Step 4 Now we will upgrade GRUB configuration
sudo update-grub
Step 5 Now restart your machine. Voilla you will be in console mode
At any time you need after booting your system you want to change to gui mode the run
startx
If you want to restore Ubuntu’s GUI mode then

Open /etc/default/grub with your faviourite editor and change
GRUB_CMDLINE_LINUX_DEFAULT="text"
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Update GRUB by running
sudo update-grub
That’s it

How to Make Your Own Light Box

What is a light box? It's a photo studio in miniature. Shooting photos in the lightbox keeps the focus completely on the items you want to depict; there are no distractions in the background (which is white, or whatever color you choose to make it) and lighting from three sides eliminates any shadows. Click on the photos below to see the steps.






By lighting through the paper, the light is diffused and prevents stark reflections and shadows.
Two more tips:
  • If you can, use lamps/light bulbs that imitate natural light. Otherwise, your background will appear slightly yellow, like in the picture below with the apple.
  • Always take the photos without flash

Tuesday, July 2, 2013

Image to Vector in Photoshop

Learn how to create vector photo effect out of any image, clipart, graphics. You can obtain vector ink photo effects in just a few simple steps. I am planning to automate these steps into a Photoshop action that you can easily use and customize. In the meantime you can use Photoshop adjustments and filters like Photocopy and Threshold to create this vector effect.
In this tutorial I am going to show you a simple way to create a image to vector effect using any photo/image/graphics/etc. In the next tutorial I am going to show you how simple it is to turn from photo to vector shape in Photoshop. So let's start with this girl stock image; you can use any image you want but if you want to create vector silhouetts the best are the photos with white/black background. Or better still you can use cutout images.
Duplicate this layer and call the layers Girl 1 Layer and Girl 2 Layer. You can also keep a copy of the original layer. Go to Image>Adjustments and use the Threshold adjustment for the Girl 1 Layer. Set the level depending on your photo size, details, etc.
Set the foreground color black and the background color white. Go to Filter>Sketch and use the Photocopy filter for the Girl 2 Layer.
Set the blend mode of the Girl 2 Layer to Multiply and merge the two layers.
Use again the Threshold adjustment for the new created layer.
For a smooth edge result you can go to Filter>Stylize and choose Diffuse
This is how you can convert image to vector effect. You can now use the Paint Brush, color black to close the gaps and to use the Paint Bucket Tool if you want to add color. I have also added a vector sunburst using these free sunburst brushes to create a vector comics background. A similar technique I have used in one of my oldest tutorials on how to create a comic book effect in Photoshop

Tuesday, June 18, 2013

How to Set Up SSH Keys

About SSH Keys


SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone. Generating a key pair provides you with two long string of characters: a public and a private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. You can increase security even more by protecting the private key with a passphrase.

Step One—Create the RSA Key Pair


The first step is to create the key pair on the client machine (there is a good chance that this will just be your computer):
ssh-keygen -t rsa

Step Two—Store the Keys and Passphrase


Once you have entered the Gen Key command, you will get a few more questions:
Enter file in which to save the key (/demo/.ssh/id_rsa):

You can press enter here, saving the file to the user home (in this case, my example user is called demo).
Enter passphrase (empty for no passphrase):

It's up to you whether you want to use a passphrase.

Entering a passphrase does have its benefits: the security of a key, no matter how encrypted, still depends on the fact that it is not visible to anyone else. Should a passphrase-protected private key fall into an unauthorized users possession, they will be unable to log in to its associated accounts until they figure out the passphrase, buying the hacked user some extra time. The only downside, of course, to having a passphrase, is then having to type it in each time you use the Key Pair.

The entire key generation process looks like this:
ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/demo/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /demo/.ssh/id_rsa.
Your public key has been saved in /demo/.ssh/id_rsa.pub.
The key fingerprint is:
4a:dd:0a:c6:35:4e:3f:ed:27:38:8c:74:44:4d:93:67 demo@a
The key's randomart image is:
+--[ RSA 2048]----+
|          .oo.   |
|         .  o.E  |
|        + .  o   |
|     . = = .     |
|      = S = .    |
|     o + = +     |
|      . o + o .  |
|           . o   |
|                 |
+-----------------+

The public key is now located in /demo/.ssh/id_rsa.pub

The private key (identification) is now located in /demo/.ssh/id_rsa

Step Three—Copy the Public Key


Once the key pair is generated, it's time to place the public key on the virtual server that we want to use.

You can copy the public key into the new machine's authorized_keys file with the ssh-copy-id command. Make sure to replace the example username and IP address below.
ssh-copy-id user@123.45.56.78

Alternatively, you can paste in the keys using SSH:
cat .ssh/id_rsa.pub | ssh user@123.45.56.78 "cat >> ~/.ssh/authorized_keys"

No matter which command you chose, you should see something like:
The authenticity of host '12.34.56.78 (12.34.56.78)' can't be established.
RSA key fingerprint is b1:2d:33:67:ce:35:4d:5f:f3:a8:cd:c0:c4:48:86:12.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '12.34.56.78' (RSA) to the list of known hosts.
user@12.34.56.78's password: 
Now try logging into the machine, with "ssh 'user@12.34.56.78'", and check in:

  ~/.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

Now you can go ahead and log into user@12.34.56.78 and you will not be prompted for a password. However, if you set a passphrase, you will be asked to enter the passphrase at that time (and whenever else you log in in the future).

Optional Step Four—Disable the Password for Root Login

Once you have copied your SSH keys unto your server and ensured that you can log in with the SSH keys alone, you can go ahead and restrict the root login to only be permitted via SSH keys.

In order to do this, open up the SSH config file:
sudo nano /etc/ssh/sshd_config

Within that file, find the line that includes PermitRootLogin and modify it to ensure that users can only connect with their SSH key:
PermitRootLogin without-password

Put the changes into effect:
reload ssh
 
 
Source: 
https://www.digitalocean.com/community/articles/how-to-set-up-ssh-keys--2 

Sunday, June 16, 2013

Copying a Joomla website

This tutorial is for Joomla! CMS Version(s) Joomla 2.5 Joomla 3.x

Copying a Joomla! website is a two-part process: you must copy the files and you must copy the database (which is where the content is stored). Copying the files and copying the database are separate operations. Which you carry out first will depend on your particular circumstances but in most cases it does not really matter. If your website is being updated frequently and you need to take your website offline while the copy takes place then you will probably want to perform the database copy last so as to minimize downtime.

Copying a website (common method)

Copying the files with FTP

One method of copying the files from one Joomla! installation to another is to use standard desktop FTP software to first download all of the files comprising your Web site from their location on your Web server, then upload these files to the location of the new Joomla! installation. Depending on where you're placing the copy of your Joomla! site, the new location could be a different directory on the same Web server, or it could be a new location on a completely different Web server.
It is important to maintain the same directory structure for all of your folders and files as you move them from one location to another. Fortunately, desktop FTP software will handle this automatically as you upload and download sets of files and folders. (Your FTP software should contain Help documentation which explains FTP and how to use the FTP software interface.)
Note that after you move the files from one location to another, you may still need to edit Joomla! configuration files to get your copy of Joomla! working at the new location; you may also need to change settings for aspects of your Web server to get the copy of your Joomla! site working.
In rare instances, a file may become corrupted during an FTP transfer, where only part of the file is successfully transmitted. If you encounter strange or unexpected errors with your new Joomla! installation after you copy over the files, you may want to try re-uploading your files in case of corruption during transfer.

Download files from server to your computer

  1. Use FTP software (e.g. FileZilla) to connect to the server
  2. Select the directory you want to download (mostly /public_html/ or /htdocs/)
  3. Right click + select files/folder to download, or drag + drop the folder from the "Remote site" view to the "Local site" view
  4. The downloading of the remote files will start
  5. After you've downloaded the files, check the "Failed transfers" to see if there weren't any errors

Upload files from your computer to a server

  1. Make sure that configuration.php has the right settings for the server (especially: localhost, database, database user, database password, log_path, tmp_path)
  2. Use FTP software (e.g. FileZilla) to connect to the server
  3. Select the directory you want to upload, and to where (mostly to /public_html/ or /htdocs/)
  4. Right click + select files/folder to upload, or drag + drop the folder from the "Local site" view to the "Remote site" view
  5. The uploading of the local files to the remote server will start
  6. After you've uploaded the files, check the "Failed transfers" to see if there weren't any errors


Copying the database with phpMyAdmin

The phpMyAdmin tool can be used to export and import a database, providing a simple way to duplicate a copy of a database using a different name on our servers.

Exporting a copy of the database to your computer

  1. Login to the database that you want to duplicate using phpMyAdmin
  2. Click the database name on the left-hand side of the page.
  3. Select the Export tab
  4. Select the Save as file option
  5. Click Go
You'll then be prompted to save the database file on your personal computer.

Importing the copy into a new database

You'll first need to create the new, empty database on your server using the account control panel. It needs to be UTF8 (utf8_generic_ci). After the new database has been created:
  1. Login to the new database using phpMyAdmin
  2. Click the database name on the left-hand side of the page
  3. Select the Import tab
  4. Click the Browse button under "File to import", then select the database file from your computer
  5. Click Go to import the database
Hint: If you see a "No database selected" error, it's probably because you forgot to first click on the database name in the left-hand column.

Changing configuration.php

In order to get Joomla to work on the new server, you should make the necessary changes in configuration.php to reflect the new server settings. You should check/edit the following to
        var $host = 'localhost'; // usually "localhost". If it's different for your server then your hosting provider should be able to tell you that.
        var $user = 'the_db_username';
        var $db = 'the_databasename';
        var $password = 'the_db_password';
        var $live_site = ''; // is usually empty.
Joomla will work, even if $log_path and $tmp_path are wrong, though you won't be able to install extensions. Login into the back-end of your new Joomla site.
In Joomla 1.5 goto: Help > System Info > Directory Permissions. Look at the bottom 4 rows:
Cache Directory /var/www/example.com/cache/ Writable
Cache Directory /var/www/example.com/administrator/cache/ Writable
Log Directory ($log_path) /var/www/some/other/folder/example.com/logs/ Unwritable
Temp Directory ($tmp_path) /var/www/some/other/folder/example.com/ Unwritable
If the $log_path and $tmp_path are "Unwritable", you'll need to change the values in configuration.php.
Use the values of the "Cache Directory" without the "/cache/" part and change $log_path and $tmp_path to
   var $log_path = '/var/www/example.com/logs';
   var $tmp_path = '/var/www/example.com/tmp';
If the Directory Permissions show that $log_path and $tmp_path are "Writable", then you should be able to install extensions.

Copying a website using SSH command line (method for experienced users)

Copying the files using a compressed archive file method

Copying a large number of individual files using FTP can sometimes be unreliable. If you have command-line access to the both source and destination systems then you can create a compressed archive file containing all the files on the source system, then transfer that single file to the destination system where it can be decompressed.

Creating an archive file

On Unix-style systems (eg. Linux) you can use the gzip program to create .zip files, or the tar program to create .tar.gz or .tar.bz2 files. For detailed instructions type man gzip or man tar at the command line. For example,
tar cvfz joomlabackup.tar.gz /path-to-joomla
will create a gzip-compressed archive file, called joomlabackup.tar.gz, containing all of the files in your Joomla! installation.
Important note! You need to make sure you are NOT in the folder you are trying to backup when you run the tar command or you will create an endless loop.

Extracting an archive file

Having copied the archive file to the destination system, you now need to unpack it. Use the equivalent command that you used to create the archive file. For example, to unpack the archive file created in the example above, enter
cd /path-to-joomla
tar xvfz joomlabackup.tar.gz
If the user or group IDs are not the same between the source and destination systems, then you will need to amend the ownership of the files you just extracted. For example, on an Apache system, you might need to enter the command
cd /path-to-joomla
chown -R www-group.www-user *
so that Apache has ownership of the Joomla! files.
Please ask your hosting provider for the correct group and user names, www-group and www-user, on your system.


Copying the database with MySQL command line method

Usually you run mysqldump to create a database copy:
$ mysqldump -u user -p db-name > db-name.out
Copy db-name.out file using sftp/ssh to remote MySQL server:
$ scp db-name.out user@remote.box.com:/backup
Restore database at remote server (login over ssh):
$ mysql -u user -p db-name < db-name.out


Special Notes

Tools

Akeeba

  • Akeeba Backup produces a .jpa file
  • The .jpa file contains all the folders/files and database files.
  • The .jpa file also contains an installer
  • Kickstart.php (from Akeeba) unpacks the .jpa file
  • You then run the installer and install your site like a Joomla install.
  • The installer changes the configuration for restoring to a different location and prompts for the new database details.
After you create the Database for your Joomla download and install Akeeba, it can be download from Joomla extension directory. There is a link to full instructions there as well.

GoDaddy.com Migrations

If using GoDaddy.com, different steps are required for import to be successful. In the Database section of the hosting control panel, find the database you wish to export and click the "edit details" icon (the little pencil). From there you will see a toolbar menu at the top with the option to Backup the database. Select that option and backup the SQL database to a _db_backups folder.
To import, go to the new hosting panel (if still using Go Daddy)and navigate to the new database you are importing to, following the same steps for export. This time, click on Restore in the menu and select the previously backed up database. After a few minutes, your database will be as good as before.


Source:
http://docs.joomla.org/Copying_a_Joomla_website