Like EPELREMI repository, RPM Fusion repository provides packages that Fedora or Red Hat doesn’t want to ship with official repositories. In this handy tutorial, let us see how to add RPM Fusion repository both on RHEL/CentOS/Scientific Linux 6.x and 5.x versions. Here x refers the version numbers i.e 6.1, 6.2, 6.3 etc.

Please be mindful that you have to enable EPEL repository, before installing RPM Fusion repository.

Install RPM Fusion Repository On Fedora 14 and later

Run the following commands to install both free and non-free RPM Fusion repositories on Fedora 14/15/16/17/18/19/20 systems. This will applicable for both 32 bit and 64 bit distributions.

$ sudo rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm 
$ sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Install RPM Fusion Repository On RHEL/CentOS/Scientific Linux 5

Run the following commands to install both free and non-free RPM Fusion repositories on RHEL 5.x based systems. This will applicable for both 32 bit and 64 bit distributions.

# rpm -Uvh http://download1.rpmfusion.org/free/el/updates/5/i386/rpmfusion-free-release-5-1.noarch.rpm
# rpm -Uvh http://download1.rpmfusion.org/nonfree/el/updates/5/i386/rpmfusion-nonfree-release-5-1.noarch.rpm

Install RPM Fusion Repository On RHEL/CentOS/Scientific Linux 6

Run the following commands to install both free and non-free RPM Fusion repositories on RHEL 6.x based systems. This will applicable for both 32 bit and 64 bit distributions.

# rpm -Uvh http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm
# rpm -Uvh http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm

Update the Repositories

After installing the RPM Fusion repository packages, you have to update the repository lists using command:

# yum update

That’s it. RPM Fusion has been added and enabled in RHEL 5.x/6.x systems and Fedora 14/15/16/17/18/19/20.

For questions please refer to our Q/A forum at : http://ask.unixmen.com/


source - http://www.unixmen.com/install-rpm-fusion-repository-rhel-centos-scientific-linux-6-x-5-x-fedora-14-20/




'System > Linux' 카테고리의 다른 글

linux - difference between adduser and useradd  (0) 2014.09.18
linux - hostname Upper Or Lowercase ?  (0) 2014.09.18
linux - grep and or  (0) 2014.09.02
linux - sshfs  (0) 2014.08.25
linux - Compacting VirtualBox Disk Images - Linux/Windows Guests  (0) 2014.08.25
Posted by linuxism
,

linux - grep and or

System/Linux 2014. 9. 2. 14:20


Question: Can you explain how to use OR, AND and NOT operators in Unix grep command with some examples?

Answer: In grep, we have options equivalent to OR and NOT operators. There is no grep AND opearator. But, you can simulate AND using patterns. The examples mentioned below will help you to understand how to use OR, AND and NOT in Linux grep command.

The following employee.txt file is used in the following examples.

$ cat employee.txt
100  Thomas  Manager    Sales       $5,000
200  Jason   Developer  Technology  $5,500
300  Raj     Sysadmin   Technology  $7,000
400  Nisha   Manager    Marketing   $9,500
500  Randy   Manager    Sales       $6,000

You already knew that grep is extremely powerful based on these grep command examples.

Grep OR Operator

Use any one of the following 4 methods for grep OR. I prefer method number 3 mentioned below for grep OR operator.

1. Grep OR Using \|

If you use the grep command without any option, you need to use \| to separate multiple patterns for the or condition.

grep 'pattern1\|pattern2' filename

For example, grep either Tech or Sales from the employee.txt file. Without the back slash in front of the pipe, the following will not work.

$ grep 'Tech\|Sales' employee.txt
100  Thomas  Manager    Sales       $5,000
200  Jason   Developer  Technology  $5,500
300  Raj     Sysadmin   Technology  $7,000
500  Randy   Manager    Sales       $6,000

2. Grep OR Using -E

grep -E option is for extended regexp. If you use the grep command with -E option, you just need to use | to separate multiple patterns for the or condition.

grep -E 'pattern1|pattern2' filename

For example, grep either Tech or Sales from the employee.txt file. Just use the | to separate multiple OR patterns.

$ grep -E 'Tech|Sales' employee.txt
100  Thomas  Manager    Sales       $5,000
200  Jason   Developer  Technology  $5,500
300  Raj     Sysadmin   Technology  $7,000
500  Randy   Manager    Sales       $6,000

3. Grep OR Using egrep

egrep is exactly same as ‘grep -E’. So, use egrep (without any option) and separate multiple patterns for the or condition.

egrep 'pattern1|pattern2' filename

For example, grep either Tech or Sales from the employee.txt file. Just use the | to separate multiple OR patterns.

$ egrep 'Tech|Sales' employee.txt
100  Thomas  Manager    Sales       $5,000
200  Jason   Developer  Technology  $5,500
300  Raj     Sysadmin   Technology  $7,000
500  Randy   Manager    Sales       $6,000

4. Grep OR Using grep -e

Using grep -e option you can pass only one parameter. Use multiple -e option in a single command to use multiple patterns for the or condition.

grep -e pattern1 -e pattern2 filename

For example, grep either Tech or Sales from the employee.txt file. Use multiple -e option with grep for the multiple OR patterns.

$ grep -e Tech -e Sales employee.txt
100  Thomas  Manager    Sales       $5,000
200  Jason   Developer  Technology  $5,500
300  Raj     Sysadmin   Technology  $7,000
500  Randy   Manager    Sales       $6,000

Grep AND

5. Grep AND using -E ‘pattern1.*pattern2′

There is no AND operator in grep. But, you can simulate AND using grep -E option.

grep -E 'pattern1.*pattern2' filename
grep -E 'pattern1.*pattern2|pattern2.*pattern1' filename

The following example will grep all the lines that contain both “Dev” and “Tech” in it (in the same order).

$ grep -E 'Dev.*Tech' employee.txt
200  Jason   Developer  Technology  $5,500

The following example will grep all the lines that contain both “Manager” and “Sales” in it (in any order).

$ grep -E 'Manager.*Sales|Sales.*Manager' employee.txt

Note: Using regular expressions in grep is very powerful if you know how to use it effectively.

6. Grep AND using Multiple grep command

You can also use multiple grep command separated by pipe to simulate AND scenario.

grep -E 'pattern1' filename | grep -E 'pattern2'

The following example will grep all the lines that contain both “Manager” and “Sales” in the same line.

$ grep Manager employee.txt | grep Sales
100  Thomas  Manager    Sales       $5,000
500  Randy   Manager    Sales       $6,000

Grep NOT

7. Grep NOT using grep -v

Using grep -v you can simulate the NOT conditions. -v option is for invert match. i.e It matches all the lines except the given pattern.

grep -v 'pattern1' filename

For example, display all the lines except those that contains the keyword “Sales”.

$ grep -v Sales employee.txt
200  Jason   Developer  Technology  $5,500
300  Raj     Sysadmin   Technology  $7,000
400  Nisha   Manager    Marketing   $9,500

You can also combine NOT with other operator to get some powerful combinations.

For example, the following will display either Manager or Developer (bot ignore Sales).

$ egrep 'Manager|Developer' employee.txt | grep -v Sales
200  Jason   Developer  Technology  $5,500
400  Nisha   Manager    Marketing   $9,500



source - http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators/




'System > Linux' 카테고리의 다른 글

linux - hostname Upper Or Lowercase ?  (0) 2014.09.18
linux - Install RPM Fusion Repository  (0) 2014.09.04
linux - sshfs  (0) 2014.08.25
linux - Compacting VirtualBox Disk Images - Linux/Windows Guests  (0) 2014.08.25
linux - chown symbolic link  (0) 2014.08.24
Posted by linuxism
,


Welcome to CSS Basics. More info on this section at the bottom of this post.

How Do I Force the Browser to Use the Newest Version of my Stylesheet?

on  | 47 Comments
Update (Nov. 19/2011):
This article started out as a basic tip but there have been some great comments added for those interested in delving into the topic of caching even more. So, although I do offer this as a recommendation, there are better ways to do this for larger apps, and there are some concerns to keep in mind should you choose to do this. So be sure to read the comments for links and further info on this topic.

If you’re a beginner and you’re developing HTML and CSS using an external stylesheet, you might notice that in some browsers, under some circumstances, the changes you’ve made to your CSS don’t take effect immediately.

Sometimes it’s necessary to do a hard refresh to see the updates take effect. But it’s unlikely that average web users know what a hard refresh is, nor can you expect them to keep refreshing the page until things straighten out.

So how can you ensure that any updates you’ve made to your CSS will take place immediately for all users? Here’s one way to do it:

  1. <link rel="stylesheet" href="style.css?v=1.1">  

Notice that I’m pointing to my CSS using the commonly known <link> element. But I’ve also added what’s called a query string to the end of the file name.

The browser will view a file name of style.css as different from a file name of style.css?v=1.1, so it will generally force the browser to update the stylesheet. So, each time you update your CSS on the server, you can incrementally update your version number.

If you’re new to query strings, just know that the part before the equals sign is like a placeholder, and the part after the equals sign is the value put into that placeholder. This will have no effect on the CSS. It will only serve to make the browser think it’s a completely different file.

You could add many types of characters to the query string value, but numbers are a logical way to do it, because then you can just increase the number, and even add decimal places if you want. And of course, if you don’t change the value for a while, the browser will continue to cache (or preserve) the file, and won’t attempt to download it unless other factors force it to, or you end up updating the query string value.

Questions? Clarifications?

This post is not intended to be an exhaustive reference on this subject. It's meant to provide a simple CSS tip for beginners. If you have any questions or clarifications on anything I've said here, add them to the comments. If necessary, I'll continually improve this article to keep it up to date with the latest CSS standards and best practices.

This is the CSS Basics section of Impressive Webs. These posts do not appear in the main home page feed. You can subscribe via RSS or get an email notification whenever a new post is added.



source - http://www.impressivewebs.com/force-browser-newest-stylesheet/#comments



'Development > CSS' 카테고리의 다른 글

css - position Property(absolute vs relative)  (0) 2015.06.16
css - sass  (0) 2014.06.27
css - z-index  (0) 2014.05.15
css - position absolute center  (0) 2014.05.04
css - Background-color displaying incorrectly in IE8 and IE9  (0) 2014.04.29
Posted by linuxism
,