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 'optparse' | |
require 'optparse/time' | |
require 'ostruct' | |
require 'pp' | |
class OptparseExample | |
CODES = %w[iso-2022-jp shift_jis euc-jp utf8 binary] | |
CODE_ALIASES = { "jis" => "iso-2022-jp", "sjis" => "shift_jis" } | |
# |
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
#@IgnoreInspection BashAddShebang | |
# Setup: | |
# 1. source this script in your ~/.bashrc | |
# source "~/kubectl_aliases.sh" | |
# Usage: | |
# - use kctx to set context | |
# - use kns to set namespace | |
# - kjmp to jump to a set list of cluster and namespace pair from a local text file | |
# - now use kctl instead of kubectl and all the commands will have correct namespace and context passed | |
# - try other shorthand aliases for frequently used commands |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="https://bungee-project.djr.com/resources/web/bungee.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<script src="https://bungee-project.djr.com/resources/web/bungee.js"></script> | |
</head> | |
<body> |
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"?> | |
<opml version="1.0"> | |
<head> | |
<title>Suraj subscriptions in feedly Cloud</title> | |
</head> | |
<body> | |
<outline text="Comics" title="Comics"> | |
<outline type="rss" text="CommitStrip" title="CommitStrip" xmlUrl="http://www.commitstrip.com/en/feed/" htmlUrl="http://www.commitstrip.com"/> | |
<outline type="rss" text="turnoff.us - geek comic site" title="turnoff.us - geek comic site" xmlUrl="http://turnoff.us/feed.xml" htmlUrl="http://turnoff.us/"/> |
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
[ODBC] | |
Trace=no | |
[ODBC Data Sources] | |
MapR Drill 32-bit=MapR Drill ODBC Driver 32-bit | |
MapR Drill 64-bit=MapR Drill ODBC Driver 64-bit | |
[MapR Drill 32-bit] | |
# This key is not necessary and is only to give a description of the data source. | |
Description=MapR Drill ODBC Driver (32-bit) DSN |
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 server | |
import ( | |
"context" | |
"fmt" | |
"io" | |
"os" | |
"cloud.google.com/go/storage" |
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
# overall and per-queue sidekiq stats | |
def compute_sidekiq_stats | |
workers = Sidekiq::ProcessSet.new | |
# compute per queue workers | |
total_capacity = 0 | |
total_busy = 0 | |
queue_workers = {} | |
workers.each do |worker| | |
total_capacity += worker['concurrency'].to_i | |
total_busy += worker['busy'].to_i |
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' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
params = { | |
token: @token, |
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 'influxdb' | |
require 'net/https' | |
# badssl.com has lots of subdomains to test ssl | |
def ssl_valid?(domain) | |
uri = URI.parse(domain) | |
http = Net::HTTP.new(uri.host,uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER |