Skip to content

Commit

Permalink
Final Markdown cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
krmaxwell committed Mar 12, 2017
1 parent d2946a4 commit 6204a4a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ Once we make the request, though, we need to handle possible errors. We should p
I suppose this could be rewritten as a class but that seems like one level of abstraction too far. And procedural programming can never go out of style.

{% highlight python %}
# Utility function to get a URL with error handling
# Accepts URL string or urllib2.Request object
def get_url(orig_request):
# Utility function to get a URL with error handling
# Accepts URL string or urllib2.Request object

if isinstance(orig_request, basestring):
url = orig_request.encode('utf8')
request = urllib2.Request(url)
Expand Down
2 changes: 1 addition & 1 deletion _posts/2015-03-10-advice-cfp-responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Presenting your research or a solid explanation of little-understood techniques
# External references

- [Writing the CFP](http://speaking.io/plan/writing-a-cfp/) (Zach Holman)
- [4 Tips to Get a Conference "Call for Papers" Submission Accepted](http://blog.whitehatsec.com/4-tips-to-get-a-conference-call-for-papers-submission-accepted/) (Jeremiah Grossman)
- [4 Tips to Get a Conference \"Call for Papers\" Submission Accepted](http://blog.whitehatsec.com/4-tips-to-get-a-conference-call-for-papers-submission-accepted/) (Jeremiah Grossman)
- [How do I make my CFP stand out?](https://www.defcon.org/html/links/dc-speakerscorner.html#nikita-cfp) (Nikita)
- [Create Good Security CFP Responses](http://hexsec.blogspot.com/2012/12/create-good-security-cfp-responses.html) (Nathan Hamiel)
- [The Hierarchy of Information Security Talks](https://danielmiessler.com/blog/hierarchy-information-security-talks/) (Daniel Miessler)
Expand Down
2 changes: 1 addition & 1 deletion _posts/2015-03-17-breach-dodecahedron.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "The Breach Dodecahedron"
categories: Security, Guest Blog
---

_This post was written by guest blogger and broham extraordinaire [Kevin "@bfist" Thompson](https://twitter.com/bfist). For more ramblings on risk management and pro wrestling, go follow him!_
_This post was written by guest blogger and broham extraordinaire [Kevin \"@bfist\" Thompson](https://twitter.com/bfist). For more ramblings on risk management and pro wrestling, go follow him!_

I spend a lot of my time reading breach reports for publicly disclosed incidents or reading reports from forensic organizations about security breaches. A while back I noticed that our industry seems to have a fascination with geometry. For example, we have the CIA triad, which later gave rise to the Parkerian hexad, and as I was going over an old [Trustwave Global Security Report](http://www2.trustwave.com/rs/trustwave/images/2013-Global-Security-Report.pdf) I saw that they decided to change their breach triangle into a breach quadrilateral so that their model would better reflect the data they were seeing. But in the security field, more is better; why have four sides or six sides when you can have 12? Why have a two-dimensional shape when you can have a three-dimensional shape? And so it is with tongue firmly in cheek that I present the Breach Dodecahedron.

Expand Down
8 changes: 4 additions & 4 deletions _posts/2015-04-03-python-tricks-counting.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Python has a lot of data types that make working with data sets a real pleasure.

So imagine you're processing some data and you want to count how often you see certain objects (like strings in a list). This gets unwieldy quickly, especially if you have additional associated logic. But `collections.Counter()` provides a handy Pythonic way to implement this pattern.

## Old and busted
## Old and busted: if/else

{% highlight python %}
counts = dict()
Expand All @@ -30,7 +30,7 @@ for each in data:
counts[each] =1
{% endhighlight %}

## New hotness
## New hotness: Counter

{% highlight python %}
counts = collections.Counter()
Expand All @@ -44,15 +44,15 @@ for each in data:

We can simplify this even further with a _list comprehension_. In general, you place a `for` loop inside a pair of square brackets, with the expression for each result at the beginning.

## Old and busted
## Old and busted: multiple lines

{% highlight python %}
counts = collections.Counter()
for each in data:
counts[each] += 1
{% endhighlight %}

## New hotness
## New hotness: one line

{% highlight python %}
[counts[each]+=1 for each in data]
Expand Down
2 changes: 1 addition & 1 deletion _posts/2015-04-07-python-tricks-setdefault.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Python tricks: dictionary, setdefault, and addict"
categories: Python, Programming
---

_This post was written by guest blogger [Kevin "@bfist" Thompson](https://twitter.com/bfist) who is too lazy to start his own blog and just camps out on others like a homeless bass player crashing on friend's couches. Second in an occasional series._
_This post was written by guest blogger [Kevin \"@bfist\" Thompson](https://twitter.com/bfist) who is too lazy to start his own blog and just camps out on others like a homeless bass player crashing on friend's couches. Second in an occasional series._

One of the cooler things I get to tell people is that I'm one of the people behind the [VERIS Framework](https://github.com/vz-risk/veris) and the [VERIS Community Database](https://github.com/vz-risk/vcdb). _[Ed.: NERD!]_ VERIS is a schema for describing information security incidents that affect an organization and incidents are represented as JSON objects. This means that I spent a lot of time in Python manipulating dictionaries. I've picked up a couple of methods that are pretty helpful.

Expand Down

0 comments on commit 6204a4a

Please sign in to comment.