Skip to content

Instantly share code, notes, and snippets.

@signalnine
signalnine / gist:37344a4b0f78af7d1c32
Last active April 23, 2024 00:46
fix unallocated shards on ElasticSearch
NODE="hostname.you.com"
IFS=$'\n'
for line in $(curl -s 'localhost:9200/_cat/shards' | fgrep UNASSIGNED); do
INDEX=$(echo $line | (awk '{print $1}'))
SHARD=$(echo $line | (awk '{print $2}'))
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands": [
{
"allocate": {
processor : 0
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimd
fhm dit uscat ilrcpc flagm sb paca pacg dcpodp flagm2 frint
CPU implementer : 0x61
CPU architecture: 8
CPU variant : 0x0
CPU part : 0x000
CPU revision : 0
#!/bin/env python3
import os
import glob
import aubio
# Function to detect beats
def detect_beats(audio_file):
# Initialize aubio beat detection
win_s = 1024 # fft size

For the flavor base:

  • 15 dried japones chiles or 10 dried chiles de árbol or 3 Tbs. sambal oelek
  • 1-1/2 cups sliced shallots (from 4 large shallots)
  • 2 Tbs. sliced garlic
  • 1 Tbs. sliced peeled fresh ginger
  • 1 Tbs. chopped fresh or frozen and thawed galangal (optional)

For the whole spice blend:

@signalnine
signalnine / reconstruct_crontab.py
Created August 26, 2023 00:45
reconstruct crontab from syslog
from collections import defaultdict
from datetime import datetime
from collections import Counter
def infer_cron_schedule(timestamps):
# Sort timestamps
timestamps.sort()
# Calculate intervals in seconds
intervals = [(timestamps[i+1] - timestamps[i]).seconds for i in range(len(timestamps)-1)]
#!/bin/bash
# Set the list of small words to ignore
ignore_list="a an and but or nor the"
# Loop through all files in the current directory
for file in *
do
# Split the file name and extension into separate variables
filename="${file%.*}"
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'

Keybase proof

I hereby claim:

  • I am signalnine on github.
  • I am gabeortiz (https://keybase.io/gabeortiz) on keybase.
  • I have a public key whose fingerprint is D9E0 C6D4 2081 375E BE5A D4D2 0BAF 8BA8 9ED6 CB64

To claim this, I am signing this object: