Sunday, December 20, 2015

IT (2): System administration information, programming system, software installation, cluster job...

Software are kept in repositories and distributed in packages.
Package management involves installing and updating software.
#Installing software that come bundled up with the OS system
preference--->synaptic package manager------->search----->bioperl----->mark for installation
------------------------------
Operating Systems: Android, iOS, OS X, Windows,Linux
Web page writing languages: C++, Javascript, C, CSS, XUL, XBL 
Top web browsers: Google Chrome, Firefox, Opera, Chromium, Midori
Linux distributions: Debian (.deb), Ubuntu (.deb), Red Hat, Fedora (.rpm), Gentoo, OpenSuse, Mint, Ubuntu, CentOS (.rpm), Arch, Elementary, Manjaro, Mageia
Linux Desktop Environments: Gnome, Kde, xfce
User applications: Apache, MySQL, FTP
System performance log management: Graylog2, Logcheck, Logwatch
Command line text editor: vi/vim, nano, pico, emacs
Web server: Apache, Nginx or Lighttpd
Steps of programming: problem, algorithm, pseudocode, code
------------------------------
echo $SHELL
bash −−version
echo $BASH_VERSION
init-getty-login-bash-$user
Globbing is a form of wildcards


Linux can be of 2 major types based on packages.
Debian “.deb” e.g. Debian, Ubuntu
Red Hat “.rpm”e.g.  Fedora, CentOS
Commands to install, update and removal vary based on the package type.

Ubuntu------Applications---------Software Center------------Install rkward
#To check if  a package is installed in Ubuntu and Debian
aptitude show vim | grep -i state
dpkg -s vim | grep -i status
apt-cache policy vim | grep -i installed

For .deb (examples)
sudo apt-get install debian-goodies
apt-get utility is a powerful and free package management command line program, that is used to work with Ubuntu’s APT (Advanced Packaging Tool)
apt-cache command line tool is used for searching apt software package cache.
apt-cache pkgnames
#To find out package name and description
apt-cache search vsftpd
# To check Package Information
apt-cache show netcat

As with every upgrade, you will need to create a backup of your important files.


sudo apt-get install dpkg
apt-get update
apt-get install
apt-get remove
apt-get install screen

aptitude search package
aptitude safe-upgrade apache2
apt-get install lynx
sudo apt-get install vim 
For .rpm (examples)
yum update
yum search
yum erase
yum install screen

yum search all package
yum -y install lynx
yum -y install sysstat
yum install unrar
yum update httpd (for Apache)
yum update && yum install yum-utils
#To create a database, MySQL/MariaDB server must have been installed on the system.
If not, the code below can do it.
yum install mysql mysql-server
create database xyz;
-----------------------------------
Obtaining  to installing a software
#Source code download
wget url_name
wget http://nchc.dl.sourceforge.net/project/fsh/fsh.jar

#One file download
wget http://www.cyberciti.biz/here/lsst.tar.gz

#Multiple file download
wget http://www.cyberciti.biz/download/lsst.tar.gz ftp://ftp.freebsd.org/pub/sys.tar.gz ftp://ftp.redhat.com/pub/xyz-1rc-i386.rpm


URLS=”http://www.cyberciti.biz/download/lsst.tar.gz \
ftp://ftp.freebsd.org/pub/sys.tar.gz \
ftp://ftp.redhat.com/pub/xyz-1rc-i386.rpm \
http://xyz.com/abc.iso"
for u in $URLS
do
 wget $u
done
#to download all files
wget -i /tmp/download.txt
#Decompress and extract the files
tar xvf zip_file
#Change into the directory and run configure 
./configure
#To compile source code
make
#To check if the built is good
make check
Install the software
sudo make install
Verify its installation
which software_name
**************************
#Install remark
cd /tmp
wget http://savannah.nongnu.org/download/regex-markup/regex-markup_0.10.0-1_amd64.deb

sudo dpkg -i regex-markup_0.10.0-1_amd64.deb
**************************
#Compile geany
cd geany-1.22/
./configure
make
#Install geany
sudo make install
#Start geany
geany
#Tools > Plugins Manager
#To search for plugin (apt-cache search geany-plugin)
sudo apt-get install geany-plugin-vc

**************************
#Compile and install it using source code
cd /tmp
wget http://savannah.nongnu.org/download/regex-markup/regex-markup-0.10.0.tar.gz
tar -xvf regex-markup-0.10.0.tar.gz
cd regex-markup-0.10.
 ./configure
make
sudo make install
stdin (keyboard)

stdout (screen)
-----------------------------------
#To find out the system’s OS type
uname -a
arch
file /sbin/init

#View currently installed kernel
uname -r

#Tells shell type
echo "$0"

#Tells full path for installed shell 
type -a bash

#To now whether operating system is 32-bit or 64-bit
dpkg --print-architecture
getconf LONG_BIT

#To identify user
hostname

#Default command line MySQL client
mysqladmin -u root -p version

#List active and inactive memory
vmstat -a

#To find disk usage of files and directories
#du (disk usage) Commands
du  path
du -h path
du -sh path

#df (disk filesystem) Commands
df
df -a
df -h
df -k #Dispaly in kilobyte
df -m #Dispaly in megabyte

#Killing of processes is essential part of System Administartion
pidof chrome
pidof firefox

#Using ID to kill a process
pidof gimp-2.8
kill 9378
pidof gimp-2.8

#Using signal number to kill a process
pidof banshee
kill -9 9647
pidof banshee

#To kill multiple processes
pidof gimp-2.8
pidof vlc
pidof banshee
kill -9 9734 9747 9762
-----------------------------------
To process jobs in queue through cluster
 -R (Running), -Q (Waiting), -S (Suspended), -E(exiting after being run),  -H(held)

pbs script
parameters: -j oe, -o output_file, -m abe, -M email_id,

#First login to node is needed
ssh compute-1 -1

#Submit  a job
qsub pbs_script
e.g. qsub cluster_job.sh
qsub job.sh

#To check status of job (flags: -n, -u, -f)
qstat job-id
e.g. qstat -f (status of all computers)
       qstat -j (job)
checkjob job-id

To delete or kill a job (flags: -f) (qsig is sending signal to  a job)
qdel job-id
qsig -sNULL job_id

To hold  ajob, then release it
qhold job-id
qrls job-id

To see job while its running
qpeek

To delete or kill all running or queued jobs
qselect -u $USER -S -R | xargs adel
qselect -u $USER -S -Q | xargs qdel
----------------------------------------------------
#Secure shell
ssh <user>@ <host>
ssh -x seema@rohan.sdsu.edu (connecting to the host rohan)
ssh -x peema@alborz.sdsu.edu (connecting to the host alborz)
~//ssh -x peema@alborz.sdsu.edu : /home/pseema/file

#Copy file from local to remote
scp ./Desktop/file pseema@alborz.sdsu.edu
-----------------------------------
#PATH
# Set path
e.g.
export PATH=$PATH:/usr/local/bin:/home/pseema/bin

e.g.
export JAVA_HOME=/usr/local/jdk1.7.0_71
export PATH=PATH:$JAVA_HOME/bin

export HADOOP_HOME=/usr/local/hadoop
export YARN_HOME=$HADOOP_HOME
-----------------------------------
#Check software version
java -version
javac -version
scala -version
hadoop version
-----------------------------------
#Handling .jar file
hadoop jar .jar
-----------------------------------
make 
#The ‘make‘ command uses the ‘makefile‘ database . Its used to compile
make
sudo make install
----------------------------------
#Use of virtual box (this mount helps use other OS in a system)
Create  a virtual hard drive
VDI (Virtual disk image)
fixed size
start
browse
ubuntu
start
--------------------------------------
#Copy a folder to user home
cp -r path_to_dir .

cd dir
RANDOM...
init: Short for initialization is the first daemon process that starts during booting and runs till shut down.
22 is the default SSH port
Web and cloud developers 
Gui opposite is console-based
GNU Make is a development utility
Get – which downloads one or more files from a remote machine.
Put – which uploads one or more files to a remote machine.
 col =1 or "white" or "#FFFFFF"
termlet: terminal software

An Apple disk image file's name usually has ".dmg" as its extension.

No comments:

Post a Comment