<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 10 Jun 2026 03:44:47 +0000</lastBuildDate>
    <item>
      <title>(Bash) Summarize TCP socket states (using netstat) - scarfboy</title>
      <link>https://snipplr.com/view/7832/summarize-tcp-socket-states-using-netstat</link>
      <description>&lt;p&gt;Filters for tcp and tcp6 lines, so omits udp and unix sockets.&#13;
&#13;
Information is gathered from /proc; this uses netstat mainly to format it.&#13;
&#13;
Gives output like:&lt;tt&gt;&lt;pre&gt;     21 tcp LISTEN&#13;
     12 tcp ESTABLISHED&#13;
      7 tcp6 LISTEN&#13;
      1 tcp TIME_WAIT&lt;/pre&gt;&lt;/tt&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 12 Aug 2008 10:08:34 UTC</pubDate>
      <guid>https://snipplr.com/view/7832/summarize-tcp-socket-states-using-netstat</guid>
    </item>
    <item>
      <title>(Bash) bash lines for simple statistics on SSH break-in attempts - scarfboy</title>
      <link>https://snipplr.com/view/7675/bash-lines-for-simple-statistics-on-ssh-breakin-attempts</link>
      <description>&lt;p&gt;Assumes logs are in /var/log/sshd/* and makes a few text format assumptions that probably make this specific to OpenSSH.&#13;
&#13;
Simple, but more than you can see from a quick less.&lt;/p&gt;</description>
      <pubDate>Sat, 02 Aug 2008 12:50:13 UTC</pubDate>
      <guid>https://snipplr.com/view/7675/bash-lines-for-simple-statistics-on-ssh-breakin-attempts</guid>
    </item>
    <item>
      <title>(CSS) slightly lowered inline icons - scarfboy</title>
      <link>https://snipplr.com/view/7356/slightly-lowered-inline-icons</link>
      <description>&lt;p&gt;Icons placed in text usually look like they jut upwards. A little negative vertical-align will put these images roughly in the ascender-to-descender space.&#13;
&#13;
Simple and sort of stupid, but probably still useful to know.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Jul 2008 07:17:28 UTC</pubDate>
      <guid>https://snipplr.com/view/7356/slightly-lowered-inline-icons</guid>
    </item>
    <item>
      <title>(Python) remove diacritics - scarfboy</title>
      <link>https://snipplr.com/view/7355/remove-diacritics</link>
      <description>&lt;p&gt;Useful when creating canonical forms of strings for indexing.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Jul 2008 06:51:47 UTC</pubDate>
      <guid>https://snipplr.com/view/7355/remove-diacritics</guid>
    </item>
    <item>
      <title>(Python) Get Home directory path  in Python (win, lin, other?) - scarfboy</title>
      <link>https://snipplr.com/view/7354/get-home-directory-path--in-python-win-lin-other</link>
      <description>&lt;p&gt;The current user's home directory is probably the easiest way to get a writeable directory, and expanduser does the sensible thing on various OSes. &#13;
&#13;
In case of windows, you can choose to be smarter about *which* directory you pick.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Jul 2008 06:48:25 UTC</pubDate>
      <guid>https://snipplr.com/view/7354/get-home-directory-path--in-python-win-lin-other</guid>
    </item>
    <item>
      <title>(JavaScript) Javascript add-to-bookmarks (Firefox, IE) - scarfboy</title>
      <link>https://snipplr.com/view/7351/javascript-addtobookmarks-firefox-ie</link>
      <description>&lt;p&gt;There is no standard for this at all - this just looks for the hooks that exist in IE and gecko-type browsers.&#13;
See also http://msdn.microsoft.com/en-us/library/ms535926(VS.85).aspx and http://developer.mozilla.org/en/docs/DOM:window.sidebar&lt;/p&gt;</description>
      <pubDate>Thu, 17 Jul 2008 06:40:45 UTC</pubDate>
      <guid>https://snipplr.com/view/7351/javascript-addtobookmarks-firefox-ie</guid>
    </item>
    <item>
      <title>(JavaScript) Javascript  array member tests - scarfboy</title>
      <link>https://snipplr.com/view/7349/javascript--array-member-tests</link>
      <description>&lt;p&gt;Given:&#13;
`a=['1',2,6];`&#13;
&#13;
Allows things like:  &#13;
`&#13;
  a.contains(2); //true  &#13;
  '1'.in(a);  &#13;
  (1).in(a,true); //type not identical, so false  &#13;
  (1).in(a);      //no type check, so true  &#13;
`  &#13;
  &#13;
I never actually used this, it was more of an exercise in playing with JS.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Jul 2008 06:34:58 UTC</pubDate>
      <guid>https://snipplr.com/view/7349/javascript--array-member-tests</guid>
    </item>
    <item>
      <title>(JavaScript) Javascript  set(-of-string) functions - scarfboy</title>
      <link>https://snipplr.com/view/7348/javascript--setofstring-functions</link>
      <description>&lt;p&gt;Exploits hash keys uniqueness, but in doing so effectively toString()s everything, meaning this should not be used for much beyond strings and perhaps integers.&#13;
&#13;
I used this when I wanted to do some client-side filtering of (integer) identifiers.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Jul 2008 06:31:03 UTC</pubDate>
      <guid>https://snipplr.com/view/7348/javascript--setofstring-functions</guid>
    </item>
  </channel>
</rss>
