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:
parent
4d71acbf9e
commit
ace10b6a18
7 changed files with 57 additions and 71 deletions
|
|
@ -21,9 +21,7 @@ to our project.
|
||||||
|
|
||||||
**Make a configuration key/value pair for Google Analytics**
|
**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 = UA-55555555-1
|
||||||
google_analytics_key =
|
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
|
In this case I will show an example in mako. Other template solutions
|
||||||
should look similar.
|
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>
|
<script type="text/javascript"></p>
|
||||||
<p>var _gaq = _gaq || [];<br />
|
<p>var _gaq = _gaq || [];<br />
|
||||||
|
|
@ -54,18 +48,11 @@ should look similar.
|
||||||
})();</p>
|
})();</p>
|
||||||
<p></script>
|
<p></script>
|
||||||
|
|
||||||
|
|
% endif
|
||||||
| % endif
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
||||||
.. raw:: html
|
Then in the head section call the function::
|
||||||
|
|
||||||
</p>
|
|
||||||
|
|
||||||
Then in the head section call the function:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
${ google_analytics() }
|
${ google_analytics() }
|
||||||
|
|
||||||
|
|
@ -80,9 +67,7 @@ different way to configure Google Analytics:
|
||||||
Define ``inject_renderer_globals(event)`` function in the project's
|
Define ``inject_renderer_globals(event)`` function in the project's
|
||||||
``__init__.py`` file.
|
``__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):
|
def inject_renderer_globals(event):
|
||||||
"""Inject some renderer globals before passing to template"""
|
"""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
|
# Build ${google_analytics_key} from the configuration file
|
||||||
event['google_analytics_key'] = request.registry.settings[ 'google_analytics_key' ]
|
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
|
from pyramid.events import BeforeRender
|
||||||
|
|
||||||
In the main function, add the ``inject_renderer_globals`` to the
|
In the main function, add the ``inject_renderer_globals`` to the
|
||||||
subscribers:
|
subscribers::
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
config.add_subscriber(inject_renderer_globals, BeforeRender)
|
config.add_subscriber(inject_renderer_globals, BeforeRender)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,14 @@ The code lives here:
|
||||||
|
|
||||||
Example usage:
|
Example usage:
|
||||||
|
|
||||||
::
|
.. code-block:: text
|
||||||
|
|
||||||
16:18:25 * | russell checks uptime minion2.foxhop.net
|
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 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
|
|
||||||
|
|
|
||||||
|
|
@ -16,20 +16,16 @@ During the process of the move, I'm going to use this post to dump hints:
|
||||||
|
|
||||||
.. contents:: Hints:
|
.. contents:: Hints:
|
||||||
|
|
||||||
Good luck!
|
|
||||||
|
|
||||||
Hints
|
|
||||||
=====
|
|
||||||
|
|
||||||
WordPress XML to JSON
|
WordPress XML to JSON
|
||||||
------------------------
|
====================================
|
||||||
|
|
||||||
I wrote `this tool to convert Wordpress XML dumps to JSON <https://github.com/russellballestrini/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.
|
The tool is opinionated and removes lots of data.
|
||||||
|
|
||||||
|
|
||||||
Pelican-import
|
Pelican-import
|
||||||
------------------------
|
====================================
|
||||||
|
|
||||||
A tool to convert WordPress .xml into .rst or .md files (ReStructuredText or MarkDown) is
|
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>`_.
|
`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.
|
I suggest checking it out, even if you do not plan to use Pelican as your static site generator.
|
||||||
|
|
||||||
Add date to post filenames
|
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
|
.. code-block:: bash
|
||||||
|
|
||||||
|
|
@ -52,7 +48,7 @@ After using `pelican-import <http://docs.getpelican.com/en/latest/importer.html>
|
||||||
done
|
done
|
||||||
|
|
||||||
Alter category to tags
|
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:
|
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
|
sed -i'' -e 's/:category:/:tags:/g' *.rst
|
||||||
|
|
||||||
Alter attachment and image paths
|
Alter attachment and image paths
|
||||||
----------------------------------
|
====================================
|
||||||
|
|
||||||
fix paths to images / uploads to remove wp-content:
|
fix paths to images / uploads to remove wp-content:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ If I swallow lots of air will I be lighter?
|
||||||
:tags: Code, DevOps
|
:tags: Code, DevOps
|
||||||
:status: published
|
: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:
|
If you are surrounded by:
|
||||||
* air and you swallow lots of air you will not be lighter.
|
* air and you swallow lots of air you will not be lighter.
|
||||||
|
|
|
||||||
|
|
@ -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 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>`_.
|
||||||
|
|
||||||
Russell’s 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>`_
|
|
||||||
|
|
||||||
Russell’s projects
|
Russell’s projects
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Please check out my work!
|
.. contents::
|
||||||
|
|
||||||
LinkPeek
|
LinkPeek
|
||||||
--------
|
--------
|
||||||
|
|
@ -102,20 +100,3 @@ A pastebin and code pad site I wrote using Pyramid.
|
||||||
action = link-image
|
action = link-image
|
||||||
size = 600x400
|
size = 600x400
|
||||||
|
|
||||||
|
|
|
||||||
|
|
||||||
|
|
||||||
Russell’s 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
27
content/pages/contact.rst
Normal 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/
|
||||||
BIN
content/uploads/profile/garden-profile.jpg
Normal file
BIN
content/uploads/profile/garden-profile.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 139 KiB |
Loading…
Add table
Add a link
Reference in a new issue