Find us on facebook

Showing posts with label Putty. Show all posts
Showing posts with label Putty. Show all posts

May 29, 2015

Backups directory - Plesk 12/11

Plesk 12
# Backups directory
/var/lib/psa/dumps

Exit from vim

In vim there are 3 different modes:

Insert - allows typing and editing as normal
Visual - used for selecting copy/paste etc.
Normal - used for commands
To get back to Normal mode, you can always press esc.

Once at Normal mode Press : to begin your command (you'll see it appear in the bottom left). The following commands are related to quiting vim:

:q - quit if no changes were made
:q! - quit and destroy any changes made
:wq - write changes (save) and quit
:x - similar to :wq, only write the file if changes were made, then quit

Create App with node.js


After installed Node.js, "npm" command will be available, this is short for the Node Package Manager, this allows to keep track of any dependencies that the app uses. To allow to easily setup a lightweight web application, install Express using the "npm" command. 

npm install express --save

This command will instruct NPM to install express onto the machine and also save a reference to it into a file called package.json. package.json should include all the dependencies required to run the app wherever it may be, on whatever machine using the npm install command. Another package require is "ejs", a templating engine that will help to bring together HTML and Node.js.

npm install ejs --save



Install node.js on CentOS 6

Update software repository to the latest versions:
yum -y update

Install "Development Tools". It's a group of tools for compiling software from sources.
yum -y groupinstall "Development Tools"



Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src

pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz



Uncompress the source files and move into that directory.
tar zxf node-v0.12.4.tar.gz
cd node-v0.12.4

Prepare compiler commands, by executing the configure script:
./configure


It will read the properties of the system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, Now ready to actually compile the source now. To do that, just type:
make


To make this available system-wide:
make install



Display file contents in putty

displays only last 50 lines of file
tail -n 50 filename

shortcut/command to exit/close the file when viewing in putty
Ctrl+C

Delete Files/Folders

To delete all files/folders in the current directory, without deleting the directory itself
rm -rf *

To delete a whole folder and its content recursively
rm -rf foldername/

To remove all files starting with ‘myFile’ and ending in ‘.txt’
rm myFile*.txt

To remove files
rm myFile.txt myFile1.txt myFile2.txt …etc…

filemng failed: filemng: opendir failed: Permission denied System error 13: Permission denied in plesk 12

Use following command with superuser privileges

/usr/local/psa/bin/repair --restore-vhosts-permissions


After running this command, FTP access also available.

Feb 25, 2015

SHELL commands for Putty Basic

Zip a folder and it's contents
zip -r folder.zip foldername

Unzip a folder
unzip foldername

Recursive permission for folder and it's contents
chmod -R 777 foldername 

Recursive permission for folder  contents
chmod -R 777 * 

Making a tunnel and transfer files

List contents in current folder
li

Moving folder to another folder
mv foldername foldername2