Skip to content

Instantly share code, notes, and snippets.

View indygwyn's full-sized avatar

Thomas W. Holt Jr. indygwyn

  • Indianapolis, IN US
View GitHub Profile

Accounts I follow on YouTube

Got it from running below script:

let markdown = Array.from(document.querySelectorAll("ytd-channel-renderer"))
  .map((item) => ({
    title: item.querySelector("#text-container").textContent.trim(),
    url: item.querySelector("#main-link").href,
 }))
@indygwyn
indygwyn / 256color.rb
Created June 8, 2022 12:38 — forked from ttscoff/256color.rb
256-color hex intepretation for terminal colorization
#!/usr/bin/env ruby
# frozen_string_literal: true
# 256-color hex interpretation for terminal colorization
#
# Usage
# "text".color256(foreground, background)
#
# print "Colorize this".color256('#f7921e', '#666')
@indygwyn
indygwyn / bash_strict_mode.md
Created April 13, 2022 01:19 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@indygwyn
indygwyn / single-node-es.md
Created March 2, 2022 14:54 — forked from angristan/single-node-es.md
Elasticsearch settings for single-node cluster (1 shard, 0 replica)

Elasticsearch settings for single-node cluster

1 shard, 0 replica.

For future indices

Update default template:

curl -X PUT http://localhost:9200/_template/default -H 'Content-Type: application/json' -d '{"index_patterns": ["*"],"order": -1,"settings": {"number_of_shards": "1","number_of_replicas": "0"}}' 
@indygwyn
indygwyn / es-recovery.sh
Created December 11, 2021 23:40 — forked from jolestar/es-recovery.sh
elasticsearch recovery speed up
curl -s -XGET 'localhost:9200/_cat/recovery?v'
curl -XPUT localhost:9200/_cluster/settings -d '{
"persistent" : {
"cluster.routing.allocation.node_concurrent_recoveries" : "10",
"indices.recovery.max_bytes_per_sec": "250mb",
"indices.recovery.concurrent_streams": 10
}
}'
curl -s -XGET 'localhost:9200/_cat/recovery?v'
@indygwyn
indygwyn / semantic-commit-messages.md
Created September 27, 2021 22:00 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@indygwyn
indygwyn / PVE-HP-ssacli-smart-storage-admin.md
Created June 28, 2021 12:25 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

#!/usr/local/bin/ruby
require 'rubygems'
require 'chef/data_bag'
require 'chef/data_bag_item'
Chef::Config.from_file(File.join(ENV['HOME'], '.chef', 'knife.rb'))
puts "Usage: bagger <bag> <source_file>" unless ARGV[0] && ARGV[1]
@indygwyn
indygwyn / fix-knife-pty-default.sh
Created March 10, 2021 13:06 — forked from fuegas/fix-knife-pty-default.sh
Script to fix pty default for SSH connections
#!/bin/bash
# Common functions
function log_prefix { date +%Y-%m-%d\ %H:%M:%S; }
function info { echo "[$(log_prefix)] Info: ${1}"; }
function error { >&2 echo "[$(log_prefix)] Error: ${1}"; }
function fatal { >&2 echo "[$(log_prefix)] Fatal: ${1}"; exit ${2:1}; }
# Detect if we're on OS-X
if [[ "${OSTYPE}" != darwin* ]]; then