modified: content/2011-11-30-how-to-incorporate-custom-configuration-in-a-pyramid-application.rst

modified:   content/2014-03-15-irc-bot-foxbot-runs-canned-remote-executions-using-salt-stack.rst
	modified:   content/2015-11-15-migrating-from-wordpress-to-pelican.rst
	modified:   content/2016-06-22-if-i-swallow-lots-of-air-will-i-be-lighter.rst
	modified:   content/pages/about.rst
	new file:   content/pages/contact.rst
	new file:   content/uploads/profile/garden-profile.jpg
This commit is contained in:
russellballestrini 2016-07-09 18:25:56 -04:00
parent 4d71acbf9e
commit ace10b6a18
7 changed files with 57 additions and 71 deletions

View file

@ -21,9 +21,7 @@ to our project.
**Make a configuration key/value pair for Google Analytics**
Inside production.ini place the following in the ``[app:main]`` section:
::
Inside production.ini place the following in the ``[app:main]`` section::
#google_analytics_key = UA-55555555-1
google_analytics_key =
@ -33,15 +31,11 @@ Inside production.ini place the following in the ``[app:main]`` section:
In this case I will show an example in mako. Other template solutions
should look similar.
.. raw:: html
::
<%def name="google\_analytics()">
% if request.registry.settings['google_analytics_key']:
<p>
|
| <%def name="google\_analytics()">
| % if request.registry.settings['google\_analytics\_key']:
.. raw:: html
<script type="text/javascript"></p>
<p>var _gaq = _gaq || [];<br />
@ -54,18 +48,11 @@ should look similar.
})();</p>
<p></script>
|
| % endif
|
|
% endif
.. raw:: html
</p>
Then in the head section call the function:
::
Then in the head section call the function::
${ google_analytics() }
@ -80,9 +67,7 @@ different way to configure Google Analytics:
Define ``inject_renderer_globals(event)`` function in the project's
``__init__.py`` file.
I normally place it at the bottom of the file and it looks like this:
::
I normally place it at the bottom of the file and it looks like this::
def inject_renderer_globals(event):
"""Inject some renderer globals before passing to template"""
@ -92,16 +77,12 @@ I normally place it at the bottom of the file and it looks like this:
# Build ${google_analytics_key} from the configuration file
event['google_analytics_key'] = request.registry.settings[ 'google_analytics_key' ]
Import BeforeRender at the top of the ``__init__.py``:
::
Import BeforeRender at the top of the ``__init__.py``::
from pyramid.events import BeforeRender
In the main function, add the ``inject_renderer_globals`` to the
subscribers:
::
subscribers::
config.add_subscriber(inject_renderer_globals, BeforeRender)

View file

@ -17,13 +17,14 @@ The code lives here:
Example usage:
::
.. code-block:: text
16:18:25 * | russell checks uptime minion2.foxhop.net
16:18:25 foxbot | minion2.foxhop.net: 16:18:25 up 496 days, 22:36, 17 users, load average: 0.33, 0.70, 0.87
16:18:25 * | russell checks uptime minion2.foxhop.net
16:18:25 foxbot | minion2.foxhop.net: 16:18:25 up 496 days, 22:36, 17 users, load average: 0.33, 0.70, 0.87
::
.. code-block:: text
16:29:10 * | russell checks procs *
16:29:17 foxbot | minion2.foxhop.net: PROCS WARNING: 165 processes
16:29:17 foxbot | minion5.foxhop.net: PROCS CRITICAL: 309 processes
16:29:10 * | russell checks procs *
16:29:17 foxbot | minion2.foxhop.net: PROCS WARNING: 165 processes
16:29:17 foxbot | minion5.foxhop.net: PROCS CRITICAL: 309 processes

View file

@ -16,20 +16,16 @@ During the process of the move, I'm going to use this post to dump hints:
.. contents:: Hints:
Good luck!
Hints
=====
WordPress XML to JSON
------------------------
====================================
I wrote `this tool to convert Wordpress XML dumps to JSON <https://github.com/russellballestrini/wordpress-xml-to-json>`_.
The tool is opinionated and removes lots of data.
Pelican-import
------------------------
====================================
A tool to convert WordPress .xml into .rst or .md files (ReStructuredText or MarkDown) is
`pelican-import <http://docs.getpelican.com/en/latest/importer.html>`_.
@ -37,9 +33,9 @@ A tool to convert WordPress .xml into .rst or .md files (ReStructuredText or Mar
I suggest checking it out, even if you do not plan to use Pelican as your static site generator.
Add date to post filenames
---------------------------------
====================================
After using `pelican-import <http://docs.getpelican.com/en/latest/importer.html>`_ I had about 150 `.rst` files and I decided to put the date in the filename, so I wrote this short bash script tool to do the renames
After using `pelican-import <http://docs.getpelican.com/en/latest/importer.html>`_ I had about 150 `.rst` files and I decided to put the date in the filename, so I wrote this short bash script tool to do the renames:
.. code-block:: bash
@ -52,7 +48,7 @@ After using `pelican-import <http://docs.getpelican.com/en/latest/importer.html>
done
Alter category to tags
-------------------------------
====================================
category and tags have different meanings and assumptions between wordpress and pelican. As a result I decided to change all my categories to tags using this command:
@ -61,7 +57,7 @@ category and tags have different meanings and assumptions between wordpress and
sed -i'' -e 's/:category:/:tags:/g' *.rst
Alter attachment and image paths
----------------------------------
====================================
fix paths to images / uploads to remove wp-content:

View file

@ -7,7 +7,7 @@ If I swallow lots of air will I be lighter?
:tags: Code, DevOps
:status: published
After dinner tonight, my four year old Carter asked me, "If I swallow lots of air will I be lighter?". I thought about the question for a moment and then told him it depends on what surrounds you.
After dinner tonight, Carter, my four year old asked me, "If I swallow lots of air will I be lighter?". I thought about the question for a moment and then told him it depends on what surrounds you.
If you are surrounded by:
* air and you swallow lots of air you will not be lighter.

View file

@ -8,17 +8,15 @@ He enjoys finding simple solutions to difficult problems and reveres the python
Russell currently holds a position at `Mobiquity <https://www.mobiquityinc.com/>`_ as a senior system engineer where he manages infrastructure running in AWS.
Russell keeps busy by turning ideas into products, spends his spare time writing open source software, and running the company that he founded called LinkPeek. He is also actively bootstrapping a comments-as-a-service offering called `Remarkbox <http://www.remarkbox.com>`_.
Russell keeps busy by turning ideas into products, spends his spare time writing open source software, and running the company that he founded called `LinkPeek <https://linkpeek.com>`_. He is also actively bootstrapping a comments-as-a-service offering called `Remarkbox <http://www.remarkbox.com>`_.
Russells resume
==================
If you read all that, you should likely `contact </contact>`_ Russell, and fear not because he always responds in a timely manner.
* `Russell Ballestrini's Resume </uploads/russell.ballestrini.resume.pdf>`_
Russells projects
==================
Please check out my work!
.. contents::
LinkPeek
--------
@ -102,20 +100,3 @@ A pastebin and code pad site I wrote using Pyramid.
action = link-image
size = 600x400
|
Russells Public Code
=====================
http://bitbucket.org/russellballestrini My public source code repositories.
http://github.com/russellballestrini My public source code repositories.
http://botoform.com Manage infrastructure on AWS using YAML.
Pylowiki Open Source wiki application developed using Pylons.
virt-back safely shutdown, gzip, and restart guests.
ago Human readable timedelta library for Python.

27
content/pages/contact.rst Normal file
View file

@ -0,0 +1,27 @@
Contact Russell Ballestrini
###########################
:slug: contact
Get in touch!
Email:
firstname@ lastname.net
Phone:
listed in my resume
Resume:
`Russell Ballestrini's Resume </uploads/russell.ballestrini.resume.pdf>`_
IRC:
fxhp - freenode.net
Twitter:
`@RussellBal <https://twitter.com/RussellBal>`_
Github:
https://github.com/russellballestrini
Bitbucket:
https://bitbucket.org/russellballestrini/

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB