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
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

#One file download

#Multiple file download

URLS=” \ \ \"
for u in $URLS
 wget $u
#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 
#To compile source code
#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

sudo dpkg -i regex-markup_0.10.0-1_amd64.deb
#Compile geany
cd geany-1.22/
#Install geany
sudo make install
#Start 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
tar -xvf regex-markup-0.10.0.tar.gz
cd regex-markup-0.10.
sudo make install
stdin (keyboard)

stdout (screen)
#To find out the system’s OS type
uname -a
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

#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 -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

#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

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 (connecting to the host rohan)
ssh -x (connecting to the host alborz)
~//ssh -x : /home/pseema/file

#Copy file from local to remote
scp ./Desktop/file
# Set path
export PATH=$PATH:/usr/local/bin:/home/pseema/bin

export JAVA_HOME=/usr/local/jdk1.7.0_71

export HADOOP_HOME=/usr/local/hadoop
#Check software version
java -version
javac -version
scala -version
hadoop version
#Handling .jar file
hadoop jar .jar
#The ‘make‘ command uses the ‘makefile‘ database . Its used to compile
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
#Copy a folder to user home
cp -r path_to_dir .

cd dir
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