This file contains hidden or 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
// Copy/paste all ENV variables from one AWS beanstalk env to another. Use this functions in the browser console | |
// Copy ENV as json | |
copy( | |
JSON.stringify( | |
Object.fromEntries( | |
Array.from( | |
document.querySelectorAll('.env-props-table tbody tr:not(.ng-hide)') | |
).map(e => [ | |
e.querySelector('[ng-model="option.optionName"]').value, |
This file contains hidden or 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
const net = require('net'); | |
const child_process = require('child_process'); | |
function makeProxy(port, jump, target) { | |
const server = net.createServer(socket => { | |
const subprocess = child_process.spawn( | |
'ssh', | |
[jump, '-W', target], | |
{ stdio: ['pipe', 'pipe', 'inherit'] } | |
); |
This file contains hidden or 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 | |
# frozen_string_literal: true | |
require 'optparse' | |
require 'active_support/all' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = 'Usage: gsubrb [options]' | |
opts.on('-r', '--replace [CODE]', String, 'Block that will be executed for each match') do |code| |
This file contains hidden or 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 | |
# Usage awsenv enviromnent command... | |
search="$1" | |
shift | |
file=$(find "$HOME"/.password-store/AWS | grep "$search.*/AKIA.*gpg$") | |
if [[ x"$file" = x ]]; then | |
echo "Could not find a AWS key at $search" >&2 | |
exit 1 |
This file contains hidden or 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 | |
# Usage: ./eth-balance address | |
wei="$(curl -s https://api.blockcypher.com/v1/eth/main/addrs/"$1" | jq .balance)" | |
eth="$(echo "$wei / (10 ^ 18)" | bc -l)" | |
echo $eth |
This file contains hidden or 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 | |
# Usage: ./btc-balance address | |
satoshis="$(curl https://insight.bitpay.com/api/addr/"$1"/balance)" | |
btc="$(echo "$satoshis/100000000" | bc -l)" | |
echo $btc |
This file contains hidden or 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 | |
cat /etc/dictionaries-common/words | grep -P '^[a-z]{1,10}$' | shuf -n 4 | tr '\n' '-' | sed 's/-$/\n/' |
This file contains hidden or 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/python3 | |
import sys | |
import re | |
import pysrt | |
import pinyin | |
def to_pinyin(text): | |
pinyins = pinyin.get(text, delimiter=" ").split(' ') |
This file contains hidden or 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/python3 | |
""" | |
LPT: If your original subtitles are not .srt, convert them using ffmpeg | |
""" | |
import sys | |
import pysrt | |
def merge_subtitles(srts): |
This file contains hidden or 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 python3 | |
# This changes the playback speed to a different speed when there is and when there isn't subtitles. | |
# You need to activate the Lua HTTP interface in VLC and | |
# configure the password here, then run the script with a .srt as first argument. | |
# Ended up not being very nice because VLC janks for a few milliseconds when the playback speed changes | |
import requests | |
import pysrt | |
import sys |
NewerOlder