I hereby claim:
- I am rtjm3734 on github.
- I am rtreweek (https://keybase.io/rtreweek) on keybase.
- I have a public key ASBJfZuiT61uccMJR7pEJh_R9vr5D9f6NeOycvFoSu-ZGAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
NB: The following examples were done on Puppet Enterprise 3.0 running on Centos 6. This should be similar for open source versions, except for some file locations.
The easiest way to snoop around in the actual PuppetDB postgres database is using the command prompt. You have to be the peadmin user though. Couldn't get it working just under root.
[root@master bin]# sudo su - pe-postgres -s /bin/bash
-bash-4.1$ /opt/puppet/bin/psql
psql (9.2.4)
Type "help" for help.
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
#this is a sample .curlrc file | |
# store the trace in curl_trace.txt file. beware that multiple executions of the curl command will overwrite this file | |
--trace curl_trace.txt | |
# store the header info in curl_headers.txt file. beware that multiple executions of the curl command will overwrite this file | |
--dump-header curl_headers.txt | |
#change the below referrer URL or comment it out entirely | |
-e "https://www.google.com" |
#!/usr/bin/env ruby | |
# Generate a DOT file showing links between ActiveMQ brokers using | |
# a list of activemq.xml files passed as ARGV. | |
require 'rexml/document' | |
require 'erb' | |
broker_map = Hash.new |
When [Markdown][markdown] appeared more than 10 years ago, it aimed to make it easier to express ideas in an easy-to-write plain text format. It offers a simple syntax that takes the writer focus away from the formatting, thus giving her time to focus on the actual content.
The market abunds of editors to be used for help with markdown. After a few attempts, I settled to Sublime and its browser preview plugin, which work great for me and have a small memory footprint to accomplish that. To pass the results around to other people, less technical, a markdown file and a bunch of images is not the best approach, so converting it to a more robust format like PDF seems like a much better choice.
[Pandoc][pandoc] is the swiss-army knife of converting documents between various formats. While being able to deal with heavy-weight formats like docx and epub, we will need it for the more lightweight markdown. To be able to generate PDF files, we need LaTeX. On OSX, the s
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'yaml' | |
require 'json' | |
def puppet_parser_validate(file) | |
system('puppet parser validate --storeconfigs ' + file) | |
end |