33 lines
1,001 B
Markdown
33 lines
1,001 B
Markdown
---
|
|
layout: post
|
|
title: "day 1"
|
|
date: 2018-01-01
|
|
categories: programming
|
|
---
|
|
# 100 Days of Code
|
|
|
|
With a brand new year, comes a fresh start, a clean slate. I am going to begin
|
|
my new year with something I have just come across: [100daysofcode](http://100daysofcode.com/) challenge.
|
|
I have forked the 100 days of code repo from github and am using the log to
|
|
track my daily progress. It will be fun, and it will be a great way to keep me
|
|
accountable for building my python knowledge. Here is an example snippet from
|
|
the code I did for day 1.
|
|
|
|
### Day 1:
|
|
{% highlight python %}
|
|
|
|
def gen_ssh_keypair():
|
|
""" Generate an RSA private / public keypair """
|
|
key = RSA.generate(2048)
|
|
|
|
# generate private key - output to file
|
|
with open('rsa_privkey.pem', 'wb') as privkey:
|
|
privkey.write(key.exportKey())
|
|
|
|
# generate public key - output to file
|
|
with open('rsa_pubkey.pem', 'wb') as pubkey:
|
|
pubkey.write(key.publickey().exportKey())
|
|
|
|
return 0
|
|
|
|
{% endhighlight %}
|