This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/xml" | |
"log" | |
"strings" | |
) | |
type document struct { | |
Title string `xml:"title"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example Kickstart config file for RHEL5, change $VARIABLES to suitable values | |
# for your site | |
# Usage from linux kernel boot prompt: | |
# linux ks=http://$SERVER_ADDR/ks/rhel5-example.ks ip=$IPADDR netmask=$NETMASK gateway=$GATEWAY [nokill] [keymap=pt-latin1] [noipv6] [debug] | |
# | |
# More boot options at http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/ch-bootopts-x86.html | |
# Options for this section can be found at http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-options.html | |
install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* First create the keystore (to allow SSL protection) by importing the LDAP | |
* certificate (cert.pem) with: | |
* keytool -import -keystore keystore -storepass changeit -noprompt -file cert.pem | |
* | |
* You can get the certificate with OpenSSL: | |
* openssl s_client -connect ldap.server.com:636 </dev/null 2>/dev/null | sed -n '/^-----BEGIN/,/^-----END/ { p }' > cert.pem | |
* | |
* Then compile this class with: | |
* javac LdapAuth.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'httparty' | |
require 'json' | |
require 'byebug' | |
def get_data | |
query = File.open('repos.graphql', 'r').read | |
token = 'https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/' | |
cursor = nil | |
repos = [] | |
org = 'evil_mega_corp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def log_object(job_id, step_id, bucket, key) | |
puts ['found', job_id, step_id, bucket, key].join(',') | |
end | |
def log_missing(job_id, object_id, msg) | |
puts ['missing', job_id, object_id, msg].join(',') | |
end | |
# Finding the offending RfTests | |
rf_test_ids = RfTest.where(client_id: 5627) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'httparty' | |
require 'uri' | |
require 'csv' | |
def get_incidents | |
limit = 100 | |
url = "https://api.pagerduty.com/incidents?statuses%5B%5D=resolved&time_zone=UTC&limit=#{limit}&offset=" | |
incidents = [] | |
offset = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem install google-api-client | |
require "google/apis/calendar_v3" | |
require "googleauth" | |
require "googleauth/stores/file_token_store" | |
require "date" | |
require "fileutils" | |
OOB_URI = "urn:ietf:wg:oauth:2.0:oob".freeze | |
APPLICATION_NAME = "Google Calendar API Ruby Quickstart".freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
=head1 NAME | |
chrome-reload | |
=head1 SYNOPSIS | |
chrome-reload 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
. CONFIG | |
# Satisfy the prerequisites for Oracle 11g and install the binaries | |
for i in oinstall dba oper asmadmin asmdba asmoper; do groupadd $i; done | |
useradd -g oinstall -G dba,oper,asmdba oracle | |
useradd -g oinstall -G asmadmin,asmdba,asmoper grid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo '{"foo": "bar"}' | curl --unix-socket /tmp/foo.bar http://www.google.com/echo -d @- | |
{"message":"{\"foo\": \"bar\"}"} | |
$ curl --unix-socket /tmp/foo.bar http://www.google.com/popper | |
{"message":"🎉"} |
NewerOlder