{"id":603,"date":"2012-11-16T11:49:57","date_gmt":"2012-11-16T16:49:57","guid":{"rendered":"https:\/\/infotechguy.net\/?p=603"},"modified":"2025-02-22T12:44:18","modified_gmt":"2025-02-22T17:44:18","slug":"easylist-to-squidguard-expression-list-conversion","status":"publish","type":"post","link":"https:\/\/infotechguy.net\/?p=603","title":{"rendered":"Linux &#8212; Squid Proxy, EasyList to SquidGuard Expression List"},"content":{"rendered":"<p>Hi all! It&#8217;s seems to be difficult to keep up with the <a title=\"http:\/\/easylist.adblockplus.org\/en\/\" href=\"http:\/\/easylist.adblockplus.org\/en\/\" target=\"_blank\" rel=\"noopener noreferrer\">EasyList expression lists<\/a>, and to make matters more confusing, the conversion from one EasyList expression list to SquidGuard can be cumbersome. There are a few article out on Google that people have posted their own <a title=\"http:\/\/en.wikipedia.org\/wiki\/Sed\" href=\"http:\/\/en.wikipedia.org\/wiki\/Sed\" target=\"_blank\" rel=\"noopener noreferrer\">SED <\/a>files to convert from EasyList to squidGuard, that will manipulate the EasyList expression list and convert it to be compatible with SquidGuard. However, most are outout of date and will cause squidGuard to fail to initialize the expression list when issuing a<\/p>\n<pre class=\"brush:bash\">&gt;squidGuard -C all<\/pre>\n<p><!--more--><br \/>\nI found a <a title=\"https:\/\/sites.google.com\/site\/uttools\/squid-adblocker\" href=\"https:\/\/sites.google.com\/site\/uttools\/squid-adblocker\" target=\"_blank\" rel=\"noopener noreferrer\">site whose owner (I believe)<\/a> has developed a new SED file that will parse through the latest easylist.txt expression list file and convert it successfully. The site appears to be in Russian, and Google Translate is not able to translate it. Therefore, the purpose of this article is to increase the authors visibility of their SED file.<\/p>\n<p><strong>NOTICE:<\/strong> I am not the owner of the SED file below, no do I take any responsibility for it&#8217;s use and distribution.<br \/>\nFrom <a title=\"https:\/\/sites.google.com\/site\/uttools\/squid-adblocker\" href=\"https:\/\/sites.google.com\/site\/uttools\/squid-adblocker\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/sites.google.com\/site\/uttools\/squid-adblocker<\/a><\/p>\n<pre><code>s\/r\/\/g;\n\/Adblock\/d;\n\/.*$.*\/d;\n\/n\/d;\n\/.*#.*\/d;\n\/@@.*\/d;\n\/^!.*\/d;\n\/^[.*]$\/d;\ns#http:\/\/#||#g;\ns\/\/\/\/||\/g\ns,[+.?&amp;\/|],\\&amp;,g;\ns\/[\/\\[\/g\ns\/]\/\\]\/g\ns#*#.*#g;\ns,$.*$,,g;\ns\/\\|\\|(.*)^(.*)\/.1\\\/2\/g;\ns\/\\|\\|(.*)\/.1\/g;\n\/^.*$\/d;\n\/^$\/d;<\/code><\/pre>\n<p>Download the latest easylist.txt expression list.<br \/>\n<a title=\"https:\/\/easylist-downloads.adblockplus.org\/easylist.txt\" href=\"https:\/\/easylist-downloads.adblockplus.org\/easylist.txt\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/easylist-downloads.adblockplus.org\/easylist.txt<\/a><\/p>\n<p>Commands:<\/p>\n<pre><code>cd \/tmp\nvi pattern.sed<\/code><\/pre>\n<p>&#8211;Paste in the SED pattern from above.<\/p>\n<pre><code>wget \u2013no-check-certificate https:\/\/easylist-downloads.adblockplus.org\/easylist.txt\ncat easylist.txt | sed -f pattern.sed &gt; expressions<\/code><\/pre>\n<p>Now just append or replace your current SquidGuard expression list, and don&#8217;t forget to issue a<\/p>\n<pre class=\"brush:bash\">&gt;squidGuard -C all<\/pre>\n<p>to re-initializes your block and expression lists.<\/p>\n<p><strong>Sources:<\/strong><\/p>\n<ul>\n<li><a title=\"Network Adblocking using Squid, SquidGuard, and IPtables\" href=\"https:\/\/infotechguy.net\/network-adblocking-using-squid-squidguard-and-iptables\/\">Set up Network Adblocking<\/a><\/li>\n<li><a title=\"https:\/\/easylist-downloads.adblockplus.org\/easylist.txt\" href=\"https:\/\/easylist-downloads.adblockplus.org\/easylist.txt\" target=\"_blank\" rel=\"noopener noreferrer\">EasyList<\/a><\/li>\n<li><a title=\"https:\/\/sites.google.com\/site\/uttools\/squid-adblocker\" href=\"https:\/\/sites.google.com\/site\/uttools\/squid-adblocker\" target=\"_blank\" rel=\"noopener noreferrer\">SED Author&#8217;s Site<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hi all! It&#8217;s seems to be difficult to keep up with the EasyList expression lists, and to make matters more confusing, the conversion from one EasyList expression list to SquidGuard can be cumbersome. There are&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":4240,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[111],"class_list":["post-603","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-scripting"],"_links":{"self":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=603"}],"version-history":[{"count":2,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/603\/revisions"}],"predecessor-version":[{"id":4247,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/603\/revisions\/4247"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/media\/4240"}],"wp:attachment":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}