Loading mentions Retweet

Posted 8 hours ago
August 30th, 5:17pm 0 comments

How could it not be delicious?

Loading mentions Retweet

Posted 3 days ago from Evanston, IL
August 27th, 8:42am 0 comments

"gem install cheat" and then...

Welcome. You've reached the central repository for cheat, the RubyGem which puts cheat sheets right into your terminal. The inaugural blog entry is here.

Get started:

$ sudo gem install cheat
$ cheat strftime

A magnificent cheat sheet for Ruby's strftime method will be printed to your terminal.

To get some help on cheat itself:

$ cheat cheat

How meta.

Cheat sheets are basically wiki pages accessible from the command line. You can browse, add, or edit cheat sheets. Try to keep them concise. For a style guide, check out the cheat cheat sheet.

To access a cheat sheet, simply pass the program the desired sheet's name:

$ cheat <sheet name>

Loading mentions Retweet

Posted 6 days ago
August 26th, 2:55pm 0 comments

I lost again! And now you have too :)

Loading mentions Retweet

Posted 7 days ago
August 26th, 10:35am 0 comments

It's funny because it's true.

Loading mentions Retweet

Posted 7 days ago
August 26th, 6:54am 0 comments

The Hardest Logic Puzzle Ever

From Wikipedia, the free encyclopedia

The Hardest Logic Puzzle Ever is a title coined by American philosopher and logician George Boolos in an article published in The Harvard Review of Philosophy (an Italian translation was published earlier in the newspaper La Repubblica, under the title L'indovinello più difficile del mondo) for the following Raymond Smullyan inspired logic puzzle:

Three gods A, B, and C are called, in some order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are 'da' and 'ja', in some order. You do not know which word means which.

Boolos provides the following clarifications:[1]

  • It could be that some god gets asked more than one question (and hence that some god is not asked any question at all).
  • What the second question is, and to which god it is put, may depend on the answer to the first question. (And of course similarly for the third question.)
  • Whether Random speaks truly or not should be thought of as depending on the flip of a coin hidden in his brain: if the coin comes down heads, he speaks truly; if tails, falsely.
  • Random will answer 'da' or 'ja' when asked any yes-no question.[1]


This almost made my head explode. Try solving it without reading the solution. Good luck!

Loading mentions Retweet

Posted 7 days ago
August 24th, 8:48am 0 comments

Nicer assertion framework ("Wrong") for Ruby

Algorithm

So wait a second. How do we do it? Doesn't Ruby have poor support for AST introspection? Well, yes, it does, so we cheat: we figure out what file and line the assert block is defined in, then open the file, read the code, and parse it directly using Ryan Davis' amazing RubyParser and Ruby2Ruby. You can bask in the kludge by examining chunk.rb and assert.rb. If you find some code it can't parse, please send it our way.

Before you get your knickers in a twist about how this is totally unacceptable because it doesn't support this or that use case, here are our caveats and excuses:

  • It works! Tested in 1.8.6, 1.8.7, 1.9.1, and 1.9.2-rc2. (Thank you, rvm!)
  • Your code needs to be in a file. That means it doesn't work in IRB. (If you're developing Ruby code without saving it to a mounted disk, then sorry, Wrong is not right for you.)
  • It's a development-time testing library, not a production runtime library, so there are no security or filesystem issues.
  • eval isn't evil, it's just misunderstood.
  • It makes a few assumptions about the structure of your code, leading to some restrictions:
    • You can't have more than one call to assert per line. (This should not be a problem since even if you're nesting asserts for some bizarre reason, we assume you know where your Return key is. And actually, technically you can put two asserts on a line, but it always describes the first one it sees, which means that if the second one executes, its failure message will be incorrect or broken.)
    • You can't use metaprogramming to write your assert blocks.
    • All variables and methods must be available in the binding of the assertion block.

This is a very slick hack. I'm gonna go play with this.

Loading mentions Retweet

Posted 9 days ago
August 21st, 9:00am 0 comments

A list of historical security holes in ranked order of severity

MetricIDDate
Public
Name
142.5VU#19160903/29/2007Microsoft Windows animated cursor stack buffer overflow
108.16VU#1653211/10/1999BIND T_NXT record processing may cause buffer overflow
104.73VU#4187004/03/1999Sun Solstice AdminSuite ships with insecure default configuration
99VU#94521602/08/2001SSH CRC32 attack detection code contains remote integer overflow
94.5VU#25423609/10/2003Microsoft Windows RPCSS Service contains heap overflow in DCOM request filename handling
94.5VU#48349209/10/2003Microsoft Windows RPCSS Service contains heap overflow in DCOM activation routines
90.97VU#16245104/20/2004Cisco IOS fails to properly process solicited SNMP operations
89.5VU#15022702/19/2002HTTP proxy default configurations allow arbitrary TCP connections
88.2VU#82726710/23/2008Microsoft Server service RPC stack buffer overflow vulnerability
87.72VU#2982306/23/2000Format string input validation error in wu-ftpd site_exec() function
81VU#564807/27/1998Buffer Overflows in various email clients
79.65VU#97047204/04/2001Network Time Protocol ([x]ntpd) daemon contains buffer overflow in ntp_control:ctl_getitem() function
79.31VU#78954305/14/2001IIS decodes filenames superfluously after applying security checks
78.75VU#56814807/16/2003Microsoft Windows RPC vulnerable to buffer overflow
78VU#11739403/17/2003Buffer Overflow in Core Microsoft Windows DLL
78VU#25716407/11/2006Microsoft DHCP Client service contains a buffer overflow
76.5VU#32307011/25/2003Outlook Express MHTML protocol handler does not properly validate source of alternate content
74.81VU#74537107/18/2001Multiple vendor telnet daemons vulnerable to buffer overflow via crafted protocol options
73.5VU#41133207/16/2003Cisco IOS Interface Blocked by IPv4 Packet
73.1VU#2893412/14/1999Sun Solaris sadmind buffer overflow in amsl_verify when requesting NETMGT_PROC_SERVICE
72.9VU#94019307/10/2010Microsoft Windows automatically executes code specified in shortcut files
72.14VU#49388112/09/2008Microsoft Internet Explorer data binding memory corruption vulnerability
69.3VU#95233606/18/2001Microsoft Index Server/Indexing Service used by IIS 4.0/5.0 contains unchecked buffer used when encoding double-byte characters
69.25VU#10718602/12/2002Multiple vulnerabilities in SNMPv1 trap handling
69.25VU#75304407/18/2006Microsoft Windows WebViewFolderIcon ActiveX integer overflow
68.84VU#34314505/08/2007Microsoft Exchange Server fails to properly decode MIME email messages
68.4VU#11167710/10/2000Microsoft IIS 4.0 / 5.0 vulnerable to directory traversal via extended unicode in url (MS00-078)
67.5VU#59189012/18/2002Buffer overflow in Microsoft Windows Shell
67.5VU#88187202/10/2007Sun Solaris telnet authentication bypass vulnerability
67.2VU#89760403/29/2003Sendmail address parsing buffer overflow

  Vulnerability Notes By Metric
Notes 1 - 30 of 2649
Next Page

 

Last Page

 


I'm not sure why I find this list so appealing (it's attempt to rank these things, the sheer quantity of Microsoft (though as % of installed base, it may be fairly represented, I'm not sure), the quantity of the list, the breadth/depth of it, etc.).

Loading mentions Retweet

Posted 12 days ago
August 12th, 11:44am 0 comments

Make sure to run PDF Patch if you jailbreak your iPhone

assuming you've jailbroken, you should then do this as it will close the hole that allowed the jailbreak (and then you don't have to stress about upgrading to 4.0.2)

Loading mentions Retweet

Posted 21 days ago
August 9th, 7:41am 0 comments

great paper on the dangers of concurrency and modern architectures

The paper itself is about C++ and the Perils of Double-Checked Locking.  It's useful to read even if you don't write (or know C++), because it reminds you of the genius/perils of optimizing compilers and the various issues with SMP.  It's also very funny (no really, not just Comic Book Guy funny, but genuinely funny).  

It's by Scott Meyers, of Effective C++ fame.  Check out his other writings too.

Filed under c++ concurrency patterns
Loading mentions Retweet

Posted 24 days ago