Skip to content

Instantly share code, notes, and snippets.

View sryabkov's full-sized avatar

Sergei Ryabkov sryabkov

View GitHub Profile
@zas
zas / sha256github_pubkey.sh
Created February 28, 2022 20:49
Calculate sha256 hash from a pub key to compare to github deploy key
#!/bin/bash
# calculate sha256 hash from a pub key to compare to github deploy key
KEY=$1
KEYPATH="~/.ssh/${KEY}.pub"
ssh-keygen -E sha256 -l -f "$KEYPATH"
@Intelrunner
Intelrunner / bq_slot_usage.sql
Last active March 29, 2022 18:43
This Query Estimates slot usage per SECOND at an organizational level, segregated by project_id. Use: Finding average number of slot seconds per second to determine if purchasing Google Cloud Platform Bigquery Slots is valuable for an organization. Requires: bigquery.jobs.listAll
SELECT
TIMESTAMP_TRUNC(jobs.start_time, second) as sec,
SUM(SAFE_DIVIDE(total_slot_ms, TIMESTAMP_DIFF(end_time, start_time, MILLISECOND))) AS Slot_Count, project_ID as project
FROM
`region-us`.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION jobs
WHERE jobs.start_time BETWEEN TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 3 DAY) AND CURRENT_TIMESTAMP()
GROUP BY project_id, sec
ORDER BY sec DESC
@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
@br3ndonland
br3ndonland / github-actions-notes.md
Last active February 12, 2025 05:53
Getting the Gist of GitHub Actions
tap "azure/draft"
tap "boz/repo"
tap "browsh-org/browsh"
tap "contribsys/faktory"
tap "datawire/blackbird"
tap "davrodpin/mole"
tap "derailed/k9s"
tap "dtan4/dtan4"
tap "fishtown-analytics/dbt"
tap "fluidkeys/tap"
@BatslyAdams
BatslyAdams / Dockerfile
Created March 8, 2017 17:06
Java environment in Windows Server Core setup using PowerShell - DevOps Hackathon
# Starting Dockerfile for a Java based project in Windows Server Core with JDK integrity check
FROM microsoft/windowsservercore
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
WORKDIR c:/setup
# Set variables for OpenJDK pull
ENV JAVA_VERSION="1.8.0.111-3" `
JAVA_ZIP_VERSION="1.8.0-openjdk-1.8.0.111-3.b15" `
JAVA_SHA256="e080371bf57536668416157660e05d95fe04db15da36234d32bda8e301bb0454" `
@abayer
abayer / Jenkinsfile
Created February 15, 2017 15:17
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@meilinger
meilinger / tmux101.md
Last active February 15, 2024 10:01
tmux 101

tmux 101 - the terminal multiplexer

Why tmux?

  • Why use a terminal multiplexer?
    • Keeps your hands on the keyboard
    • Keep multiple terminals in eyeshot
    • Detach/re-attach remote session (eg. for long-running processes)
  • Like screen, but better
@citrusui
citrusui / dropdown.md
Last active May 10, 2025 18:03
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.