Command line

From Bytesized Wiki

(Difference between revisions)
Jump to: navigation, search
(Creating a torrent)
 
(5 intermediate revisions not shown)
Line 30: Line 30:
Click yes.
Click yes.
Next, type your username at login: and password at password: and you`re in. (where password is your application password from your dashboard)
Next, type your username at login: and password at password: and you`re in. (where password is your application password from your dashboard)
 +
You will '''NOT''' see your password.
==Space Check==
==Space Check==
Best way of checking your disk usage is checking your dashboard. However, if you believe that disk usage is not shown correctly, [SSH] to your slice or open up your [ VNC] start lxterminal and type:
Best way of checking your disk usage is checking your dashboard. However, if you believe that disk usage is not shown correctly, [SSH] to your slice or open up your [ VNC] start lxterminal and type:
 +
 +
quota
 +
 +
Or if you want to calculate the space by counting all the files as it were, this will take longer, use the following
   
   
  du ~/ -s --si
  du ~/ -s --si
Line 55: Line 60:
*Important! The command needs to be all in one line, and quotes must be used around the folder name if it contains spaces.
*Important! The command needs to be all in one line, and quotes must be used around the folder name if it contains spaces.
-
*For example, if I wanted to make a torrent for What.cd from the data in the "VA – Summer Trance 2009" directory I already have on my server at ~/torrents/completed/VA - Summer Trance 2009, you would navigate to the parent directory to make your torrent. Type to change navigate to it:
+
*For example, if I wanted to make a torrent for What.cd from the data in the "VA – Summer Trance 2009" directory I already have on my server at ~/torrents/completed/VA - Summer Trance 2009, you would navigate to the parent directory to make your torrent. Type to navigate to it:
  cd ~/torrents/completed
  cd ~/torrents/completed

Current revision as of 22:05, 26 November 2010

Some of the most common commands are shown on the page below

Contents

SSH access

To ssh in to your slice you need terminal or terminal emulator.

Linux

Open up your terminal and type:

ssh [email protected]

(with servername being your actual server name). You will get screen similar to this

ssh.png

Type yes, then type your password and voila you are connected to your slice via secure shell (ssh).

Windows

  • Download putty.
  • When you start it, you should get window like this:

puttydesktop.png

In Hostname box type:

servername.bytesized-hosting.com

(with servername being your actual server name)

puttys.png

Click open, you should get windows like this:

puttyq.png

Click yes. Next, type your username at login: and password at password: and you`re in. (where password is your application password from your dashboard) You will NOT see your password.

Space Check

Best way of checking your disk usage is checking your dashboard. However, if you believe that disk usage is not shown correctly, [SSH] to your slice or open up your [ VNC] start lxterminal and type:

quota

Or if you want to calculate the space by counting all the files as it were, this will take longer, use the following

du ~/ -s --si

-s is for summarize, instead of each folder size listed separately —si is for use powers of 1000, not 1024

  • You can create an alias for the above command (or any command) in your .bash_aliases file, which is located in your ~ (home) directory. Just edit the .bash_aliases file, and add this line to it:
alias space='du ~/ -s --si'

You can name it whatever you want – I happen to call it space, because it’s easy for me to remember.

Creating a torrent

  • To make a .torrent file using command line, execute this command:
mktorrent -v -p -a http://tracker.url -o filename.torrent folder_name

-v is for verbose -p is for private, as in not DTH or PeerExchange -a is for tracker url follows -o is for output file name follows

  • Important! The command needs to be all in one line, and quotes must be used around the folder name if it contains spaces.
  • For example, if I wanted to make a torrent for What.cd from the data in the "VA – Summer Trance 2009" directory I already have on my server at ~/torrents/completed/VA - Summer Trance 2009, you would navigate to the parent directory to make your torrent. Type to navigate to it:
cd ~/torrents/completed

Then type the following command:

mktorrent -v -p -a http://tracker.what.cd:34000/xxxXXXxxx/announce -o VA-Summer_Trance_2009.torrent "VA - Summer Trance 2009"

Please note that you must use quotes if the target dir name contains spaces.

Remove a folder

  • To remove a whole folder, with files still in it, execute this command:
rm -rf foldername/

-r is for recursive -f is for force removal If the folder name has a space in it, use quotes around the folder name:

rm -rf "some folder name"

Find files

  • To find specific files by name in your home folder, use this command:
find ~ -name [name_of_file]

~ stands for your home folder; same as $HOME or /home/hd/username

  • For example:
find ~ -name bluray

will find all files with the word bluray in the name. You can use wildcards like * to search a partial name, like blu*

  • To find files by extension, use this command:
find ~ -name "*.[given_extension]"
  • For example:
find ~ -name "*.jpg"

will show you all files, with the .jpg extension.

Find IP Address of your seedbox

  • To find the IP address for your server, use this command:
hostname -i

-i is for IP addresses for the host name

Extracting files on your slice

  • To extract files from a rar archive on the server, use this command:
unrar e SomeMovieChunkFile.rar

-e is for Extract files to current directory

  • To list files inside rar archive without extracting them:
unrar l file.rar

-l is for list (not a number ‘one’)

  • To extract files with full path, type this command:
unrar x file.rar
  • To test integrity of archive file, type this command:
unrar t file.rar

-t is for testing integrity of archive

Stream video from your box

  • Using putty or terminal at your home computer type:
ssh  username:[email protected] cat /path/to/video/file/videofile.mkv | mplayer -cache 32768 -


Flushing DNS cache

  • In terminal, type:
service nscd restart

This command will restart nscd and effectively flush the DNS cache of your box, useful for when trackers move IPs and your client keeps trying to reach the old IP. This will allow your box to get the new DNS entry for your trackers, after you run this command, update tracker on your stalled torrents and it they should run as usual.

Personal tools