Skip to content

Instantly share code, notes, and snippets.

View mkoepke's full-sized avatar

Mike Koepke mkoepke

View GitHub Profile
@mkoepke
mkoepke / SCAP-CentOS-NotApplicable.md
Created July 2, 2018 20:29 — forked from gregelin/SCAP-CentOS-NotApplicable.md
Explanation of SCAP, CentOS and tests Not Applicable

This note explains the common issue of "notapplicable" results when running openSCAP and SCAP-Security-Guide on CentOS.

SCAP seems like it should be easy because it is "just XML". Then you dig into looking for a test and it gets confusing fast. So it is good to have some background.

SCAP (Security Content Automation Protocol) is actually a set of multiple standards and specifications that are used together to enable automatically testing hundreds of nerd settings. Let me emphasize that: SCAP is not a single XML specification -- SCAP is multiple standards and specs. Whenever you give "SCAP Content" to a scanner to check a system configurations you are giving the scanner multiple XML files representing multiple standards.

@mkoepke
mkoepke / WordPress Plugin Deployment
Created March 20, 2017 15:34
Script to deploy from Github to WordPress.org Plugin Repository
#! /bin/bash
#
# Script to deploy from Github to WordPress.org Plugin Repository
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
#prompt for plugin slug
echo -e "Plugin Slug: \c"
read PLUGINSLUG
@mkoepke
mkoepke / minify.php
Created March 1, 2017 18:30
A small PHP-Script for minifying CSS
<?php
// specify your css-files and their order here
$cssFiles = array(
'normalize.css', 'style.css', 'print.css', 'colorbox.css'
);
// the file to write the compressed css to
$minFileName = 'minified.css';
// thats all, just call this file in your browser and it will
// build you a minimized css-file. then just link to this single
@mkoepke
mkoepke / bitly.php
Created November 14, 2016 19:45 — forked from pinzler/bitly.php
Simple PHP library for interacting with the v3 BITLY API - using OAuth
<?php
/**
* @file
* Simple PHP library for interacting with the v3 BITLY API - using OAuth
* REQUIREMENTS: PHP, Curl, JSON
*
* @author Andrew Pinzler <ap@bitly.com>
*/
@mkoepke
mkoepke / learn.js
Created July 28, 2016 03:41 — forked from awkale/learn.js
javascript cheatsheet
// Single-line comments start with two slashes.
/* Multiline comments start with slash-star,
and end with star-slash */
// Statements can be terminated by ;
doStuff();
// ... but they don't have to be, as semicolons are automatically inserted
// wherever there's a newline, except in certain cases.
#!/bin/bash
# cd into the directory
cd ~/gitsync/github-wordpress-sync/;
# Make sure we are not already running
if [ -f .sync-running ];then
if test ! `find ".sync-running" -mmin +10`;then
# Currently running, but not stuck
exit 1;
fi
fi;