Skip to content

Instantly share code, notes, and snippets.

View chew-z's full-sized avatar

Robert J. chew-z

  • Warsaw, Poland
View GitHub Profile
@chew-z
chew-z / music.10s.sh
Last active March 15, 2024 13:19
Music plugin for Swiftbar
#!/bin/zsh
# metadata
# <xbar.title>Music Now Playing</xbar.title>
# <xbar.version>v1.2</xbar.version>
# <xbar.author>Dan Turkel, Jason Tokoph, Aleš Farčnik, Jeffrey Munowitch</xbar.author>
# <xbar.author.github>chew-z</xbar.author.github>
# <xbar.desc>Display currently playing Music song with artwork. Play/pause, skip forward, skip backward.</xbar.desc>
# <xbar.dependencies>zsh, javascript, JXA</xbar.dependencies>
package main
import (
"fmt"
"log"
"net/http"
"os"
"strings"
"time"
package sunset
import (
"encoding/json"
"fmt"
"log"
"net/http"
"reflect"
"time"
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['functions', 'deploy', 'HelloHTTP', '--trigger-http', '--runtime', 'go111', '--entry-point', 'HelloHTTP', '--region', 'europe-west1']
dir: 'CloudFunctions'
@chew-z
chew-z / default
Created March 16, 2019 17:36
Minimal nginx for DNS-over-TLS and DNS-over-HTTP
upstream dns-backend {
server 127.0.0.1:8053;
}
# http-redirects to https - for domain calls not via IP
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name www.example.com;
#!/bin/env zsh
mkdir -p chrome-crx
id=$1
downloadUrl="https://clients2.google.com/service/update2/crx?response=redirect&prodversion=56.0&x=id%3D$id%26installsource%3Dondemand%26lang%3Den-US%26uc"
if [ ! -f "chrome-crx/$id.crx" ]; then
http --download --output "chrome-crx/$id.crx" "$downloadUrl"
fi
@chew-z
chew-z / hosts2dnscrypt.py
Last active November 2, 2017 12:23
Script for downloading list of host and IP blocks
#!/usr/bin/env python
# Takes hosts file and converts to DNSCrypt blacklist-domains file
# so you could block malicious hosts on DNSCrypt
# (when alternating to DNSCrypt instead of dnsmasq in my scenario)
# hosts file from https://github.com/StevenBlack/hosts
# See https://dnscrypt.org/ IP/domain names blocking
import re
@chew-z
chew-z / radio.json
Last active January 10, 2023 16:47
Simplistic script for playing radio in terminal with mpv underneath
[
{
"id": 0,
"station": {
"name": "Machine Geist",
"url": "http://178.209.52.163:7331/maschinengeist.org.128.aacp"
}
},
{
"id": 1,
@chew-z
chew-z / BrewClean.sh
Last active June 1, 2017 05:55
Script to sieve brew packages and get list of standalone and dependants
#!/usr/bin/env zsh
OLDIFS=$IFS
IFS=$'\r\n'
GLOBIGNORE='*'
command eval 'BrewList=($(brew list))'
Dependent=()
Independent=()
@chew-z
chew-z / .gvimrc
Last active May 29, 2017 12:58
My today's .vimrc state
" Only MacVim-related options here
"
"
" start in fullscreen mode
" set fullscreen
set guifont=Roboto\ Mono\ Medium:h14
" This is best with iTerm window on left and MacVim on right pane (on my screen)
set columns=125
set lines=50
set antialias