Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
##build script for a hugo site with webmentions an ompl podcast roll
#https://github.com/PaulKinlan/paul.kinlan.me/blob/main/build.sh
exit_on_error() {
exit_code=$1
last_command=${@:2}
if [ $exit_code -ne 0 ]; then
#! /usr/bin/node
// from https://github.com/PaulKinlan/paul.kinlan.me/blob/main/podroll.js
// Imports the Google Cloud client library
//use in bash like
//echo "Updating Podroll"
//PODOUTPUT=$(cat ./content/en/2019-10-20-podroll.markdown)
//(echo "$PODOUTPUT" & node podroll.js https://player.fm/pkinlan/fm.opml) > ./content/en/2019-10-20-podroll.markdown
//
const parseOpml = require('./opml-parser.js');
const fetch = require('node-fetch');
@iveskins
iveskins / split_ffmpeg.py
Created November 26, 2019 04:50 — forked from MawKKe/split_ffmpeg.py
Split audio file with ffmpeg based on chapter metadata
#!/usr/bin/env python3
import sys
import os
import re
import subprocess as sub
import argparse
import tempfile
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
@iveskins
iveskins / cryptsetup-with-luks2-and-integrity-demo.sh
Created November 26, 2019 04:38 — forked from MawKKe/cryptsetup-with-luks2-and-integrity-demo.sh
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@iveskins
iveskins / morph.gs
Created November 15, 2019 07:03
google app script to get furigana in [] for google sheets
var morform = function(sentence) {
var endpoint = "https://labs.goo.ne.jp/api/morph";
var payload = {
"app_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"sentence": sentence,
"info_filter":"form|pos|read"
//"info_filter": info_filter,
//"pos_filter": pos_filter
////"sentence": sentence,
////"output_type": output_type
@iveskins
iveskins / README.md
Created September 27, 2019 02:43 — forked from roachhd/README.md
meal planning 🍴

A Beginner’s Guide to Meal Planning ‹ Hello Healthy

A Beginner's Guide to Meal Planning

![][1]

When it comes to eating well, meal planning is one of the easiest things you can do to set yourself up for success. The beauty of it is there are no rules and, you can't really mess it up. The key is just to start, and to set aside a little bit of time each week to do it. There are so many ways to approach meal planning that, after practicing just once or twice, you'll begin to find what works for you and your family too.

To help you get started, we've broken down some of the basics. We've even included two practice exercises to help you map out your next week's worth of healthy meals!

@iveskins
iveskins / install-docker.md
Created September 24, 2019 07:04 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
@iveskins
iveskins / install-docker.md
Created September 24, 2019 07:04 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
@iveskins
iveskins / gist:3c3ec2e7b44fa263d49234fcd5337571
Created June 12, 2019 04:55
turn docker container health state into 0 or 1 metric for sending to cloudwatch
docker inspect --format='{{json .State.Health}}' container_name | jq '.Status' | awk '{gsub("\"healthy\"","0");gsub("\"starting\"","1");gsub("\"unhealthy\"","1");gsub("\"none\"","1");print}'

====== The classic test command ======

''test ''

''[ ]''

===== General syntax =====

This command allows you to do various tests and sets its exit code to 0 (//TRUE//) or 1 (//FALSE//) whenever such a test succeeds or not. Using this exit code, it's possible to let Bash react on the result of such a test, here by using the command in an if-statement: