Skip to content

Instantly share code, notes, and snippets.

View jameswhite's full-sized avatar
📁
copying files

James S White jameswhite

📁
copying files
View GitHub Profile
module VCenterDriver
class VirtualMachineFolder
attr_accessor :item, :items
def initialize(item)
@item = item
@items = {}
end
@jameswhite
jameswhite / aws_saml.py
Created October 4, 2019 15:08 — forked from JoeyG1973/aws_saml.py
aws saml login with session that auto refreshes.
# Took this:
# https://s3.amazonaws.com/awsiammedia/public/sample/SAMLAPICLIADFS/samlapi_formauth_adfs3.py
# converted to boto3 and smooshed it together with this:
# https://gist.github.com/kapilt/ac8e222081f63ba64e93
# which gave birth too this:
import sys
import botocore
import boto3
import requests
@jameswhite
jameswhite / config
Created May 23, 2019 15:54
~/.ssh/config
Host planck
User syeargin
ForwardAgent yes
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ProxyCommand ssh root@96.87.216.209 nc %h %p 2> /dev/null

rails-assets-openlayers

The Bower package inside a gem

This gem was automatically generated. You can visit rails-assets.org for more information.

Usage

Add rails-assets source block to your Gemfile:

if FileTest.exists?("/usr/bin/apt-get")
unless File.exists?("/etc/facter/facts.d/needs_security_patches.txt")
Facter.add("needs_security_patches") do
case Facter.value("lsbdistcodename")
when 'precise'
setcode "[ $(apt-get --dry-run upgrade 2>/dev/null | grep '^Inst '|wc -l) -eq 0 ] && echo 'false' || [ $(apt-get --target-release=precise-security --dry-run upgrade 2>/dev/null | grep Inst | wc -l) -eq 0 ] || echo true"
when 'trusty'
setcode "[ $(apt-get --dry-run upgrade 2>/dev/null | grep '^Inst '|wc -l) -eq 0 ] && echo 'false' || [ $(apt-get --target-release=trusty-security --dry-run upgrade 2>/dev/null | grep Inst | wc -l) -eq 0 ] || echo true"
else
setcode "[ $(apt-get --dry-run upgrade 2>/dev/null | grep Inst | wc -l) -eq 0 ] && echo false || echo true"
#!/bin/bash
# date should be yyyymmdd
ARGS="$*"
export TARGET=$(date -jf "%Y%m%d" ${ARGS} +"%m/%d/%Y")
export TICKET_DATE=$(date -jf "%Y%m%d" ${ARGS} +"%a %b%d %g")
# cache every day
[ ! -f /var/tmp/pb ] || [ $(find /var/tmp/pb -mmin +3600) ] && curl -sk http://www.powerball.com/powerball/winnums-text.txt > /var/tmp/pb
[ ! -f /var/tmp/hl ] || [ $(find /var/tmp/hl -mmin +3600) ] && curl -sk http://www.powerball.com/hotlotto/winnums-text.txt > /var/tmp/hl
for file in $(ls tumble.wcyd.org-access.log.*.gz); do cat $file | gzip -dc | grep -i georgia-guidestones; done
164.132.161.59 - - [21/Mar/2017:08:51:06 +0000] "GET /irclink/?user=james&source=web&url=http%3A%2F%2Fvigilantcitizen.com%2Fsinistersites%2Fsinister-sites-the-georgia-guidestones%2F HTTP/1.1" 200 663
5.9.60.241 - - [15/Mar/2017:17:18:58 +0000] "GET /irclink/?user=james&source=web&url=http%3A%2F%2Fvigilantcitizen.com%2Fsinistersites%2Fsinister-sites-the-georgia-guidestones%2F HTTP/1.1" 200 1129
66.249.65.251 - - [01/Mar/2017:05:50:10 +0000] "GET /irclink/?user=james&source=web&url=http%3A%2F%2Fvigilantcitizen.com%2Fsinistersites%2Fsinister-sites-the-georgia-guidestones%2F HTTP/1.1" 200 663
163.172.65.60 - - [08/Feb/2017:21:35:50 +0000] "GET /irclink/?user=james&source=web&url=http%3A%2F%2Fvigilantcitizen.com%2Fsinistersites%2Fsinister-sites-the-georgia-guidestones%2F HTTP/1.1" 200 663
185.158.122.143 - - [02/Feb/2017:18:04:01 +0000] "GET /irclink/?user=james&source=web&url=http%3A%2F%2Fvigilantcitizen
sif
status: active
status: active
status: active
status: active
status: active
status: active
status: active
status: active
status: master
@jameswhite
jameswhite / modules
Created June 1, 2017 15:38
/etc/initramfs-tools/modules
# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax: module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1

Raspberry Pi:

Set up minicom, serial console a soekris 5501 with a pl2303 adapter
apt-get install -y minicom
cat<<EOF> /root/minirc.ttyUSB0
# Machine-generated file - use setup menu in minicom to change parameters.