Skip to content

Instantly share code, notes, and snippets.

<koken:if true="settings.albums_index_show_title">
<h4>
<koken:load style="margin-left: 0.2em;">
{{ album.title }} <!-- Prints SET title -->
</koken:load>
</h4>
<p>Work
<koken:load>
@pmoranga
pmoranga / Vagrantfile
Created September 28, 2015 21:23 — forked from johnpbloch/Vagrantfile
Puppet awesomesauce for Vagrant
config.vm.provision :puppet do |puppet|
# Add a folder in your root named .ppt
puppet.manifests_path = ".ppt/manifests"
# vagrant.pp is your main manifest and goes in .ppt/manifests
puppet.manifest_file = "vagrant.pp"
# Add puppet modules in .ppt/modules as git submodules; they will be pre-installed in Vagrant this way
puppet.module_path = ".ppt/modules"
# Config files, etc. go in .ppt/files. fileserver.conf (see below) defines the path for puppet to add
# when looking for files. That way, you can reference files with puppet:// protocols. Make sure you
# add the directory defined in fileserver.conf as a shared directory in the main Vagrantfile config
@pmoranga
pmoranga / $conf_dir puppet.conf
Created February 13, 2016 21:30 — forked from abhishekkr/$conf_dir puppet.conf
Puppet Module : No Code In Data ~ using PuppetDB in masterless puppet
[main]
storeconfigs = true
storeconfigs_backend = puppetdb
reports = store,puppetdb
pluginsync = true
@pmoranga
pmoranga / gist:2db7b5d1e0c120a7de70
Created February 15, 2016 23:46
Puppet external fact for EC2 Tags
#!/bin/bash
region=`facter ec2_placement_availability_zone | sed 's/[a-z]$//g'`
instanceId=`facter ec2_instance_id`
/usr/bin/aws ec2 describe-tags --filters "Name=resource-id,Values=${instanceId}" --region ${region} | jq '.Tags[] | "ec2_tag_" + .Key + "=" + .Value' | tr [:upper:] [:lower:] | tr -d '"'
exit 0
@pmoranga
pmoranga / ec2tags.rb
Last active February 16, 2016 22:30 — forked from tmclaugh/ec2tags.rb
require 'facter'
require 'aws-sdk'
if Facter.value("ec2_instance_id") != nil
instance_id = Facter.value("ec2_instance_id")
region = Facter.value("ec2_placement_availability_zone")[0..-2]
ec2 = Aws::EC2::Client.new(region:region)
tags = ec2.describe_tags(filters: [{ name: "resource-id", values: [instance_id] }]).tags
tags.each do |tag|
fact = "ec2_tag_#{tag["key"].gsub(/\-|\/|:/, '_')}"
@pmoranga
pmoranga / raspisys.php
Last active May 16, 2016 20:31
Forked Raspberry Pi System Information PHP Script - Mobile Friendly Version and Misc Tweaks
<?php
// Original Gist By: Jan van Haarst
// Original Gist: https://gist.github.com/4388108
// Forked Gist By: Jon Faviell
// Forked Gist: https://gist.github.com/7e9138acb3975f8d886c
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
@pmoranga
pmoranga / .bash-colors
Created May 30, 2016 19:08 — forked from jaycody/.bash-colors
.bash-colors
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
@pmoranga
pmoranga / mass-aggregation-change.sh
Created May 31, 2016 13:19 — forked from kirbysayshi/mass-aggregation-change.sh
quick examples of how to change many many wsp (graphite/whisper) files settings
for f in $(find $1 -iname "*.wsp"); do
if [ -a $f ];
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max;
fi;
done
@pmoranga
pmoranga / rpm-build-workflow.md
Created April 1, 2017 21:39 — forked from abn/rpm-build-workflow.md
RPM build and hosting workflow using github, travis-ci and copr

RPM Build Flow

This document details simple RPM build flow pattern used to build and host RPM artifacts for open source projects. The below is a visual summary of this flow.

In order to achieve this multiple tools and services are used. The services and their purpose in the flow is as listed below.

Service Purpose
GitHub As is the most common use for GitHub, it holds the build source code. In this case we hold only the spec files and related source files. All other sources, including project binaries/sources are retrieved at build time.
@pmoranga
pmoranga / README.md
Created September 13, 2017 09:10 — forked from blech75/README.md
vagrant_local_status - bash function to display name and status of vagrant machine (for use in PS1)

Vagrant Status in Your Shell Prompt

vagrant_local_status is a Bash function that returns the name and status the relevant Vagrant machine for the current directory.

The primary use case is in your PS1 environment variable, so the status of your current project's Vagrant machine is always visible at every shell prompt. Here's an example of my Bash prompt in a test project dir:

[01:29 PM]-[1506]-[justin@justin]-[~/projects/test]-[dev u= bb/dev @d59dc2d]-[vagrant:poweroff]
$

(vagrant:poweroff is the output of vagrant_local_status)