Skip to content

Instantly share code, notes, and snippets.

@lukecampbell
Created May 20, 2015 18:11
Show Gist options
  • Save lukecampbell/ceef3d24e1b531efbdcd to your computer and use it in GitHub Desktop.
Save lukecampbell/ceef3d24e1b531efbdcd to your computer and use it in GitHub Desktop.
Professional Programming Starting Point

Python

Python Projects

One of Guido's key insights is that code is read much more often than it is written. The guidelines provided here are intended to improve the readability of code and make it consistent across the wide spectrum of Python code. As PEP 20 says, "Readability counts".

A style guide is about consistency. Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is most important.

But most importantly: know when to be inconsistent -- sometimes the style guide just doesn't apply. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask!

In particular: do not break backwards compatibility just to comply with this PEP!

Testing

Unit Tests

Unit Testing in Python

Continuous Integration

Numerical Applications

Vector math:

What's the difference between a and b in the following

import numpy as np
a = [1,2,3] + [1,2,3]
b = np.array([1,2,3]) + np.array([1,2,3])

IPython Notebooks

Data Structures and Algorithms

  • Big-Oh notation
  • Array
  • Linked-List
  • Depth-first-search (DFS)
  • Breadth-first-search (BFS)
  • Binary Tree
  • Trees
  • B-Tree
  • Hash Table (aka Dictionary)

Computational Cryptography

  • Hashing and basic Crypto
    • MD5
    • SHA
    • Difference between a Hash and Encryption like RSA or AES
    • OpenSSL
    • GnuPG2
  • Base64
    • Why is it soooo important?
    • What is used for?

Unix System Administration

  • Command Line and Terminal
  • Basic Bash Scripting
  • Must-know tools
    • nc (netcat)
    • nmap
    • ifconfig
    • ls
    • cat
    • man
    • grep
    • sed
    • tcpdump (just know that it's there and you can google your specific case)
    • passwd
    • ssh
    • dd
    • mkdir
    • find
    • locate (slocate)
    • mkfs
    • wc
    • sort

For example what does the following do:

#!/bin/bash

mkdir /tmp/textfiles
cd /tmp/textfiles
dd if=/dev/urandom of=garbage bs=1024 count=1024
cat garbage | base64 > bigfile.txt
rm garbage
  • Basic firewall with iptables
  • User Management
  • SSH
    • Passwordless SSH access with keys
    • SSH Tunneling (so important)
  • sudo and the sudoers file

Databases

Systems Programming

  1. Processes
  2. Threads
  3. Interprocess Communication (IPC)
  4. System Calls
  5. Low-level I/O
  • System Calls
  • Man page 2
  • POSIX
    • sockets
    • read(2)
    • write(2)
    • file descriptors
    • sockaddr_in
    • listen(2)
    • accept(2)
    • fork(2)
    • pthreads
      • pthread_join(3)
      • pthread_create(3)
    • wait(2)

Smashing the stack for fun and profit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment