22 November 2012

HOW TO INSTALL ADOBE FLASH PLAYER PLUGIN IN CENTOS|RHEL|FEDORA

This is guide, howto install Adobe Flash Player Plugin version 11.2 (32-bit and 64-bit) with YUM on Fedora 17/16/15/14/13/12, CentOS 6.3/6.2/6.1/6/5.8 and Red Hat (RHEL) 6.3/6.2/6.1/6/5.8.
For installation via bash script, download your copy from here.
and installing yourself follow these steps..

STEP 1 : ADD ADOBE FLASH REPOSITORY RPM PACKAGE --

## Adobe Repository 32-bit x86 ##
[user@linux:~]$rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
[user@linux:~]$rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

## Adobe Repository 64-bit x86_64 ##
[user@linux:~]$rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
[user@linux:~]$rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

STEP 2 : UPDATE CENTOS REPOSITORY INFO --

[user@linux:~]yum check-update

STEP 2 : Install Adobe Flash Player 11.2 on Fedora 17/16/15/14/13/12, CentOS 6.3/6.2/6.1/6 and Red Hat (RHEL) 6.3/6.2/6.1/6 --

[user@linux:~]yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

STEP 3 : Install Adobe Flash Player 11.2 on CentOS 5.8 and Red Hat (RHEL) 5.8


[user@linux:~]yum groupinstall "Sound and Video"
[user@linux:~]yum install flash-plugin nspluginwrapper curl

21 November 2012

HOW TO INSTALL GOOGLE CHROME IN (CENTOS/REDHAT) 6.3, FEDORA 16/17

In this how to I will show you how to install Google Chrome Browser in Centos/Fedora/Redhat.Though you can download and install the same using rpm but the best way to install and keep your browser update is via YUM. For that you have to add the google chrome repo in your repositories. For those who dont like to play around with repo and manually installation of software I have written a little script which will setup and install the Google Chrome on your system while taking care of all the stuff itself.
For installation via bash script, download your copy from here.
and installing yourself follow these steps..

STEP 1 : ENABLE GOOGLE YUM  REPOSITORY --

Create a file google-chrome.repo inside the /etc/yum.repos.d :
for 32 bit --->

[user@linux:~]$vi /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

for 64 bit ---> 

[user@linux:~]$vi /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Note: Both 32-bit and 64-bit repos can be placed in the same file. 

STEP 2 : INSTALL GOOGLE CHROME USING YUM AS ROOT USER --


 
## Install Google Chrome Stable version ##
[user@linux:~]$yum install google-chrome-stable
 
## Install Google Chrome Beta version ##
[user@linux:~]$yum install google-chrome-beta
 
## Install Google Chrome Unstable version ##
[user@linux:~]$yum install google-chrome-unstable

20 November 2012

HOW TO SET FILE ASSOCIATIONS OF FILE WITH COMMAND LINE IN LINUX

QUES: Why would one choose to use command line for changing file associaiton........?
ANS: Several times you come across a situation when you have to setup file associations from the command line. Like sometimes, file managers just won't work, other times you may have a corrupted file or bad line in your file.It involves just 3 steps as follows : 

STEP 1) Then query the file to figure out the mimetype syntax


[user@linux:~]$xdg-mime query filetype /home/linux/Desktop/vid.flv

[user@linux:~]$video/x-flv 

STEP 2) Check what the default program is of that mimetype.


[user@linux:~]$xdg-mime query default video/x-flv

STEP 3) Set the file association 



[user@linux:~]$xdg-mime default vlc.desktop

NOTE :-- Here I knew the programme name to be associated with the new filetype, so I jumped
to the step 3 after the step 2. If you dont know the programme names and there association then follow these steps.

ADDITIONAL STEP : Figure out what the programname.desktop of the program you want to use is.
The simplest way to do this is by checking your mimeapps.list file located here.


[user@linux:~]$vi /home/linux/.local/share/applications/mimeapps.list

If that doesn't work try searching for the file with a similar command.

[user@linux:~]$find / -iname '*vlc.desktop*' 2>/dev/null
 

If the programname.desktop file has a weird name then you will need to grep for that file.Here I will use the vlc media player.


[user@linux:~]$grep -ri "vlc media player" /usr/share/applications/* 2>/dev/null 

[user@linux:~]$/usr/share/applications/vlc.desktop:Name=VLC media player

For Centos/Fedora/Rhel users if they find this error while changing the file types -- 

[user@linux:~]$/usr/bin/xdg-mime: line 532: kde-config: command not found 

follow this link(https://bugs.freedesktop.org/show_bug.cgi?id=25563#c2)

[user@linux:~]$find / -iname '*vlc.desktop*' 2>/dev/null

18 November 2012

LINUX SHELL/TERMINAL CHEAT SHEET


Shell Cheat Sheet linuxadminhelp.blogspot.in
Useful Editing Keystrokes for shell
KEYSTROKE(s)
FUNCTIONS
Up
Move back one command in the history list
Down
Move forward one command in the history list
Left
Move back one character.
Right
Move forward one character
Esc + f
Move forward one word
Esc + b
Move forward one word
Ctrl + A
Move to the beginning of line
Ctrl + E
Move to the end of line
Ctrl + D
Delete current character
Backspace
Delete previous character
Esc + d
Delete current word
Ctrl + U
Delete from beginning of line
Esc + k
Delete to end of line
Ctrl + Y
Retrieve last item deleted
Esc
Insert last word of previous command
Ctrl + L
Clear the screen, placing the current line at the top of the screen
Tab
Attempt to complete the current word, interpreting it as a filename, username, variable name, hostname, or command as determined by the context
Esc + ?
List the possible completions
Ctrl + C
Sends an interrupt signal to the currently executing command, which generally responds by terminating itself
Ctrl + D
Sends an end of file to the currently executing command. Use this keystroke to terminate console input
Ctrl + Z
Suspends the currently executing program
exit
Exit from shell
Shell special characters
CHARACTER
FUNCTIONS
#
Marks the command as a comment, which the shell ignores
;
Separates commands, letting you enter several commands on a single line
&
Placed at the end of a command, causes the command to execute as a background process, so that a new shell prompt appears immediately after the command is entered
()
execute commands in subshell
{}
execute commands in current shell
$var
Substitue the declare variable with its value while execution of the command
special characters used in filename globbing(filename metacharacters)
METACHARACTER
FUNCTIONS
*
Matches a string of zero or more characters
?
Matches exactly one character
[ abc ...]
Matches any of the characters specified
[ a - z ]
Matches any character in the specified range
[! abc ...]
Matches any character other than those specified
[! a - z ]
Matches any character not in the specified range
~
The home directory of the current user
~ userid
The home directory of the specified user
~+
The current working directory
~-
The previous working directory
SHELL ALIASES
alias name='command' (like --> alias mv='mv -i')
unalias <alias name>
special scripts
SCRIPT
FUNCTIONS
/etc/profile
Executed when the user logs in
~/.profile
Executed when the user logs in
~/.bashrc
Executed when BASH is launched
~/.bash_logout
Executed when the user logs out
Shell evironment variables
VARIABLE
FUNCTIONS
USER
The user's current username; may differ from the login name if the user executes the su command
DISPLAY
The X display to be used; for example, localhost:0
HOME
The absolute path of the user's home directory
HOSTNAME
Internet name of the host
LOGNAME
The user's login name
MAIL
The absolute path of the user's mail file
PATH
The search path
SHELL
The absolute path of the current shell
TERM
The terminal type
printenv
Print environment values
export <variable>
To make the value of a shell variable availabl e to the programs invoked by the shell
Variable=
To remove the value associated with shell variable, give the variable an empty value (though it will appear in the output of set cmd)
Unset <variable>
To dispense the variable from the shell
CONTROLLING OPERATION OF THE Shell
CHARACTER
FUNCTIONS
'
Characters within a pair of single quotes are interpreted literally; that is, their metacharacter meanings (if any) are ignored. Similarly, the shell does not replace references to shell or environment variables with the value of the referenced variable
Characters within a pair of double quotes are interpreted literally; that is, their metacharacter meanings (if any) are ignored. However, the shell does replace references to shell or environment variables with the value of the referenced variable
` `
Text within a pair of back quotes is interpreted as a command, which the shell executes before executing the rest of the command line. The output of the command replaces the original back-quoted text
\
The following character is interpreted literally; that is, its metacharacter meaning (if any) is ignored. The backslash character has a special use as a line continuation character. When a line ends with a backslash, the line and the following line are considered part of a single line
Input/Output Redirection and Piping (stdin,stdout,stderr)
REDIRECTOR
FUNCTIONS
cmd > file
Redirects standard output stream to specified file (same as cmd 1> file)
cmd 2> file
Redirects standard error stream to specified file
cmd >> file
Redirects standard output stream to specified file, appending output to the file if the file already exists
cmd 2>> file
Redirects standard error stream to specified file, appending output to the file if the file already exists
cmd &> file
Redirects standard output and error streams to the specified file
cmd > file 2>&1
Another way to redirect both stdout and stderr of cmd to a file
cmd < file
Redirects standard input stream to the specified file
cmd << text
Reads standard input until a line matching text is found, at which point end of file is posted
cmd > /dev/null
Discard stdout of cmd
cmd 2> /dev/null
Discard stderr of cmd
cmd &> /dev/null
Discard stdout and stderr of cmd
{ cmd1; cmd2; } > file
Redirect stdout from multiple commands to a file
cmd << EOL
line1
line2
EOL
Redirect a bunch of lines to the stdin. If 'EOL' is quoted, text is treated literally. This is called a here-document
cmd1 | cmd2
Takes the standard input of cmd2 from the standard output of cmd1 (also known as the pipe redirector)
cmd1 |& cmd2
Redirect stdout and stderr of cmd1 to stdin of cmd2 (bash 4.0+ only)
cmd | tee file
Redirect stdout of cmd to a file and print it to screen



A cheat sheet by Shiwang Kalkhanda (shiwangkalkhanda@gmail.com) 2012.
Released under GNU Free Document License
YOU CAN ALSO DOWNLOAD IT AS PDF FROM HERE