Monday, August 24, 2015

last file modified

 last file modified  
   
 # ls -lrt * |tail -l  
   
 -rw-r--r-- 1 root root 2060 2013-01-18 02:09 pre-lock.tmpl  
 -rwxr-xr-- 1 root root 2764 2013-01-18 02:09 pre-revprop-change  
 -rw-r--r-- 1 root root 2764 2013-01-18 02:09 pre-revprop-change.tmpl  
 -rw-r--r-- 1 root root 2001 2013-01-18 02:09 pre-unlock.tmpl  
 -rw-r--r-- 1 root root 2137 2013-01-18 02:09 start-commit.tmpl  
   
 locks:  
 total 8  
 -rw-r--r-- 1 root root 139 2013-01-18 02:09 db-logs.lock  
 -rw-r--r-- 1 root root 139 2013-01-18 02:09 db.lock  
   
 guess what i'm looking at.  

 this is a recursive search using stat

 # find $1 -type d -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | head

Tuesday, August 18, 2015

how not to go to hell or run named commands


some times is to good to named-checkzone before you commit those changes to bind.
  
i have a little script that issues named-checkzone on my zone off of the db. 
i do this for forward and reverse zones.  
   
 ...  
 #!/bin/bash  
   
 echo aplace forward  
 named-checkzone aplace.calledhell.com db.aplace.calledhell.com  
   
 echo anotherplace forward  
 named-checkzone anotherplace.calledhell.com db.anotherplace.calledhell.com  
   
 echo 6.66 reverse  
 named-checkzone 66.6.10.in-addr.arpa db.10.6.66  
   
 echo 6.67 reverse  
 named-checkzone 67.6.10.in-addr.arpa db.10.6.67  
 ...  
   
 and then i will load everything and tail my syslog for any lingering errors in another terminal.  
   
 ...  
   
 #!/bin/bash  
   
 echo 6.66 reverse  
 rndc reload 66.6.10.in-addr.arpa  
   
 echo 6.67 reverse  
 rndc reload 67.6.10.in-addr.arpa  
   
 echo aplace forward  
 rndc reload aplace.calledhell.com  
   
 echo anotherplace forward  
 rndc reload anotherplace.calledhell.com  
   
 ...  
   
i heart doing this domain by domain and subnet by subnet so i am not in a place called hell.
i mentioned keep another terminal open, right?  

Tuesday, August 11, 2015

 crap.  
   
 my nfs mount keeps not mounting when i reboot my system. oh, hey, just add _netdev .  
   
 exoticnfsserver:/somewhere/nice     /localmountpoint     nfs   rsize=8192,wsize=8192,soft,_netdev   0 0  
   
 yissss.