Skip to content

Instantly share code, notes, and snippets.

View jamesluberda's full-sized avatar

James Luberda jamesluberda

View GitHub Profile
@jamesluberda
jamesluberda / selinux-and-docker-and-jenkins.md
Created July 15, 2018 01:29
Running Docker in an Enforcing SELinux (CentOS/RHEL 7) Environment

Running Docker in an Enforcing SELinux (CentOS/RHEL 7) Environment

tl;dr version

  1. install SELinux-dockersock if you need to allow containers to access docker.sock

  2. add the z: or Z: option to any host->container volume mappings (i.e. -v /host-dir:/container_dir:Z as part of a run command or as options: ["z"] or ["Z"] in a yaml config file)

long version (with Jenkins demo)

The following (and summary above) reflects the results of my efforts to give a Jenkins container (that is, a container running Jenkins) a spin while running in an SELinux environment, which is the default for CentOS and RHEL 7. For those not familiar with SELinux, there are plenty of resources out there to explain it in great depth. Suffice it to say that it is a rich and robust Mandatory Access Control security layer that, by design, places a lot of restrictions on what can be accessed by a user/application. In this particular case, there were two SELinux gotchas that in

@jamesluberda
jamesluberda / graphql-for-gists.md
Created June 20, 2018 01:07
Simple User Gists Query Using GitHub GraphQL API (v4 API)

I couldn't find any examples of gists queries using GraphQL--most GraphQL examples seem to focus on traditional repositories--so here is one. As a preface, I cannot recommend strongly enough, at least when getting started, developing queries using the GitHub GraphQL Explorer. I initially started by issuing queries via curl, constructing them using the docs available on the site and a downloaded copy of the schema. Unfortunately, I ended up with errors that I couldn't quite parse. I knew, for example, from the schema, the possible field values for ordering gists. However, whenever I tried to use one of those values, the API returned that it was invalid, like so:

{"data":null,"errors":[{"message":"Argument 'orderBy' on Field 'gists' has an invalid value. Expected type 'GistOrder'.","locations":[{"line":1,"column":48}]}]}"

When I finally turned to the Explorer, I discovered that not only was the value I was using correct (field: CREATED_AT), thanks to its auto

@jamesluberda
jamesluberda / jekyll-config
Last active June 28, 2018 04:48
A Jekyll Site Configuration Settings Page (jekyll-config.md)
---
layout: default
title: "Jekyll Configuration Page"
tags: [ configuration, programming ]
config_excludes: [ categories, collections, data, documents, html_pages, pages,
posts, related_posts, static_files, tags ]
config_truncate: 80
description: A simple markdown/Liquid page that iterates through and displays
the values for first-level configuration elements under the `site`
variable. Excludes elements listed under `config_excludes` and
@jamesluberda
jamesluberda / matplotlib1.4.3.centos5.md
Created July 19, 2015 22:53
Installing matplotlib 1.4.3 on CentOS 5

Installing matplotlib 1.4.3 on CentOS 5

To install the Python library matplotlib on a stock CentOS 5 system, you will need to resolve a freetype dependency issue prior to install. matplotlib 1.4.3 requires freetype ver >=2.3. CentOS 5's repositories top out at freetype 2.2.1.

To meet this dependency, download, compile and install a more recent version of freetype from here (this has been verified to work on a CentOS 5 system with freetype 2.4.0)

After downloading, do the usual unpack, configure, and make. Note that the default configuration will place the new freetype under /usr/local; for reference, the base CentOS install is under /usr.

Substitute the appropriate version of freetype below if not using 2.4.0