Posts

Showing posts with the label Linux

How to create zip and unzip in linux or ubuntu?

Zip and unzip in linux or ubuntu You only have to run this command to make a zip of a folder zip -r application.zip application Application is the folder name of the current folder. This command will create zip of that folder Now Unzip command It is very simple just run command for unzip unzip application.zip It will unzip the folder in current folder

gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error is not recoverable: exiting now Installation failed.

While Installing Meteor i am getting this Error on my linux server or ubuntu I tried to figure out to get rid of this problem but unable to success so finally i found a solution. I think you can be stuck in this problem. Mostly this problem occurs when you try to install the  Meteor on your ubuntu or linux server. When you run this command  curl https://install.meteor.com | sh It shows some process and showed you that given error below gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error is not recoverable: exiting now Installation failed. Now here is the answer that how can you solve this problem Open your terminal where you running this command Before run this command curl https://install.meteor.com | sh You need to run this command before above command echo tlsv1 > $HOME/.curlrc Now you can run this command to install Meteor   curl https://install.meteor.com | sh Hope problem is sloved.     If this works for you then please submit a

app/storage/meta/services.json: failed to open stream: Permission denied - Laravel 4

If you are getting this error on your laravel 4 installation so put the steps as i mention below Error is like this in laravel 4 ErrorException file_put_contents(/var/www/vhosts/folder/app/storage/meta/services.json): failed to open stream: Permission denied  That means permission is not granted to write for meta folder so you need to run these command on your server from your root folder Step 1: Come to your root folder var/www/vhosts/yousite_folder/ Step 2: Run this command first find app/storage -type d -exec chmod 777 {} \; Step 3: Run this command now find app/storage -type f -exec chmod 777 {} \; These command will chmod all directories and files in app/storage to 777.  Done!! Now you can refresh your page and working fine. If this post help you please submit a comment in post to inspire me :)

How to login MySql in CentOS Or Linux?

How to login MySql in CentOS Or Linux? Here i will show you that how can you use MySql on CentOS or Linux Os Open Your terminal and login with your root login now run this command to login in mysql mysql -u root -p It will ask you for password Enter password: Enter your password here which you have set for mysql It will show show you a successfull message OR insert mysql as selected tab mysql> Two points you must keep in your mind: 1) All MySQL commands end with a semicolon; if does not end with a semicolon, the command will not execute. 2) MySQL commands are usually written in uppercase and databases, tables, usernames, or text are in lowercase to make them easier to distinguish. MySQL command line is not case sensitive. To show all database: SHOW DATABASES; Use exit command to come out from the mysql> promt mysql> exit it will show msg bye

How to check php version in Linux?

How to check php version in Linux or centos simple copy and paste this command to check the php version in your linux window php -i | grep 'PHP Version' Output: PHP Version => 5.5.10

How to set a cron?

Set a cronjob file Please check the details Below  which represent that how can you set a cron job on time basis    .---------------- minute (0 - 59) | .------------- hour (0 - 23) | | .---------- day of month (1 - 31) | | | .------- month (1 - 12) OR jan,feb,mar,apr ... | | | | .---- day of week (0 - 6) (Sunday=0 or 7) | | | | | * * * * * command to be executed     Example 1: Set cron job run per minute * * * * * /usr/bin/php /var/www/vhosts/site/cron/mycron.php Example 2: Set cron job to run on a specific time every day 5:50am 50 5 * * * /usr/bin/php /var/www/vhosts/site/cron/mycron.php Example 3: Set cron job to run on a specific time every day 10:50pm 50 22 * * * /usr/bin/php /var/www/vhosts/site/cron/mycron.php Example 4: Set cron job to run on every sunday 1am 00 1 * * 0 /usr/bin/php /var/www/vhosts/site/cron/mycron.php   Example 5: Set cron job to run on every sunday 1am   00 1 * * Sun /usr/bin/php /var/www/vhosts/site/cron

How to print date in linux?

How to print date in linux Simply copy and paste this command in your linux console to print the date -  date '+%A %W %Y %X' Press enter output: Thursday 20 2014 12:29:38 PM You can check more command by write this command on your console date --help

How To install MongoDB in ubuntu?

How To install MongoDB in ubuntu   step1: Open the terminal login with root and copy the given code past in terminal apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 echo "deb http://downloads-distro. mongodb.org/repo/ubuntu- upstart dist 10gen" | tee -a /etc/apt/sources.list.d/10gen. list apt-get -y update apt-get -y install mongodb-10gen step2: $ sudo service mongodb start ******************** setup with php *************** step 1: sudo apt-get install php5-dev php5-cli php-pear step2 : sudo pecl install mongo step3: open php.ini "/etc/php5/apache2/php.ini" and set "extension=mongo.so" step4: service apache2 restart Now php with mongodb is ready for work.

Learn the Linux command line - Chapter 2

cat - type  cat Then type a few words on the keyboard and press the [Return] Or [Enter] key. Finally hold the [Ctrl] key down and press [d] (written as ^D for short) to end the input. Now what happend? If wiill copy your data to the next line cat > test.txt - To add new file and add the content into file Write that command press enter cat > test.txt enter your keyword like: apple, pear, banana press Ctrl+D and now read the file by cat test.txt If file is already created then it overwrite the file content cat >> test.txt - To Append the content into a existing file cat list1.txt list2.txt > biglist.txt -   This command will copy the text from both file and create new file with the name of biglist.txt and paste the content in this file We use the < symbol to redirect the input of a command. The command sort alphabetically or numerically sorts a list. Type % sort Then type in the names of some animals. Press [Return] after each one. dog

Learn the Linux command line - Chapter 1

Linux Command line tutorial - Chapter 1 ls - To listing the directory ls -a  - To listing the directory and dispaly the file which are normally Hidden ls directoryname - To dispaly the file inside a folder mkdir ­ - To create the directory example: mkdir sagar cd directory ­-   To enter inside the directory or change to named directory like: cd sagar cd - Change the home directory cd ~ - Direct come to home direcoty   cd .. - To go back into the last directory pwd - To display the full path from start to current directory Like: /home/ununtu/sagar/linux cp file1 file2 -  is the command which makes a copy of file1 in the current working directory and calls it file2. mv file1 file2 moves (or renames) file1 to file2  exmple: mv file.txt ../ to move the file in last folder rm filename.txt - To remove the file rmdir directoryname - To remove the directory clear - Clear command to use for remove clear the terminal screen