{"id":247,"date":"2012-09-28T12:49:57","date_gmt":"2012-09-28T04:49:57","guid":{"rendered":"http:\/\/play.datalude.com\/blog\/?p=247"},"modified":"2012-09-28T12:50:11","modified_gmt":"2012-09-28T04:50:11","slug":"viewing-heavily-commented-config-files","status":"publish","type":"post","link":"https:\/\/play.datalude.com\/blog\/2012\/09\/viewing-heavily-commented-config-files\/","title":{"rendered":"Viewing heavily commented config files"},"content":{"rendered":"<p>Just a quick one, as I haven't posted for a while. This is a cool trick for getting the juice out of heavily commented files. In particular I used this on \/etc\/samba\/smb.conf, but also good for apache2.conf, php.ini etc. The magic is this.<\/p>\n<pre>grep -v -e \"^#\" -e \"^;\" -e \"^$\" \/etc\/samba\/smb.conf<\/pre>\n<p>Basically, ignore all lines starting with comments, and all blank lines.<\/p>\n<p>Then, if you really want to get fancy, you can alias it to a command like this:<\/p>\n<pre>alias grepc='grep -v -e \"^#\" -e \"^;\" -e \"^$\"'<\/pre>\n<p>So all you have to type now is<\/p>\n<p>grepc \/path\/file.conf<\/p>\n<p>Sweet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a quick one, as I haven't posted for a while. This is a cool trick for getting the juice out of heavily commented files. In particular I used this on \/etc\/samba\/smb.conf, but also good for apache2.conf, php.ini etc. The magic is this. grep -v -e \"^#\" -e \"^;\" -e \"^$\" \/etc\/samba\/smb.conf Basically, ignore all &#8230; <a title=\"Viewing heavily commented config files\" class=\"read-more\" href=\"https:\/\/play.datalude.com\/blog\/2012\/09\/viewing-heavily-commented-config-files\/\" aria-label=\"Read more about Viewing heavily commented config files\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1,4],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-it","category-linux"],"_links":{"self":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":0,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"wp:attachment":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}