Author Topic: Un-obvious Linux tricks  (Read 3105 times)

Offline Mr. Bill

  • Like a hot cocoa mojito
  • Administrator
  • Survival Veteran
  • *******
  • Posts: 9768
  • Karma: 636
  • Trained Attack Sheepdog/Troll hunter
    • Website maintenance services by Mr. Bill
Un-obvious Linux tricks
« on: January 18, 2013, 08:05:35 PM »
I've been using Linux since 2005 -- and by 2005, Ubuntu Linux gave us a nice GUI, so I haven't needed to resort to the command line very often.  But sometimes ya gotta.  Linux is still occasionally a DIY project.

So this thread is for little useful tricks.  Nothing huge and complex, requiring years of experience to understand.  Just simple things, generally using the command line, that regular folk (e.g., NOT ARCHER 8) ) might not be aware of.

Today's trick: comparing directories.  You may know that diff compares two files.  It wasn't until today that I discovered it can compare two directories, to tell you which files are present only in one or the other, or which are present in both but with file differences.

Code: [Select]
diff -qr directory1 directory2
Nifty!

Offline TexDaddy

  • TSP Goat Wrangling Geezer. He is EVIL also.
  • Global Moderator
  • Ultimate Survival Veteran
  • ******
  • Posts: 10327
  • Karma: 142
  • I live in Texas. What country are you from?
Re: Un-obvious Linux tricks
« Reply #1 on: January 18, 2013, 08:11:48 PM »
...that regular folk (e.g., NOT ARCHER 8) ) might not be aware of...
I would never make the mistake of thinking Archer is regular folk. He is...exceptional.  ;)
"I went down Virginia, seekin' shelter from the storm.
Caught up in the fable, I watched the tower grow.
Five year plans and new deals, wrapped in golden chains.
And I wonder, still I wonder who'll stop the rain."

...A quote from the book 'Mataroda' comes to mind:
'To do more than your best is impossible, to do less is unthinkable'
WWCD = What would Cedar do?

Offline Bradbn4

  • Dedicated Contributor
  • ******
  • Posts: 1075
  • Karma: 27
Re: Un-obvious Linux tricks
« Reply #2 on: January 19, 2013, 09:50:26 AM »
dircmp (only on real Unix) can do the same thing.

now for some real fun, vim and improved version of vi dose have a nice feature - gvimdiff <file 1> <file 2>  will show not only the differences between both files, but highlight the specific character that is different.

When you say "vi" - do you say "v" "i", or is it like evil?

People who had classes say the "v" "i", those who learned it outside of classroom often say it as one word.  And folks who don't know Unix - are wondering why are we talking about "Village Inn"?


Brad(bn4) - In Colorado

Offline Mountain State Prepper

  • Survivalist Mentor
  • *****
  • Posts: 731
  • Karma: 11
  • Proudly owned by a yellow lab!
Re: Un-obvious Linux tricks
« Reply #3 on: January 19, 2013, 10:15:44 AM »

When you say "vi" - do you say "v" "i", or is it like evil?


I say "v" "i" seperately, never formally trained, just seemed right and what everyone else said.

I like the "diff" command, will have to remember that.   Here is one back to you...in a pinch and can't seem to find that big file taking up your space?...

"du -axk <filesystem> |sort -rn |more"   (or head)

I also hate that 'du' and 'df' can report different sizes....but that can get you going in circles...another thread perhaps one day :).
--Montani Semper Liberi

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #4 on: January 19, 2013, 12:51:48 PM »
dircmp (only on real Unix) can do the same thing.

now for some real fun, vim and improved version of vi dose have a nice feature - gvimdiff <file 1> <file 2>  will show not only the differences between both files, but highlight the specific character that is different.

When you say "vi" - do you say "v" "i", or is it like evil?

People who had classes say the "v" "i", those who learned it outside of classroom often say it as one word.  And folks who don't know Unix - are wondering why are we talking about "Village Inn"?



i use sdiff to compare two files:

~$ sdiff -w100 file1 file2
1                  1
2                  2
3                     |   33
4                  4
5                  5
                     >
6                  6
7                  7
8                  8
9                  9
10                     <

to only see one side:

~$ sdiff -lw100 file1 file2
1                     (
2                     (
3                     |   33
4                     (
5                     (
                     >
6                     (
7                     (
8                     (
9                     (
10   
« Last Edit: January 19, 2013, 12:59:02 PM by Archer »


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #5 on: January 19, 2013, 12:58:02 PM »
I say "v" "i" seperately, never formally trained, just seemed right and what everyone else said.

I like the "diff" command, will have to remember that.   Here is one back to you...in a pinch and can't seem to find that big file taking up your space?...

"du -axk <filesystem> |sort -rn |more"   (or head)

I also hate that 'du' and 'df' can report different sizes....but that can get you going in circles...another thread perhaps one day :).

df -h shows in human readable form:
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/vzfs              80G   68G   13G  84% /
none                  768M  4.0K  768M   1% /dev

and du -h also shows human readable:
$ du -shx *
4.0K   tmp1
24K   tmp10
4.2M   tmp11
4.0K   tmp2
12K   tmp3
4.0K   tmp4
4.0K   tmp5
20K   tmp6
1.6M   tmp8
4.0K   tmp9

I like using "du -shx *" to show space usage in the current directory (see above). then i egrep out M and G to see the largest space users:
$ du -shx * | egrep 'M|G'
2.0M   aide
20M   Asst
100M   data
2.0M   forum
1.6M   homebrew
7.1M   images
9.3M   logs
2.0G   mail
825M   PDFs
42M   PDFs-books
1.6G   public_html
2.0M   smf_2-0-rc5_install.tar.gz
6.1M   tmp
2.1M   tsp



From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #6 on: January 19, 2013, 01:00:50 PM »
When you say "vi" - do you say "v" "i", or is it like evil?

People who had classes say the "v" "i", those who learned it outside of classroom often say it as one word.  And folks who don't know Unix - are wondering why are we talking about "Village Inn"?

it is pronounced: 'v' 'i'
as separate letters.


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #7 on: January 19, 2013, 01:03:21 PM »
I would never make the mistake of thinking Archer is regular folk. He is...exceptional.  ;)

i dont know everything, i've forgotten lots.... um, who am i?


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #8 on: January 19, 2013, 01:07:42 PM »
another good command: tree
(if you dont have it, download it from your flavors site)

$ tree unix/
unix/
|-- hpux
|   `-- hpux-sites
|-- kab
|   |-- change-bigip
|   |-- check-mysql-slave-all
|   |-- cpu-info
|   |-- dus
|   |-- restart-webs
|   `-- ssh-test
|-- linux
|   |-- connect.c
|   |-- diskfree-2.1.0.tar.gz
|   |-- durep-0.9.tar.gz
|   `-- script-examples
|       `-- bash-variables
`-- sun

5 directories, 11 files


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Mountain State Prepper

  • Survivalist Mentor
  • *****
  • Posts: 731
  • Karma: 11
  • Proudly owned by a yellow lab!
Re: Un-obvious Linux tricks
« Reply #9 on: January 19, 2013, 01:20:55 PM »

I like using "du -shx *" to show space usage in the current directory (see above). then i egrep out M and G to see the largest space users:
$ du -shx * | egrep 'M|G'

that is why i stick w/ "-k" and do the math in my head.  Using "-h" then piping it to "sort -rn" will but the 2G file toward the end of the output because it isn't a uniform size.  But grepping it out works too if you are just looking for large files without a sort from big>small.

--Montani Semper Liberi

Offline Mr. Bill

  • Like a hot cocoa mojito
  • Administrator
  • Survival Veteran
  • *******
  • Posts: 9768
  • Karma: 636
  • Trained Attack Sheepdog/Troll hunter
    • Website maintenance services by Mr. Bill
Re: Un-obvious Linux tricks
« Reply #10 on: January 19, 2013, 01:49:49 PM »
it is pronounced: 'v' 'i'
as separate letters.

The way I pronounce it cannot be printed here.

8)

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #11 on: January 19, 2013, 01:59:46 PM »
The way I pronounce it cannot be printed here.

8)

still better than emacs...


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Mountain State Prepper

  • Survivalist Mentor
  • *****
  • Posts: 731
  • Karma: 11
  • Proudly owned by a yellow lab!
Re: Un-obvious Linux tricks
« Reply #12 on: January 19, 2013, 02:05:48 PM »


I use "view" a lot for read-only review.   Keeps you from making stupid mistakes when your attention is taken away.   Closing out by habit with ":wq!" is a killer if you forgot what "the -f" you are doing. :)

--Montani Semper Liberi

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #13 on: January 19, 2013, 06:57:28 PM »

I use "view" a lot for read-only review.   Keeps you from making stupid mistakes when your attention is taken away.   Closing out by habit with ":wq!" is a killer if you forgot what "the -f" you are doing. :)
i've done that lots of times myself...... view is better for that as you say. i always save with ZZ w/o thinking about it.


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Bradbn4

  • Dedicated Contributor
  • ******
  • Posts: 1075
  • Karma: 27
Re: Un-obvious Linux tricks
« Reply #14 on: January 20, 2013, 11:55:05 AM »
The way I pronounce it cannot be printed here.

8)

The hard core original "vi" almost cost me a computer.  I got so disgusted by it's user unfriendliness I almost pushed the monitor off the work area. While vim is a fantastic improvement over vi, and the gvim version provides a worth while gui interface that beats the crap out of xemac's interface.  BTW: - vim sucks, but sucks less and still works well over very small 56k lines. This why I pronounce "vi" as in evil.   

My Unix trick of the moment.  If you don't have a spare computer to dedicate to Linux / Unix, get a copy of virtual box (vbox) and it is free.  https://www.virtualbox.org/   .   This software will let you build on your computer multiple Linux environments  without installing grub or other disk manager s/w.    On one computer I have 6 different types of Unix taking less than a few gigabytes of space.  So if you are testing for backwards compatibility of s/w between versions / styles of Linux it becomes a very affordable test platform.

The down side of Vbox?

It can / will run slower than native installed.  Mostly you will need to dedicate 1 - 2 gig of ram to the virtual instance for each OS you need to run at the same time.   Some older 64-bit dual core AMD processors had issues running virtualization of other 64-bit operating system.

useful utility programs & websites
   a2ps (ascii 2 post script).  I use this software to pretty print source code or other text files to almost any style.  https://www.gnu.org/software/a2ps/

  ntop - sort of like "top" but showing the network hogs in a system http://www.howtoforge.com/network_monitoring_with_ntop

FYI:  grab any of the good FAQ or one-line statements for sed, nawk, perl, etc.
Brad(bn4) - In Colorado

Offline Skunkeye

  • Dedicated Contributor
  • ******
  • Posts: 1161
  • Karma: 70
Re: Un-obvious Linux tricks
« Reply #15 on: January 22, 2013, 11:37:31 AM »
I like using "du -shx *" to show space usage in the current directory (see above). then i egrep out M and G to see the largest space users:

I use this guy all the time to find all files under the current directory and sort them by size (the largest files will end up at the bottom of the list):

  find . -type f -exec du -sk {} \; |sort -n

The "find" command is ridiculously useful, once you've mastered its somewhat tricky syntax and options.
"The Constitution is not an instrument for the government to restrain the people; it is an instrument for the people to restrain the government - lest it come to dominate our lives and interests.” - Patrick Henry

Offline Twibble

  • Survivor
  • ***
  • Posts: 176
  • Karma: 10
  • I forgot what I was thinking...
    • Trepanation for the Sane
Re: Un-obvious Linux tricks
« Reply #16 on: January 22, 2013, 11:42:25 AM »
If you keep getting an error regarding your home IP, don't just delete it because it's irritating you.  If you do, when you can't get your printer to work and call in help, tell them that you did that before they spend an hour beating their head against the wall.

I might not have said that quite correctly.  I need to start using Linux again.  It's been a while.
Cousin: "Who was crazy enough to take her to the range?"
Guy I later married: "I figured I should know how well she can shoot before I tick her off.  I don't want to tick her off."

Offline fritz_monroe

  • The Defenestrator
  • Global Moderator
  • Survival Veteran
  • ******
  • Posts: 6737
  • Karma: 111
    • The Homestead Fritz
Re: Un-obvious Linux tricks
« Reply #17 on: January 22, 2013, 12:04:40 PM »
The "find" command is ridiculously useful, once you've mastered its somewhat tricky syntax and options.
Find also works where things like ls won't.  For instance a directory with 4 million core files, ls will error out.  Find works great.
F_M
Check out my blogs at The Homestead Fritz and Camping With Fritz

Offline Mountain State Prepper

  • Survivalist Mentor
  • *****
  • Posts: 731
  • Karma: 11
  • Proudly owned by a yellow lab!
Re: Un-obvious Linux tricks
« Reply #18 on: January 22, 2013, 12:09:21 PM »


I use find to delete files of a certain age...

find /mydir -name "logfile123*.log" -mtime +7 -exec rm -f {} \;

--Montani Semper Liberi

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #19 on: January 22, 2013, 02:31:03 PM »

I use find to delete files of a certain age...

find /mydir -name "logfile123*.log" -mtime +7 -exec rm -f {} \;


most finds have the -delete option:
find /mydir -name "logfile123*.log" -mtime +7 -delete


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Mountain State Prepper

  • Survivalist Mentor
  • *****
  • Posts: 731
  • Karma: 11
  • Proudly owned by a yellow lab!
Re: Un-obvious Linux tricks
« Reply #20 on: January 22, 2013, 02:47:49 PM »
most finds have the -delete option:
find /mydir -name "logfile123*.log" -mtime +7 -delete

ah, very nice...
--Montani Semper Liberi

Offline Skunkeye

  • Dedicated Contributor
  • ******
  • Posts: 1161
  • Karma: 70
Re: Un-obvious Linux tricks
« Reply #21 on: January 22, 2013, 04:13:06 PM »
One thing I usually do before using "find" to delete files, is to do the find command by itself without the "-delete" flag to see what files it's going to tag before I do the actual delete.  Linux is not so forgiving on recovering accidentally-deleted files...
"The Constitution is not an instrument for the government to restrain the people; it is an instrument for the people to restrain the government - lest it come to dominate our lives and interests.” - Patrick Henry

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #22 on: January 22, 2013, 04:19:57 PM »
One thing I usually do before using "find" to delete files, is to do the find command by itself without the "-delete" flag to see what files it's going to tag before I do the actual delete.  Linux is not so forgiving on recovering accidentally-deleted files...
i always do '-ls' first before the '-delete' to make sure i want to delete what it finds.....
*nix is not forgiving when deleting files...


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline fritz_monroe

  • The Defenestrator
  • Global Moderator
  • Survival Veteran
  • ******
  • Posts: 6737
  • Karma: 111
    • The Homestead Fritz
Re: Un-obvious Linux tricks
« Reply #23 on: January 23, 2013, 05:49:28 AM »
i always do '-ls' first before the '-delete' to make sure i want to delete what it finds.....
*nix is not forgiving when deleting files...
Unlike the other operating systems, you are actually expected to know something about what you are doing.  That's one of the things that I really like about Linux, it doesn't try to save me from myself.

If I want to do a rm -rf * then it will allow me to do it.
F_M
Check out my blogs at The Homestead Fritz and Camping With Fritz

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #24 on: January 23, 2013, 02:07:31 PM »
If I want to do a rm -rf * then it will allow me to do it.
and then slowly die on you... whimpering and looking accusingly while doing so


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Mountain State Prepper

  • Survivalist Mentor
  • *****
  • Posts: 731
  • Karma: 11
  • Proudly owned by a yellow lab!
Re: Un-obvious Linux tricks
« Reply #25 on: January 23, 2013, 02:38:58 PM »


There are a few commands I try not to wildcard.   I do it, but try really hard to better pattern match my chown's, chmod's, rm's etc.

About a year ago we had an admin (dba) try to chmod (777) a directory in a customers home directory.   Well she had the deadly mix of "-R" and "*" and ended up chmod'ing the entire /home mount.   Ooopsie Poopsie.   Tape restore orderd.   Thank god it was a cluster and we could fail over our databases....which we still had to comb over and reset permissions on.

--Montani Semper Liberi

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #26 on: January 23, 2013, 02:45:57 PM »

There are a few commands I try not to wildcard.   I do it, but try really hard to better pattern match my chown's, chmod's, rm's etc.

About a year ago we had an admin (dba) try to chmod (777) a directory in a customers home directory.   Well she had the deadly mix of "-R" and "*" and ended up chmod'ing the entire /home mount.   Ooopsie Poopsie.   Tape restore orderd.   Thank god it was a cluster and we could fail over our databases....which we still had to comb over and reset permissions on.

i had a junior admin once go into /etc and want to delete old conf files (named file.conf.old.some-date). so he did:
rm *.*
oops...... next he got to learn how to restore the main DNS server...


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/

Offline Smurf Hunter

  • Dedicated Contributor
  • ******
  • Posts: 1574
  • Karma: 42
Re: Un-obvious Linux tricks
« Reply #27 on: January 23, 2013, 03:02:19 PM »
Pipes are the bomb (pun intended?)

I do this on test servers at work all the time to blast all files ending with ".log".  As fritz mentioned, also useful for purging big core files littered across your filesystem:

Code: [Select]
find . -name "*.log" -type f | xargs rm -f
Or search and replace a string in a file (let's replace "2012" with "2013":

Code: [Select]
cat file1.txt | sed -e 's/2012/2013/g' > file2.txt

Find number of open network sockets associated with a process:

Code: [Select]
lsof -p [b]<your PID here>[/b] | grep IPv6  | wc -l

Offline Skunkeye

  • Dedicated Contributor
  • ******
  • Posts: 1161
  • Karma: 70
Re: Un-obvious Linux tricks
« Reply #28 on: January 23, 2013, 04:55:35 PM »
Code: [Select]
cat file1.txt | sed -e 's/2012/2013/g' > file2.txt

Many "sed" implementations have a "-i" or "--in-place" flag that lets you process the file in place, without doing all that redirection.  You can do: 
Code: [Select]
sed -i -e 's/2012/2013/g' file1.txt
to just do the search-and-replace in file1.txt.  GNU sed lets you specify an extension that will automatically backup the original file:

Code: [Select]
sed -i.bak -e 's/2012/2013/g' file1.txt
This will replace 2012 with 2013 in file1.txt and create a backup file "file1.txt.bak" before it modifies the original file.

Another handy command is "fuser" - give it a filename, and it will tell you any processes that currently are using that file.  With the "-m" flag, it will tell you any processes that have any files open on the filesystem you specify.  Handy if you need to unmount a disk and can't because some process has a file locked open.
"The Constitution is not an instrument for the government to restrain the people; it is an instrument for the people to restrain the government - lest it come to dominate our lives and interests.” - Patrick Henry

Offline Stinkie Archer

  • Not in a good mood, watch out! Might explode if shaken!
  • Administrator
  • Ultimate Survival Veteran
  • *******
  • Posts: 13068
  • Karma: 285
    • Journey to Greener Pastures
Re: Un-obvious Linux tricks
« Reply #29 on: January 23, 2013, 05:12:55 PM »
Code: [Select]
find . -name "*.log" -type f | xargs rm -f
and you can prob use -delete instead of piping to xargs to delete the files.


From a friend: Benjamin Franklin once said that beer is proof that God loves us.
I'm of the opinion that Redheads are proof that, contrary to popular belief, Satan also loves us.
My small blog: http://journeytogreenerpastures.blogspot.com/