Skip to content

Instantly share code, notes, and snippets.

View bukzor's full-sized avatar
🌥️
learning google cloud

Buck Evan bukzor

🌥️
learning google cloud
  • google.com
  • Appleton, WI
  • 08:24 (UTC -05:00)
View GitHub Profile
@bukzor
bukzor / workflow-run-times.csv
Last active December 11, 2024 15:52
GitHub GraphQL to retrieve run times for a particular GHA job
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
"name","startedAt","completedAt","conclusion","detailsUrl","duration"
"self-hosted-end-to-end","2024-11-26T15:46:09Z","2024-11-26T16:07:08Z","SUCCESS","https://github.com/getsentry/snuba/actions/runs/12034154894/job/33550021806",1259
"self-hosted-end-to-end","2024-11-26T16:47:29Z","2024-11-26T17:14:01Z","SUCCESS","https://github.com/getsentry/snuba/actions/runs/12035220718/job/33553661370",1592
"self-hosted-end-to-end","2024-11-26T16:48:18Z","2024-11-26T17:12:22Z","SUCCESS","https://github.com/getsentry/snuba/actions/runs/12035235305/job/33553709892",1444
"self-hosted-end-to-end","2024-11-26T16:53:44Z","2024-11-26T17:14:11Z","SUCCESS","https://github.com/getsentry/snuba/actions/runs/12035327143/job/33554017768",1227
"self-hosted-end-to-end","2024-11-26T16:56:25Z","2024-11-26T17:15:59Z","SUCCESS","https://github.com/getsentry/snuba/actions/runs/12035373227/job/33554176510",1174
"self-hosted-end-to-end","2024-11-27T15:27:57Z","2024-11-27T15:56:07Z","SUCCESS","https://github.com/getsentry/snuba/actions/runs/1205
#! /usr/bin/env bash
CONTROL_FILE="./bastion_control"
if [ -n "$1" ]; then CONTROL_FILE=$1; fi
ssh -S $CONTROL_FILE -O exit bastion
if exists(':terminal')
" Readline cheatsheet:
" ctrl-a - jump to start of line
" ctrl-e - jump to end of line
" ctrl-k - kill forwards to the end of line
" ctrl-u - kill backwards to the start of line
autocmd TermOpen * nnoremap <buffer> I I<C-a>
autocmd TermOpen * nnoremap <buffer> A A<C-e>
autocmd TermOpen * nnoremap <buffer> C A<C-k>
autocmd TermOpen * nnoremap <buffer> D A<C-k><C-\><C-n>
@bukzor
bukzor / gist:8746934
Last active May 30, 2019 00:44
Sierpinski Gasket, in sed
CMD='h;s/(.)/\1\1\1/g;x;s/(.)/\1 \1/g;H;s/(.) (.)/\1\1\2/g;H;x' sh -c 'echo "|" | sed -r "$CMD" | sed -r "$CMD" | sed -r "$CMD" | sed -r "$CMD"'
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || || || || || || || || || || || || || || || || || || || || || || || || || || |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||
| | | || | | || | | || | | || | | || | | || | | || | | || | | |
||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||||| |||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| || || || || || || || || || || || || || || || || || || || || || || || || || || |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@bukzor
bukzor / gist:8738932
Last active February 22, 2022 18:49
Sierpinksi Triangle, in sed
# Sierpinksi Triangle, in sed:
$ f() { sed -r 'h;s/(.)/\1\1/g;x;s/(.)/\1 /g;H;x'; }
$ echo o|f
oo
o
$ echo o|f|f
oooo
# Cantor's dust, in sed
$ CMD='h;H;H;x;s/\n//g;h;s/./ /g;H;x;h;H;x;s/\n *$//' sh -c 'echo o | sed "$CMD"'
ooo
ooo
$ CMD='h;H;H;x;s/\n//g;h;s/./ /g;H;x;h;H;x;s/\n *$//' sh -c 'echo o | sed "$CMD" | sed "$CMD"'
ooooooooo
ooooooooo
@dergachev
dergachev / squid-deb-proxy_on_docker.md
Last active February 21, 2025 02:49
Caching debian package installation with docker

TLDR: I now add the following snippet to all my Dockerfiles:

# If host is running squid-deb-proxy on port 8000, populate /etc/apt/apt.conf.d/30proxy
# By default, squid-deb-proxy 403s unknown sources, so apt shouldn't proxy ppa.launchpad.net
RUN route -n | awk '/^0.0.0.0/ {print $2}' > /tmp/host_ip.txt
RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
  && (echo "Acquire::http::Proxy \"http://$(cat /tmp/host_ip.txt):8000\";" > /etc/apt/apt.conf.d/30proxy) \
  && (echo "Acquire::http::Proxy::ppa.launchpad.net DIRECT;" >> /etc/apt/apt.conf.d/30proxy) \
  || echo "No squid-deb-proxy detected on docker host"