summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--software/gpg.page12
-rw-r--r--software/misc.page24
-rw-r--r--software/python.page59
-rw-r--r--software/unix-tricks.page9
-rw-r--r--software/web-design.page4
5 files changed, 107 insertions, 1 deletions
diff --git a/software/gpg.page b/software/gpg.page
new file mode 100644
index 0000000..5dcb16f
--- /dev/null
+++ b/software/gpg.page
@@ -0,0 +1,12 @@
+
+Signing
+----------
+
+gpg --recv-keys $KEYHASH
+
+gpg --fingerprint # check fingerprint
+
+gpg --sign-key $KEYHASH
+
+gpg --keyserver pgp.mit.edu --send-key $KEYHASH
+
diff --git a/software/misc.page b/software/misc.page
index 84c9066..600819e 100644
--- a/software/misc.page
+++ b/software/misc.page
@@ -186,3 +186,27 @@ unique style. Eg, daemontools, ucspi-tcp, djbdns, qmail, and publicfile.
- [The djb way](http://thedjbway.b0llix.net/readme.html)
+How TTYs Work
+----------------
+
+<http://www.linusakesson.net/programming/tty/>
+
+Covers ``nohup``, piping, process groups, session leaders, TTYs, PTYs,
+``stty``, etc.
+
+Web Security
+-----------------
+<http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-based-website-authentication>
+
+<http://code.google.com/edu/security/index.html>
+
+<https://www.owasp.org/index.php/Main_Page>
+
+Capture all HTTP Traffic to File
+----------------------------------
+Install ``tcpflow`` and do:
+
+ $ mkdir ~/full_dump; cd ~/full_dump
+ $ sudo tcpflow -i wlan0 -b 2097152 tcp port 80 or tcp port 443
+
+Saves up to 2MB
diff --git a/software/python.page b/software/python.page
index 261ba93..116ec6a 100644
--- a/software/python.page
+++ b/software/python.page
@@ -8,3 +8,62 @@ iPython tricks
Use the ``cpaste'' command to copy in blocks of raw python code, even if the
indenting is a little weird.
+Style
+-------
+Python PEP-008 <http://www.python.org/dev/peps/pep-0008/>: Style Guide for
+Python Code
+
+pylint <http://pypi.python.org/pypi/pylint>, a Python syntax checker. Very
+verbose, use pylint -E or at least pylint -r no.
+
+For docstring documentation, refer to
+PEP-257<http://www.python.org/dev/peps/pep-0257/> and the Sphinx
+documentation<http://packages.python.org/an_example_pypi_project/sphinx.html
+ >; specifically, document script functionality in a top level (above imports,
+below any hashbang) docstring.
+
+Use leading "#:" style comments to document important non-object/non-function
+element definitions (eg, static variables) in a way that will get pulled out
+into Sphinx. Use "Google-style" function argument/return documentation instead
+of "Sphinx style". For example:
+
+ def public_fn_with_googley_docstring(name, state=None):
+ """This function does something.
+
+ Args:
+ name (str): The name to use.
+
+ Kwargs:
+ state (bool): Current state to be in.
+
+ Returns:
+ int. The return code::
+
+ 0 -- Success!
+ 1 -- No good.
+ 2 -- Try again.
+
+ Raises:
+ AttributeError, KeyError
+
+ A really great idea. A way you might use me is
+
+ >>> print public_fn_with_googley_docstring(name='foo', state=None)
+ 0
+
+ BTW, this always returns 0. **NEVER** use with :class:`MyPublicClass`.
+
+ """
+ return 0
+
+Packaging
+-----------
+
+Flask app packaging advice, including ``MANIFEST.in`` and non-PyPi dependancy
+advice: http://flask.pocoo.org/docs/patterns/distribute/
+
+Use ``console_scripts`` in ``setup.py`` to install system-wide scripts:
+http://packages.python.org/distribute/setuptools.html#automatic-script-creation
+
+For debian packaging, use [stdeb](http://pypi.python.org/pypi/stdeb)
+(via [stackoverflow thread](http://stackoverflow.com/questions/7110604/standard-way-to-create-debian-packages-for-distributing-python-programs)).
diff --git a/software/unix-tricks.page b/software/unix-tricks.page
index 62c9ebf..8749d16 100644
--- a/software/unix-tricks.page
+++ b/software/unix-tricks.page
@@ -62,4 +62,11 @@ See if a number is prime with ``openssl prime 2011``.
SSH Tunnel
------------
-Try [autossh](http://www.harding.motd.ca/autossh/) to keep tunnels open.
+Try `autossh <http://www.harding.motd.ca/autossh/>`_ to keep tunnels open.
+
+stderr in Red
+---------------
+
+Via `stack overflow <http://serverfault.com/questions/59262/bash-print-stderr-in-red-color/59299#59299>`_:
+
+ $ command 2> >(while read line; do echo -e "\e[01;31m$line\e[0m"; done)
diff --git a/software/web-design.page b/software/web-design.page
new file mode 100644
index 0000000..e2f2600
--- /dev/null
+++ b/software/web-design.page
@@ -0,0 +1,4 @@
+
+For the lazy, take bootstrap.js and toss some theming on it:
+http://antjanus.com/blog/web-design-tips/user-interface-usability/customize-twitter-bootstrap-into-themes/
+