2 Year Code Challenge

 

Starting November 1, 2015 I will be embarking on a 2 year code challenge. The goal of this is to learn something new every day or improve and increase my knowledge in the art of programming, either through learning some new programming nuance, to continuing with my current projects or even tackling new projects as I find new things I want to accomplish and solve.

I hope to update this page every day with a running commentary of my progress, If you have any suggestions on things you think would be fun for me to tackle during the challenge just contact me.


2YCC Day 70

01/14/2016 - buBBle server coding

Starting to flesh out the server side part of the code, split into 3 threads: 'Authenticate', 'Post', 'Pull' and they each do the following:

  • Authenticate: Pretty self explanatory, handles the user authentication.
  • Post: Handles new posts, adds them to relevant database.
  • Pull: Handles delivery of post/message pull requests from client.

Speaking of which starting to set up the PostgreSQL databases to handles all of this, with 1 database handling users, and each 'board' getting its own database, i'm hoping in using this tactic to be able to scale the number of boards available to the users.


2YCC Day 68

01/12/2016 - Secure BBS has a name: buBBle

So beyond maybe 1 more widget the client GUI is complete and I am relatively happy with it (UX/UI designer I am not) but now I am ready to start developing the server code (including setting up all the database related activities too).

I have also roughly drawn up the 'guts' of the client on paper, broken down into I think 4 functions 'authenticate', 'send message', 'pull messages' and 'new message check', with 'send message' and 'new message check' ultimately invoking 'pull messages'


2YCC Day 66

01/10/2016 - Dropping the ball.

So I dropped the ball on consecutive days, not precisely what I wanted to do but I guess at least I'm continuing now, Today I built a simple 'dev-snip' app to check to see if a server is pingable, similar to my earlier app, but this time it is actually running threaded checking the server every 10 seconds to see if it is up and reflecting the status of server connectivity with a graphical element. this code can (should) be directly usable in my client app for the secured BBS.

I also nailed down the ports I will be using for each of the functions I have identified the client will be doing, with this in mind I can start to write the individual pieces of the server-side code that those functions will interface with.


2YCC Day 61/62/63/64/65

01/04/2016 - Learning DNS/Bind & Chef

I rounded out the final day of 2015 with a few bits of code for checking if I can reach a server, this will be used in my encrypted chat client for the BBS as I want a visual indicator on the client to check if the server is up.

After that I moved onto a new subject of interest which I just never pushed myself to do until now when it would be exceedingly useful for work and personal reasons and that is DNS. I have set up a Bind server on a CentOS 7 box here at home that I am not only using for recursive lookups and caching but also it houses my in-house metacache zone as well. I have handled making changes to an existing bind server deployment but making one from scratch has been a fun if challenging task, and one which I am very glad I finally completed.

Now I am learning about Chef for use with automation and configuration management, while I have used puppet in my current work position a lot of career positions available at this current time also specify Chef, so I am going to use this time to learn about Chef, to deploy it to my machines at home so I at least have a good basic grasp on what it can do and how can use it.

I will also soon be looking into how to set up my own yum repository as well as how to build packages and such (Basically I am looking to fill all the knowledge i'm missing on Sysadmin/SRE duties which my current position has not and will not give me due to the inflexible operational structure currently used.)


2YCC Day 61/62/63/64/65

01/04/2016 - Learning DNS/Bind & Chef

I rounded out the final day of 2015 with a few bits of code for checking if I can reach a server, this will be used in my encrypted chat client for the BBS as I want a visual indicator on the client to check if the server is up.

After that I moved onto a new subject of interest which I just never pushed myself to do until now when it would be exceedingly useful for work and personal reasons and that is DNS. I have set up a Bind server on a CentOS 7 box here at home that I am not only using for recursive lookups and caching but also it houses my in-house metacache zone as well. I have handled making changes to an existing bind server deployment but making one from scratch has been a fun if challenging task, and one which I am very glad I finally completed.

Now I am learning about Chef for use with automation and configuration management, while I have used puppet in my current work position a lot of career positions available at this current time also specify Chef, so I am going to use this time to learn about Chef, to deploy it to my machines at home so I at least have a good basic grasp on what it can do and how can use it.

I will also soon be looking into how to set up my own yum repository as well as how to build packages and such (Basically I am looking to fill all the knowledge i'm missing on Sysadmin/SRE duties which my current position has not and will not give me due to the inflexible operational structure currently used.)


2YCC Day 57/58/59/60

12-30-2015 - Ruby Codecademy, Secure BBS, Github

It may sound like i'm repeating myself (which I kind of am) but I'm still working on Codecademy's Ruby course as well as the secure BBS system I am looking to build out. I also added some of my projects to github simply so they have more exposure.


2YCC Day 55/56

12-26-2015 - Ruby Codecademy and Project planning (cont)

I'm still working on the Codecademy Ruby course, Enjoying the subtle differences between python and Ruby, I am also working on the GUI for the BBS Client, which right now is very similar to the CryptoChat gui, once that is complete I will start to work on the server code and PostgreSQL database side of things to store user data as well as post data.


2YCC Day 53/54

12-24-2015 - Ruby Codecademy and Project planning

In a turn of events the last couple of days I have started to work on CodeCademy's Ruby course to hopefully get a good grasp of Ruby, I won't go into any further details right now but I will say hopefully it will pay off bit in the long term!

I also narrowed down my latest project which is going to be an encrypted Bulletin Board system (a Client and server) which will allow multiple clients to post to a shared board (like other collaborative service such as Slack) but all data encrypted, This project is to expand my PostgreSQL abilities with multiple tables and how they interrelate. The below is how I currently map out a project once I get the idea, it probably isn't the most efficient way to map out a project but for me right now it works great!

 


2YCC Day 51/52

12-22-2015 - Future Project planning

I will be honest, not much actual coding has been done the last couple of days, but what I have been doing is mapping out how far I want my current projects to go as well as start to sketch out the basic ideas for a few projects I have in my head, this usually involves deciding the projects purpose as well as a rough idea on what each part will do as well as any modules I believe I will be using.

I'm also gearing myself up for a long-term learning goal (the next 4 months) which I will focus a lot of my time on C++ with spare time after that going to anything else (Python).


2YCC Day 49/50

12-20-2015 - CryptoChat Part 4

So we have a working Simultaneous chat pair working without to many issues, there are still things which are really really hokey with using just 1 socket for both send and recieve.

I will probably be re-writing the whole thing again to use a socket for each connection direction (so each client has a .connect, and a .listen/.accept and the user has to manually enter the IP address of the person they want to talk to.

future goals/milestones are:

  • Have each message encrypted/decrypted twice with different keys.
  • Re-Write to utilize 2 sockets (1 each way) to try to resolve the crazy amounts of errors I am getting (including seg faults).


2YCC Day 47/48

12-18-2015 - Prototyping wxPython and Threading

The last couple of days have produced a lot of cool concept stuff in terms of GUI and small scripts that mess about with threading but nothing ground breaking that I can use quite yet for CryptoChat, but I HAVE done some simple prototyping for concurrent threading, I should be able to translate that in the next few days into something approaching a messaging app, I also messed about with wx for gui elements and am starting to nail down a design for the GUI.


2YCC Day 46

12-16-2015 - Cryptography & CryptoChat Part 3

Much progress has been made! I updated 'B' to incorporate the decrypt code that will utilize the details sent via the message block and it now successfully decrypts messagessent from 'A'.

Speaking of 'A' I cleaned up some of the debugging print statements and made it so you can input your own meesages you want sent interactively, so we are actually one step closer to an actual messaging system!

The next steps for me will either be adding the second layer of encryption/decryption or look to start writing the GUI elements I want for both ends, as always though, the more I work on a project like this the more ideas I have to expand and make this useful, so watch out for me to completley change my direction of this little project once again!

future goals/milestones are:

  • Have each message encrypted/decrypted twice with different keys.
  • Utilize threading to have script A and Script B both simultaneously send and receive messages.
  • GUI! (wxPython)


2YCC Day 45

12-15-2015 - Cryptography & CryptoChat Part 2

So the 'A' script how has a list of keys to use for the encryption key and IV, and the script is now using those keys for encryption of the message and all is ready to tackle the 'B' side of things for decryption, data is being sent via socket in a 'KEY|MESSAGE|IV' format where KEY is the location in the key list, MESSAGE is obviously the encrypted message, and IV is the location in the key list for the Initialization vector, both the KEY and IV are randomly chosen at the time the message is sent.

Next up is completing the 'B' side of the equation so I can sent an encrypted message with 'A' and have 'B' decrypt it using the values in the message format, after that I will be tackling the second encryption run code.

future goals/milestones would be:

  • Have a dictionary of encrypt keys.
  • Have each message encrypted/decrypted twice with different keys.
  • Have each message utilize a different Initialization Vector (IV).
  • Allow the user to input their own message into script A versus having the text hard-coded.
  • Utilize threading to have script A and Script B both simultaneously send and receive messages.
  • GUI! (wxPython)


2YCC Day 44

12-14-2015 - Cryptography & CryptoChat Part 1

Cryptography has always interested me as a subject, and it today's age of computers is a really important subject to know and deal with so I decided to start experimenting with this is a simple set of scripts which will hopefully blossom into something a lot more usable in a real-world situation I am currently calling CryptoChat while developing it (I'm not particularly enamoured by this name long-term).

Right now I have a script that uses a single pass phrase to encrypt a line of text and then using sockets send that to a remote host to read and then decrypt.

future goals/milestones would be:

  • Have a dictionary of encrypt keys.
  • Have each message encrypted/decrypted twice with different keys.
  • Have each message utilize a different Initialization Vector (IV).
  • Allow the user to input their own message into script A versus having the text hard-coded.
  • Utilize threading to have script A and Script B both simultaneously send and receive messages.

This project for me pretty much parallels Linus's original task switcher message board app he wrote except I am a little crazy and adding a whole lot more complexity to the situation with the cryptography thrown in there but easier in some respects as I won't be having to write device drivers from scratch to save files to disk like he wanted to do.


2YCC Day 41/42/43

12-13-2015 - Setting up a VM host, VMs and a Backup server

Boring stuff! setting up my desktop PC to be relegated to a life in the basement as a VM host server, I set up multiple VM nodes on her and now ready to be able to use them for developing the various parts of Perspective.

I also set up a raspberry pi as a backup machine and wrote a backup script using bash and rsync, I'm usually terrible at backups but with the amount of coding i'm doing on a daily basis now I don't want to lose everything I am doing.


2YCC Day 37/38/39/40

12-10-2015 - Codecademy continuation + Perspective

I'm stuck at 99% on my Codecademy Python course - it seems that one of the lesson sis bugged in some way as even though the code I wrote is right (I checked it on my local machine and it works fine so I guess 'll be stuck at 99% until they fix that particular lesson.

In other news over the last few days I set up a VM on my desktop PC with a new install of Linux, and installed PostgreSQL so that replaces my old 1st generation Raspberry Pi Model B that I was using previously. With that in place I was able to get simple authenitcation from a PoftgreSQL database up and running for Perspective, I will probably replace all of the hashlib based stuff later on with more secure code down the road but right now its a proof of concept that works!

With this part of Perspective complete (for now) I can start to work on the video streaming side of both of the scripts, and with that we are entering completely unknown territory again!


2YCC Day 33/34/35/36

12-06-2015 - Codecademy continuation

This working on Codecademy Python course, sadly I have not had much time in the evenings these last few days but the nice thing is there is topics on the Codecademy course which I am lacking knowledge about (class inheritance for example) I hope to have that wrapped up in the next couple of days and then get back to my projects (Most likely finish Drip so I can start to figure out how to integrate that functionality into Puddle)


2YCC Day 31/32

12-02-2015 - Codecademy continuation

The last couple of days I've been trying to complete the Python course on Codecademy which I had started a while ago, it is covering a lot of what I have already been using on my personal projects but I dislike leaving things incomplete.


2YCC Day 30

11-30-2015 - Perspective Refinements

I added the Save profile feature to Perspective (so my profile feature is now full circle), I also added statusbar tooltips for all the text fields for further explanation of each of the fields (in a much more elegant way than I was originally thinking (being able to set custom IDs on GUI elements and then querying which element was used to invoke the function)I will be researching what the best way to capture a desktop/screen as a video stream and a) saving to a video file, and b) broadcasting the video as a stream to a streaming server so that can transcode and re-broadcast to a player, this may involve me researching how to write some sort of add-on kludge to OpenCV so that the screen can be read from/via cv.CaptureFromCAM (which would be wonderful))


2YCC Day 27/28/29

11-29-2015 - Perspective Refinements

I updated some of Perspective's GUI and profile related things, I switched from using an XML file for streaming profiles to using configparser (much more suitable) and switched the GUI from using absolute values over to Sizers.

I'll be adding the Save profile feature to Perspective (which is a lot easier to do with configparser than an XML file, once that is complete I will be researching what the best way to capture a desktop/screen as a video stream and a) saving to a video file, and b) broadcasting the video as a stream to a streaming server so that can transcode and re-broadcast to a player.


2YCC Day 24/25/26

11-26-2015 - General Consumption

I've worked a small amount on Drip getting the hourly XML parsed but nothing hugely noteworthy, I'm still trying to decide if I want the email to be text only or some sort of HTML based.

I'm also looking at converting Perspective's GUI over to sizers, as well as using ConfigParser for Perspective's profile saving/loading instead of trying to fudge using XML, I think this will allow me to make some decent scalable progress on Perspective (which is totally not scalable in any sense of the word right now.

I'm also taking a rather ancient look at assembly programming, using the Usborne Introduction to Machine code for beginners (1983!) why? Because I want to! I remember seeing it in the library back when I was a kid but didn't have a Sinclair ZX81 or a BBC Micro at the time (I did later at one point though!) now, with the help of emulation I can finally learn from that book and hopefully apply that to assembly programming and machine coding on more modern machines.


2YCC Day 22/23

11-23-2015 - Drip development Part 2

Work has been very busy and hectic leading up to thanksgiving holiday so time to code has been low, however, I was able to get some basic structures down for Drip including setting up the API pull for the data to be included in the email blast.

I have set up the code to pull the current weather conditions into variables and for debugging purposes output it to console, next comes pulling the data from the XML and storing it in lists for each hour of the day we are going to have information for (18 hours). Once I have the data reliably being gathered from XML I'll move onto the email part of the code.


2YCC Day 21

11-21-2015 - Puddle development Part 10

Bug fixes! mainly to do with what Puddle would do it there was no config file to load from, originally this was actually handled fine but with a recent change on how the config file was loaded this totally broke and ended up rendering puddle non-operational.

At least now if there is no config file it will let you know something is wrong in console but still load the GUI so you can open up the preferences frame and add the needed info (API key, locations, etc)

I also have a mini-battle going on with using try: when you have a piece of code that could potentially throw errors, try: is great for when the code is polished which is why I'm using it but I keep having to comment the try: and except: parts out when debugging my code (which is often), not much of a struggle really but still annoying (my own doing).

Running to-do list:

  • Add weekly forecast functionality.
  • Add FAQ link & page.
  • Actually go back and add comments to everything.


2YCC Day 19/20

11-20-2015 - Drip / Puddle development Part 1/9

Not much to show for the last couple of days i'm afraid, mainly research into Python's email capabilities for Drip and Puddle, deciding how to figure out the best course for the daily email feature of puddle (which will evolve out of drip).

You will also notice that I have not released any of the source code for any of my projects yet, this is not because I want to hold onto and hide the source, I simply am looking into the available Open Source derived licenses and their benefits and drawbacks, Until there is one that I 100% am happy to use I will not be displaying source code yet.


2YCC Day 17/18

11-18-2015 - Puddle development Part 8

FAQ link is now added although the page is not up yet, Also, I have added the Hourly forecast currently set to 10 hours, once I have completed the 10-day forecast and dealt with the FAQ webpage I'll be happy to bump the version to v00.01.00.

Running to-do list:

  • Add weekly forecast functionality.
  • Add FAQ link & page.


2YCC Day 14/15/16

11-16-2015 - Puddle development Part 7

Puddle's whole GUI is now set up to use Sizers, I added the 'use current functionality in preferences so that if the locations in the main app are different than the saved locations you can use a check box to automatically populate the saved default city with what you have in the app. I also set the stage for an additional feature I've wanted to add since the beginning - Hourly and Weekly forecasts, with the refresh and settings buttons moved to the right hand side of the frame this allows me to set up new buttons for the hourly and weekly forecast!

I'm also going to change the FAQ dialog to a link to an FAQ page on this website, it makes much more sense to have an FAQ here on the site than trying to create some crazy frame with all the info I want to display.

Running to-do list:

  • Add hourly/weekly forecast functionality.
  • Add FAQ link & page.


2YCC Day 11/12/13

11-13-2015 - Puddle development Part 6

SIZERS KICK BUTT!

Sizers are one of those things you don't think about really to begin with, your app works kind of well with statically set locations but your not really happy with it, well I took the plunge on learning about sizers and I'm overjoyed to say I wish I had just started to use them from the beginning!

Everything looks and feels so much better now on my about and preferences frames, it all aligns great and everything just works! Using sizers has really changed how I think about UI programming (cliche I know but true!)

 

Running to-do list:

  • Re-Design the main app frame using sizers, long-term goal)
  • Add buttons (or a checkbox) next to the 'assets' in the preference frame to use current values from the main pane.
  • Add FAQ Dialog.


2YCC Day 9/10

11-10-2015 - Puddle development Part 5

While I managed to get the 'Use default locations' menu option working, I started developing the about dialog frame and ran into my first shortcoming in my projects so far: lack of Sizer use, so from in an effort to save myself lots of headaches in the long term I'm going to stop adding new features for Puddle for the time being and do everything the correct way and learn how to use sizers and (at first) apply sizer techniques to the about frame and then go back and utilize them on both the preference frame as well as the main frame. Once once those have been converted to using sizers will I go back to adding the rest of the features I want to incorporate.

Running to-do list:

  • Re-Design all frames to utilize sizers, starting with the About dalog.
  • Add buttons (or a checkbox) next to the 'assets' in the preference frame to use current values from the main pane.
  • Add FAQ Dialog.


2YCC Day 8

11-08-2015 - Puddle development Part 4

Fantastic progress today as I now have the application working with a config file (ability to load defaults from the config file as well as save to a config file.

As I was developing thsi current system I thought of a slight tweak to teh perferences frame, right now it lists the current default as standard, I will be adding a button next to each 'asset' on the frame to pull the currently used value from the main pane, simple to implement and valuable in my opinion.

Running to-do list:

  • Add buttons (or a checkbox) next to the 'assets' in the preference frame to use current values from the main pane.
  • Add an 'Edit > Default Locations' menu to reload to saved defaults in the app.
  • Add about Dialog.
  • Add FAQ Dialog.


2YCC Day 6/7

11-07-2015 - Puddle development Part 3

Good progress has been made on the preference frame over these 2 days, learned how to have multiple frames in an app, and functionality-wise all data is being correctly being imported into the fields on the preferences frame.

The next step is to start using ConfigParser to start writing and saving a config file which contains the Weather Underground API key, default locations, refresh rates, and email address for daily weather alerts and this will be done tomorrow.

Running to-do list:

  • Create config file schema.
  • Add the ability to load defaults from the config file into the Main/Preferences frame.
  • Add the ability to save defaults from the preferences frame to the config file.
  • Add an Edit > Default Locations menu to return to saved defaults in the app.
  • Add about Dialog.
  • Add FAQ Dialog.


2YCC Day 4/5

11-05-2015 - Website Tweaks

The last couple of days have ultimately been used to do some slight tweaks to the website, nothing exciting i'm afraid!.


2YCC Day 2/3

11-03-2015 - Puddle development Part 2

Much larger gains were made on Day 2 and 3, with the app now able to handle 3 locations, each able to be assigned and refreshed independently of each other.

Right now in the immediate couple of days I want to add the following functionality:

  • Add 'Edit' menu with a 'Preferences' menu item.
  • Add the ability to set the 3 custom default location from the preferences pane.
  • Add auto-refreshing of data on a customizable interval.
  • Add about Dialog
  • Add FAQ Dialog


2YCC Day 1

11-01-2015 - Puddle development

Small steps forward are a good thing (better than steps backward!) and today I started the process of increasing the functionality of Puddle which is a weather app I am writing to increase my Python knowledge as well as general API interfacing.

Right now I am building out the updated GUI elements to allow for multiple locations to be tracked at the same time, this means that instead of the app having a single field to input a ZIP/Post code/Country-City each location will have its own settings dialog. I will be setting just 1 location up with this system initially and once I have worked out al the kinks in this I will then expand it to include more locations.

Today was all about wx.StaticBitmap and wx.BitmapButton, what I can do with them and their limitations as these will now play a larger part in handling the app's input.


 
 

Copyright © 2015, Leigh Burton