Skip to content

Instantly share code, notes, and snippets.

View fluential's full-sized avatar
💭
¯\_(ツ)_/¯

Mike fluential

💭
¯\_(ツ)_/¯
  • Earth
View GitHub Profile
@xylifyx2
xylifyx2 / killparent.c
Last active July 7, 2016 08:26
Use in -XX:OnOutOfMemoryError="killparent"
#include <stdio.h>
#include <unistd.h>
int main()
{
printf ("kill -9 <parent>\n");
kill (getppid(), 9);
}
node demo {
nagios::host::service { 'ping':
check_command => 'check_ping',
}
}
@ashb
ashb / lock.py
Last active May 8, 2017 10:26
Lock using Amazon SimpleDB - not needed since terraform 0.9
#!/usr/bin/env python
from __future__ import print_function
import argparse
import boto
import boto.provider
import boto.sdb
import getpass
import os
import signal
import subprocess
@saml
saml / gmailexists.sh
Created March 31, 2012 20:39
gmail exists
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 username"
exit 1
fi
username="$1"
json_left='{"input01":{"Input":"GmailAddress","GmailAddress":"'
@gregelin
gregelin / example.oscap.sh
Created May 26, 2014 19:44
OpenSCAP examples
echo "oscap xccdf eval --profile usgcb-rhel6-server"
oscap xccdf eval --profile usgcb-rhel6-server \
--results /var/www/govready-html/usgcb-rhel6-server.xml \
--report /var/www/govready-html/usgcb-rhel6-server.html \
--cpe /usr/share/xml/scap/ssg/content/ssg-rhel6-cpe-dictionary.xml \
/usr/share/xml/scap/ssg/content/ssg-rhel6-xccdf.xml ; true
@ivanleoncz
ivanleoncz / flask_dynamic_form.py
Last active April 6, 2019 16:02
Obtaining all data (keys/values) from POST request (form) in Python Flask.
#!/usr/bin/python3
""" Obtaining all form fields (dynamically) from a POST request.
$ curl http://127.0.0.1:8000/post -d "name=Nemo&country=Norway"
$ curl http://127.0.0.1:8000/data -d "company=Axos Inc.&business=IT Outsourcing"
"""
from flask import abort, Flask, jsonify, request
__author__ = "@ivanleoncz"
@cbarraford
cbarraford / install_ixgbevf.bash
Last active November 28, 2019 21:35
Install ixgbevf driver for amazon aws enhanced networking (ubuntu)
aptitude install -y build-essential
wget "http://downloads.sourceforge.net/project/e1000/ixgbevf stable/2.11.3/ixgbevf-2.11.3.tar.gz"
tar -zxf ./ixgbevf-*
cd ixgbevf*/src
make install
modprobe ixgbevf
sudo update-initramfs -c -k all
echo "options ixgbevf InterruptThrottleRate=1,1,1,1,1,1,1,1" > /etc/modprobe.d/ixgbevf.conf
@frimik
frimik / puppet-template-patterns.erb
Last active May 6, 2020 12:02
Puppet Template Patterns to remember.
## Check if variable is defined
# Replaces has_variable?(var) and if @var variations.
# include?() pattern from @Jan_vStone.
#
# scope.lookupvar return values for undefined variables:
# Puppet 3.x: nil
# Puppet 2.6.x: :undefined
# Puppet 2.7.x: :undefined
<% if ! [:undefined, nil, ''].include?(masquerade_address = scope.lookupvar('ftp::masquerade_address')) -%>
MasqueradeAddress <%= masquerade_address %>
@xeoncross
xeoncross / my.cnf
Last active September 19, 2020 09:34
Make MySQL FULLY support utf8 glyphs including smilie faces and emoji.
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
/**
* This method is responsible for creating the Jenkins job.
* @param jobName jobName
* @param timerConfig cron expression to schedule the job
* @return
*/
def createJenkinsJob(def jobName, def timerConfig) {
echo "Creating the job ${jobName}"
// Here I'm using a shared library in the pipeline, so I have loaded my shared library here