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 'json' | |
def standardize_key(k) | |
k.downcase.gsub(/\s+/,'_') | |
end | |
def read_dmi | |
data=`dmidecode` | |
dict={} |
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 ruby | |
# Get interface information in pure ruby | |
# Credit to https://github.com/mpalmer/rethtool | |
# | |
# Examples: | |
# Get supported speeds of eth0: | |
# puts EthernetInterface.new('eth0').supported_speeds | |
# Determine if eth1 has a link | |
# puts EthernetInterface.new('eth1').link? | |
# Determine the current speed of eth1 |
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
<?xml version="1.0" encoding="utf-8"?> | |
<ContinuousLabel Version="8.0" Units="twips"> | |
<PaperOrientation>Landscape</PaperOrientation> | |
<Id>Tape6mm</Id> | |
<PaperName>6mm</PaperName> | |
<LengthMode>Auto</LengthMode> | |
<LabelLength>4015.859</LabelLength> | |
<RootCell> | |
<Length>2815.859</Length> | |
<LengthMode>Auto</LengthMode> |
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 ruby | |
require 'json' | |
$displays={} | |
$active_display=nil | |
$max_workspace=-1 | |
outputs=`i3-msg -t get_outputs` | |
JSON.parse(outputs).each do |output| |
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 | |
# This script will resize the root filesystem on an AWS VM. | |
# When you create an AMI, you snapshot the root filesystem to be a particular size. | |
# When you actually launch an AMI, you can give it a volume that is actually larger than your filesystem. | |
# For instance, you can have an AMI with a root filesystem that's 8GB, but you can launch your host on a 40GB volume. | |
# It's perfectly safe to resize the system live to be the full extend of the volume it was launched on. | |
# This is done by deleting the primary partition (live), and recreating it to be the fully size of the actual device. | |
# Once that's done, we just grow the filesystem onto the now available space). |
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
From 730472d4e7dbd507882563bdc50b85b6151eb0f5 Mon Sep 17 00:00:00 2001 | |
From: Dale Hamel <[email protected]> | |
Date: Fri, 25 Sep 2015 13:18:34 -0400 | |
Subject: [PATCH] Fix cloudfront sort of | |
--- | |
.../resource_aws_cloudfront_web_distribution.go | 90 +++++++++++----------- | |
1 file changed, 43 insertions(+), 47 deletions(-) | |
diff --git a/builtin/providers/aws/resource_aws_cloudfront_web_distribution.go b/builtin/providers/aws/resource_aws_cloudfront_web_distribution.go |
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
# Uncomment to enable HiFiBerry overlay | |
# NOTE: You must disable the lirc-rpi overlay (or change lirc GPIO pin) for HiFiBerry to work correctly | |
# dtoverlay=hifiberry-amp | |
# dtoverlay=hifiberry-dac | |
# dtoverlay=hifiberry-dacplus | |
# dtoverlay=hifiberry-digi |
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 'net/http' | |
require 'json' | |
def getPrices(path) | |
uri = URI(path) | |
res = Net::HTTP.get_response(uri) | |
data = res.body.match(/.*callback\((.*)\);/).captures[0] | |
data = data.gsub(/(\w+):/,"\"\\1\":") | |
d = JSON.parse(data) |
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 ruby | |
require 'aws-sdk' | |
require 'json' | |
$stdout.sync = true | |
conf = JSON.load(File.read(ENV['CONFIG']))['aws'] | |
credentials = Aws::Credentials.new(conf['access_key_id'], conf['secret_access_key']) |
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
// To load this script, open a Google Sheet (yeah, weird I know), then select "Tools->Script Editor" | |
// From there, past this content into a script. You can set up triggers to run this script every day at a certain time | |
// by selecting Resources -> Triggers. | |
// I recommend you set the trigger to every 5-10 minutes. This will let the batches complete. If the trigger is too infrequent, it wont have time to finish. | |
// https://developers.google.com/apps-script/reference/gmail/ | |
// For large inboxes (the ones you want to analyze) gmail will rate limit you. | |
// They recommend adding a sleep to call less, but then your exec time will be too long. | |
// To solve this, we run in batches. This is the batch size. Decrease this if exec time is too long. |