How to install adobe in linux

$ wget ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb

$ sudo dpkg --add-architecture i386

$ sudo apt-get update

$ sudo apt-get install libgtk2.0-0:i386 libxml2:i386 libstdc++6:i386

$ sudo dpkg -i AdbeRdr9*.deb

If the installation doesn’t fully complete, you might need to do

$ sudo apt-get -f install

Change dropbox password and re-sync

killall dropbox ~/.dropbox-dist/dropboxd

pdftk original.pdf cat A1-10 A15 A17 output out.pdf

Reset matlab start up path

restoredefaultpath; matlabrc

Linux client

apt-get install x2goclient

In server side, just google how to install the x2go

As a root, ifconfig -a to find out the MAC address

How to find a file type in debian

find . -type f -name "*.txt"

Matlab maximum in an array

[maxA,ind] = max(A(:));

[m,n] = ind2sub(size(A),ind)

Password protection pdf

apt-get install pdftk

pdftk input.pdf output output.pdf owner_pw xyz user_pw abc encrypt_128bit

Turn off system bell

Step 1

=====

/etc/inputrc

uncomment this line

set bell-style none

Step 2

=====

~/.bashrc

Append

if [ -n "$DISPLAY" ]; then

 xset b off

fi

Step 3

=====

xset q | grep bell

Step 4

=====

reboot

Copy files recursively

cp -a /source-directory/. destination-directory/

-a is an improved command for recursive copy all files

. is for all files in the directory

Matlab installation

chmod +x install

sudo ./install

NB: sudo

chmod -R 755 FOLDER

How create links

ln -s $MATLAB/bin/matlab matlab

where $MATLAB is the MATLAB installation directory.

Or add this in /etc/profile

How to install .deb package?

su

dpkg -i *.deb

Install sudo

apt-get install sudo

Add user to sudoer

nano /etc/sudoers

after root

golam    ALL=(ALL:ALL) ALL

How to check sha checksum?

sha1sum -c SHA1SUMS

sha512sum -c SHA512SUMS

How to do distribution upgrade?

apt-get dist-upgrade

Debian repositories

/etc/apt/sources.list

deb http://ftp.debian.org/debian jessie main contrib non-free

deb-src http://ftp.debian.org/debian jessie main contrib non-free

# Line commented out by installer because it failed to verify:

deb http://security.debian.org/ jessie/updates main contrib non-free

# Line commented out by installer because it failed to verify:

deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free

deb-src http://ftp.debian.org/debian/ jessie-updates main contrib non-free

Graphics card recovery

ctrl+alt+F1

apt-get purge nvidia*

Debian Tutorial. Download

In essence, this is my recitation notes from the above introductory material.

bash shell

Text file viewer: cat, more, less They are called PAGER in Linux.

Login as root $root or $su Set UserID

C-a Beginning of line

C-e End of line

sC-y Paste what was cut before

C-k To kill all letters after the cursor

C-c To stop the program

whoami

rm -rf / To remove your entire hard disk

exit

A-F2 Run application

C-A-F1 to F6 To choose Virtual Console.

C-A-F7 to return to the X Window System

The Linux kernel has disk cache -- it stores in memory (RAM) for the time being what it is supposed to store in a disk. Periodically it stores this info in disk. This is called syncing.

reboot To reboot

man -k [-M path] keyword ... Anything in [] is an optional unit.

man [[section] page] There is page in a section. However, it is optional.

Files are a way to store and organize information. They are organized into directories (folders in other operating systems).

/ root directory

DOS/Windows has several file systems, e.g., C:, D:, A: However, Linux has only one file system. All are organized under the / directory.

/home/your-name My home directory

root directory / and root user are different things. Do not confuse.

Directories are arranged in a tree structure. The entire thing is called directory tree. Base of the tree is /

There are no directories that correspond to a physical device, such as hard drive. This is different from DOS/Windows where each path starts with a device name such as C:\

pwd print working directory

ls list

cd / change directory to root

cd with no argument changes your directory to your home directory

~ alias of home directory. For example cd (without argument) and cd ~ are the same thing. ~your-name is equivalent to /home/your-name. It is very handy.

Absolute file name /etc/profile

Relative file name . current directory I am in now .. parent of the current directory I am in now; every directory has parent directory. Even root has parent directory; it is its own parent.

A file name without the root implicitly implies ./ (current) directory. So local/bin and ./local/bin means the same thing.

clear To clear screen

mkdir make directory

cp copy

cp -r To copy recursively

more to show text file

mv to move. For example mv file-name directory-name. Since both file name and directory name is relative here, it is assumed the file is in ./current directory. The directory to which to copy is under the current directory.

ls sub-directory-name I should not put any / after a (sub)directory name. I do not have to go to the directory to view it. I can be on a parent directory and view the contents of a subdirectory.

mv file-name new-file-name There is no rename command in Linux.

cd .. Change to the parent directory

rm file-name Remove file name. Be careful removing a file in Linux is permanent. there is noting called undone. It is gone forever.

rmdir directory-name Remove directory name. The directory has to be empty.

rm -r directory To remove everything inside the directory.

GNU/Linux is multitasking system. Each task is called a process.

top To view all the current processes.

Processes that end with d like kflushd are called daemons. They are non-interactive processes and initiated by the system. I do not have to take care of it. Daemon stands for Disks And Extensions MONitor. Daemons provide services like internet connectivity, email, printing etc.

Press u after top. Supply the user name. I will see only the processes belonging to the given user. All daemons and processes run by other users are not shown. Alternatively I can use top u user-name

Each process is provided a unique user ID.

A computer program is something a programmer wrote and placed on a disk. A process is a program running.

The simplest function of a Shell is to launch other programs. I type the program name, any arguments, then Shell requests system to run the program.

Technically Windows 95 is graphical shell. X Window System is also a graphical shell. Usually by Shell we mean "command line shell".

2 oldest shells are Bourne Shell (sh) and c Shell (csh). GNU implementation is Bourne Again Shell (bash). Use chsh command to change the various shells available.

A shell can start a job or process group. A job consist of one process or a number of processes in a pipeline.

C-z to suspend a job. Bash will provide some info about the job it just suspended.

Bash provides a job number to each command line you enter in the Shell. This allows to refer to the process easily.

For example [1]+ Stopped man cp  Here 1 is the job number. + means it is the last job I had in the foreground. Current state of the job is Stopped. - means the next to last foreground job.

jobs to enquire the suspended jobs

fg Place last foreground jobs turned on.

fg %number Put the job# on the foreground.

kill %number Terminate a job. It just ask process to quit.

kill -9 %number Demands a job to quit. It forcibly and unconditionally kills the job. Here killing means to send signal to terminate the job or suspends a job for resuming later.

PID (process ID) does not correspond to the job number.

Other than man command, I can also use info or help command. For example, help cd

Use Tab key to suggest for auto completion in Shell.

finger user-name Publicly available user information.

chfn To change name.

chsh To change shell.

Plan is info you can make available to other users and entire Internet community. I can do it by using .plan file.

Getting Help

-h option to get help

use man or info pages. If nothing can be found search for Debian specific information in /usr/doc/package-name

dpkg --status package-name To check the status of the Debian package, like whether it is installed properly, its dependencies.

dmesg Print kernel ring buffer.

uname Print system info.

Shell

Every process has an environment associated with it. An environment is a collection of environment variables.

printenv To print shell's environment.

Environment variables are one way to configure the system.

Spacebar to scroll one page at a time, while enter is used to scroll one line at a time.

In bash, export name=value No space before and after =

In C derivative shell, setenv name value

echo $name to view the value of the environment variable.

PAGER is a program to view online manual in shell prompt

If I want to use a value of an environment variable for temporary time being, use value=new-value followed by usual command. For example, let's say that PAGER is set to less. If I want to use more as PAGER value at this time only, I can use PAGER=more man cp Remember "not" to use the word export.

unset variable Not to set a value to the variable.

Shell variable is different from the environment variable. For example PS1=hello: changes the $ to hello: There is no need to use the word export as we are not saving to any environment variable. We are modifying the shell's behavior.

If we export a "shell" variable, its children can see that.

All processes come from an earlier process. It is called parent process.

ps process status. Use to examine parent-child relationship.

ps f List of processes belonging to me.

The PATH environment variable is used to locate a program in a hard disk so that it can execute faster rather than searching all over the hard disk. The value of path is a colon separated list of directories.

type cp It shows the execution location of the program cp. type is not a program, it is a feature of the shell. Built-in processes will not show up in top or ps They are just part of the shell

The C shell derivative of type is which.

alias or shell functions can be used to make short of the commonly used commands.

alias new-command='old-command -option1 -option2' Remember no space before and after =

type new-command

stdin, stdout, pipelines, and redirection

Every process has 3 connections to the outside world, stdin, stdout, and stderr.

Output redirection operator >

Example echo Hello > myfile

Use cat or some other program to view the contents of the file.

Input redirection operator >

Example more < myfile

Pipeline: you can connect standard output of one command to the standard input of another command. The pipe operator is |.

Example: To view the GNU GPL license in reverse use tac command (reverse of cat). However it goes too fast. So we can use the pipe operator | more.

tac /etc/profile | more

An interesting example

echo golam > myfile1

tr golam kibria < myfile1 > myfile2 Here tr replaces each letter in golam with the letters in kibriA

more < myfile2

rm myfile1 myfile2

Clearly pipeline is more convenient.

Wildcard * ( 0 or more characters)

/etc/* It has to be borne in mind that files beginning with .  are not included in this expansion.

Wildcard ? (single character)

ls /etc/rc?.d

Wildcard [...]

[abc] any letter from a, b, or c

[^abc] any letter except a, b, or c

[a-j] any letter from a to j

[a-j A-J] any letter from a to j or A-J

Bash has 2 different kinds of shells. Interactive and non-interactive shells.

/etc/resolv.conf is an important system configuration file.

Example:

ls -l /etc/resolv.conf

-rw-r--r-- 1 root root 117 2012-11-23 12:24 /etc/resolv.conf

The size of the file is 117 bytes. Date of last modification is provided.

Number of hard links is 1

File is owned by 2 roots are the user and group.

Every file has 2 owners. user and group.

There is a group called root in addition to the root user.

groups To view which group I belong. It could be that I belong to the same group, which is identical to my username.

more /etc/group

ls -l /home

In addition to user and group ownership, each file has mode, which tells Read, Write and Execute.

There are 10 "elements" in the example below, and the mode consists of 12 bits. However, we will concentrate on 9 elements at this moment.

Example:

ls -l /etc/resolv.conf

-rw-r--r-- 1 root root 117 2012-11-23 12:24 /etc/resolv.conf

user, group,others (World)

First element tells that it is a regular file. If it were "d" it would have been a directory. The rest 9 elements tells the file permission for user, group and others. The remaining 3 bits are displayed by changing x to s, S, t, T.

Access means you can view, change and execute.

Page 42-43 File and Directory permission

Only if you have execute permission to a directory, then file permission in that directory becomes relevant.

chmod To change permission

Use ; to use multiple commands on one line.

cd by itself take you to the home directory.

touch is used to change the modification time of the file to the current time. If a file does not exist. it creates another file!!!

How to check what kind of bash r u using? ps

Download something from Internet: wget -c URL

chmod go-r filename Group and others cannot read this file.

chmod u+x filename To enable the execution right of the file for me.

chmod ugo=rx filename

chmod a-x filename Here a is for all ugo

Remote login

hostname Find host name

id -un To find username

How to install a theme

To install a theme: Download it and decompress it in ~/.themes (or /usr/share/themes to install it system-wide).

Sync with time server

gnome-time-admin Install this package

Time and Date Configure from the Administration. Do not configure the Date and Time. Keep sync with Internet servers.

To fix brightness problem:

add the following line before the exit 0

echo 100 > /sys/class/backlight/acpi_video0/brightness

gedit /etc/rc.local

Configure printer

Alt+F2

system-config-printer

Configure Wifi

sudo apt-get install linux-headers-generic sudo apt-get install --reinstall bcmwl-kernel-source sudo modprobe wl 

Change Hostname

Change name in 2 files

sudo gedit /etc/hostname

sudo gedit /etc/hosts

Install Ubuntu alongside Windows

exFAT

sudo apt-get install exfat-utils exfat-fuse

Matlab libXp.so Library missing

apt-get install libxp6 libxp-dev

Mount and Unmount external harddisk

umount /media/myNewDrive

mkdir /media/myNewDrive

gedit /etc/fstab

/dev/sdb1    /media/Firdaws    ext4    defaults    0    0

chmod 777 -R /media/myNewDrive

To find the location of the program called gedit

whereis gedit

dpkg -i /path/to/deb/file

/etc/apt/sources.list

/etc/apt/sources.list

/etc/apt/sources.list

Change size of system

Download iso image of Gparted from website

If I use Windows, Rufus software can be used to write ISO image to USB.

How to connect to WIFI from command line in Debian?

Just edit /etc/network/interfaces and write:

auto wlan0

iface wlan0 inet dhcp

               wpa-ssid {ssid}

               wpa-psk  {password}

After that write and close file and use command:

sudo dhclient wlan0

Replace {ssid} and {password} with your respective WiFi SSID and password.