Posts

Showing posts with the label Linux

Convert Putty ppk key to SSH key

You cant use a putty ppk to ssh to a remote server from you linux machine. In that case you may need to first convert ppk to ssh file. For that first you need to install putty on your machine. $ sudo apt-get install putty Then goto the directory and run the  following command to convert ppk to ssh file. $ puttygen key.ppk -O private-openssh -o key.ssh Here, I assume, kep.ppk is you ppk file and key.ssh will be newly created ssh file. After this you can ssh to your remote machine/server using following command. $ ssh user@myserver.com -i key.ssh

Not Found - phpmyadmin

I installed phpmyadmin with apache on Linux but I was seeing this at localhost/phpmyadmin Not Found The requested URL /phpmyadmin/ was not found on this server. Apache/2.2.17 (Ubuntu) Server at localhost Port 80 To fix this I had to make changes to apache.conf sudo vim /etc/apache2/apache2.conf and added the following line at the end... Include /etc/phpmyadmin/apache.conf then restart the apache.. sudo service apache2 restart  

Installing NetBeans - Linux

Before installing NetBeans you need to install JDK software. You can install the JDK software and NetBeans IDE in directories of your choice. Note: This installer does not displace the system version of the Java platform that is supplied by the operating system. You can run the following command to install JDK. sudo apt-get install openjdk-7-jdk Go to the NetBeans download page and download the PHP package. Save the file on the desktop. Now open terminal and run the following command. sudo sh netbeans-7.4-php-linux.sh After unpacking, you will find with the first step of the installation wizard. Go through the installation wizard. After that you will find net beans at Dash home or Applications. Now if you need to configure Netbeans for Drupal, see this .

How To Install and Utilize VirtualMin on a VPS

https://www.digitalocean.com/community/articles/how-to-install-and-utilize-virtualmin-on-a-vps

Some Useful Drush Commands

Downloading modules:  $ drush dl module_name It will automaticly download extracted module to modules folder in your project. Enabling modules: $ drush en module_name Disabling modules: $ drush pm-disable module_name Unistalling modules: $ drush pm-uninstall module_name Clear Cache:  You can use the following command to clear all cache of your site. $ drush cc all List modules: $ drush pm-list --type=module And if you want to list only non core modules, you can use $ drush pm-list --type=module --no-core --pipe SQL dump: $ drush sql-dump > filename.sql It will automatically take the dump of the database of the project in which you are. status (st) Check the Status: Provides a birds-eye view of the current Drupal installation, if any. $ drush status Check the Recent Watchdog:  To list the recent watch dog status, us the following. $ drush ws ws referes to Watchdog show. Database connection detail: Provides a bi...

Installing Drupal - On Lamp

Here we will see how to install Drupal on a LAMP environment. We can do it using two ways, one is downloading it manulay and other is install it using DRUSH.(We will see how to install drush in next sections.) Downloading and Extracting Drupal  You can download latest Drupal by going to https://drupal.org/project/drupal are by using any utility. Here we will be using wget in shell. wget http://ftp.drupal.org/files/projects/drupal-x.x.tar.gz You can replace x.x with the version you want to download. For example.. wget http://ftp.drupal.org/files/projects/drupal-7.22.tar.gz Now time to exteact the file you just downloaded. tar -zxvf drupal-7.22.tar.gz After extracting you can move files in drupal-7.22.tar.gz directory one level "up" into the web server's document root or your public HTML directory. mv drupal-7.22/* /var/www/local.mysite.com/docroot NOTE: In your web server's configuration file the base URL for your Drupal installation wil...

Downgrading PHP 5.4 to 5.3 on Ubuntu

Download the shell script from here Once you have php5_4_downgrade_5.3.sh file you need to change the permissions using the following command su root chmod u+x ./php5_4_downgrade_5.3.sh Now you can run the script using the following command sudo sh php5_4_downgrade_5.3.sh Follow the on instructions

Install urdu fonts in Linux (Ubuntu)

1- NafeesWeb.ttf (For urdupoint.com etc) Go to  http://www.crulp.org/software/localization/Fonts/nafeesWebNaskh.html Download the file with title ‘ Font with MS VOLT project source ‘. Unzip it. 2- asunaskh.ttf (For bbcurdu.com etc) Download from http://www.quran.or.kr/urdu/font/asunaskh.ttf 1- Go to your home directory like /home/[name]. You can use nautilus for this. Click on Places -> Computer and then navigate to your home directory . 2- Now click on ‘ View ‘ in the menu and click ‘ Show hidden files ‘. Or you can use Ctrl+h . 3- Search for folder .fonts . Just create it if it is not there, right click and create a directory with name without quotes ‘ .fonts ‘. 4- Now copy the fonts from the downloaded directory and paste it in .fonts directory. 5- Open terminal and type sudo fc-cache -vf Enter your password if asked 6- Thats it, restart the browsers and check the websites.

Linux - SVN Updating, Commiting file

Goto directory you want to update the file of... cd path/tot/direcoty Best is to get status for the current diroctory from svn server first.. svn status it will list you if there is any update made in the directory to any file if you find any update, you may need to impliment that to your machine first $ svn update A newdir/toggle.c A newdir/disclose.c A newdir/launch.c D newdir/README Updated to revision 32. For aabriviation... A Added D Deleted U Updated C Conflict G Merged if you find a conflict you may find following.. $ svn update Conflict discovered in 'template.php'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: p C template.php Updated to revision 4880. Summary of conflicts: Text conflicts: 1 There is one text conflict.. you can open it in netbeans to see diff. Next you can update svn server for the file you made changes on.. svn comm...

Maximum execution time of 60 seconds exceeded in common.inc - Drupal + Linux

When you are working on Drupal in your local installation some times you get :Fatal error: Maximum execution time of 30/60 seconds exceeded on your browser. I also got that issue and what I did, I added this code block in my settings.php. 1) open your settings.php (sites / all / default/settings.php) 2) add this code for PHP settings: line number between 147 - 168 ini_set('max_execution_time', 0);

Find all the large files on linux server - Linux

To list the files larger than 20MB use the following command in your terminal find / -name "*.gz" -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' The output will be something like this.... /home/fileName.sql.gz: 160M /var/www/fileName.tar.gz: 82M /var/www/Directory/Path/FileName.tar.gz: 82M ... .. . This will find all the gz files. To find the files of all the type, use "*" only. find / -name "*" -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'

Copying files Updated in last 21 days - Linux

Following command will copy the files, updated in last 21 days from "source" to "destination" $ pwd source $ find . -mtime -21 -type f -exec cp {} /var/www/somwhere../destination \;

How to fix Apache – “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on UbuntuHow to fix Apache – “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Ubuntu

You may be facing the same following error while you were restarting/reloadig the Apache server on Ubuntu. tanvir@tanvir-laptop:~$ sudo /etc/init.d/apache2 reload  * Reloading web server config apache2  apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName To fix that problem, you need to edit the httpd.conf file. Open the terminal and type, sudo gedit /etc/apache2/httpd.conf By default httpd.conf file will be blank. Now, simply add the following line to the file. ServerName localhost Save the file and exit from gEdit. Finally restart the server. sudo /etc/init.d/apache2 restart

Using rsync to make a backup - Linux

Suppose you have a directory called source, and you want to back it up into the directory destination. To accomplish that, you'd use: rsync -a source/ destination/ This command is equivalent to: cp -a source/. destination/ except that it's much more efficient if there are only a few differences. Just to whet your appetite, here's a way to do the same thing as in the example above, but with destination on a remote machine, over a secure shell: rsync -v -e ssh source/ username@remotemachine.com:/path/to/destination/ Note: -v, --verbose     Display the names of files transferred and statistics related to the transfer. -e shell     Use shell (which can be a complete command with arguments, enclosed in quotes) to create the connection between two systems for file transfer.

How to install FileZilla FTP Software in Ubuntu

Being a web developer, we use to upload files to server using FTP's. Currently m using Ubuntu, I am using FilZilla here to upload my files.. Gotot your terminal and type the following command.. sudo aptitude install filezilla It asks you for password. Enter your password. Very easy right! Cheers. Find it on Applications > internet > FileZilla

PHP Eclipse syntax color change

I am using Eclipse IDE for PHP Developers Version: Helios Release and my path is as follows, Windows > Preferences > PHP > Editor > Syntax Coloring > Variable

Installing Eclipse on Ubuntu - Linux

To install it manually by downloading the Eclipse files from http://www.eclipse.org/downloads/ . You will need to install JRE or JDK first before you can run Eclipse. You can do this by typing this in the terminal. sudo apt-get install sun-java6-jre Extract the Eclipse files to the /opt directory so that other users can have access to it. tar xzf eclipse-SDK-3.5.2-linux-gtk.tar.gz sudo mv eclipse /opt/eclipse Then create an eclipse executable in your path. sudo touch /usr/bin/eclipse sudo chmod 755 /usr/bin/eclipse sudo gedit /usr/bin/eclipse Then type in the followings and save. #!/bin/sh #export MOZILLA_FIVE_HOME=”/usr/lib/mozilla/” export ECLIPSE_HOME=”/opt/eclipse” $ECLIPSE_HOME/eclipse $* Then create a gnome menu item. sudo gedit /usr/share/applications/eclipse.desktop Enter the following and save. [Desktop Entry] Encoding=UTF-8 Name=Eclipse Comment=Eclipse IDE Exec=eclipse Icon=/opt/eclipse/icon.xpm Terminal=false Type=Application Categories=GNOME;A...

How to install Skype on Ubuntu

This will show you how to install a Skype client in Ubuntu & Debian base operating system. 1. First of all you need to start up Synaptic Package manager. Go to System->Synaptic Administration->Synaptic Package Manager, 2. From Synaptic, go to Settings->Repositories. Click on Third Party Software Tab. Click Add, and put on this line : deb http://download.skype.com/linux/repos/debian/ stable non-free Click Add Sources. 3 Click Close, and Click 'Reload' at the top of Synaptic. Now you can search for Skype, and install it from Synaptic.

Configure mod_rewrite in Apache2 on Ubuntu

To configure mod_rewite in ubuntu apache system Goto your terminal and type sudo a2enmod rewrite Then open 000-default from /etc/apache2/sites-enabled in your favourite text editor gedit /etc/apache2/sites-enabled/000-default go and find AllowOverride none replace 'none' with All, like AllowOverride All and restart your apache /etc/initd/apache2 restart thats all

How to find Wine's Directory on Ubuntu - Linux

WINE directory is at ~/.wine the 'fake c:' is at ~/.wine/drive_c