Skip to content

Instantly share code, notes, and snippets.

View mkf-simpson's full-sized avatar

Konstantin Makarychev mkf-simpson

View GitHub Profile
@CMCDragonkai
CMCDragonkai / curl_custom_dns.sh
Last active August 18, 2023 12:00
cURL: Selecting a custom DNS server to resolve domain names
#!/usr/bin/env bash
# this can be useful when developing against a custom DNS server, or
# for example, if you made a change to the DNS settings of a domain, and you
# know the authoritative nameserver IP address for a domain, you could use this
# to bypass the intermediate DNS cache, and apply an HTTP request using the new
# DNS settings supplied by your specified (authoritative) nameserver
curl --dns-servers <DNSIP,DNSIP> url.com
@iocanel
iocanel / get-host.ip.sh
Created August 31, 2015 13:20
Get the docker host ip inside Kubernetes
#!/bin/bash
KUBERNETES=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT
TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`
POD=`hostname`
curl -s -k -H "Authorization: Bearer $TOKEN" $KUBERNETES/api/v1/namespaces/$KUBERNETES_NAMESPACE/pods/$POD | grep -i hostIp | cut -d "\"" -f 4
@cjwebb
cjwebb / jsonschema.scala
Created June 17, 2015 09:50
Basic JSON Schema validation with Scala and https://github.com/fge/json-schema-validator
import com.github.fge.jsonschema.core.report.ProcessingMessage
import scala.collection.JavaConversions._
import com.fasterxml.jackson.databind.JsonNode
import com.github.fge.jsonschema.main.JsonSchemaFactory
import org.json4s._
import org.json4s.jackson.JsonMethods._
@kgturner
kgturner / Extract.climate.data.R
Last active May 8, 2020 22:23
Extracting climate data from WorldClim.org gridded climate data files (geoTIFFs) for specific locations, and converting the climate information into a useful data table. See http://wp.me/p1Ye5e-aD for more info. To beautify resulting dataframe, see https://gist.github.com/kgturner/6644150.
#Extract climate data from WorldClim.org tiles for several locations and make data table
#Kathryn Turner Sept 16, 2013
#download and unzip all relevant WorldClim geoTIFF files into a single directory.
#I used the highest resolution (~1km2), but should work for other resolutions too.
#load packages: raster, rgdal, foreach
library(rgdal)
library(raster)
library(foreach)
@vol4ok
vol4ok / gist:2587886
Created May 3, 2012 18:21
Split .ape and .flac and convert to .m4a (ALAC) or .mp3 on MacOS X
brew install flac ffmpeg cuetools # ставим нужные пакеты
# скачиваем cuetag.sh скрипт, например отсюда https://github.com/gumayunov/split-cue/blob/master/cuetag
ffmpeg -i 1.ape 1.flac # конвертируем во flac, так как libmac для APE не ставится на osx
cuebreakpoints 1.cue | shnsplit -o flac 1.flac #нарезаем на треки
cuetag 1.cue split-track*.flac #прописываем тэги (cuetag.sh ставится отдельно отдельно)
#конвертируем в ALAC
for f in split-track*.flac
do