Skip to content

Instantly share code, notes, and snippets.

View dex4er's full-sized avatar

Piotr Roszatycki dex4er

View GitHub Profile
#!/bin/bash
if [ -z "$1" ]; then
gcloud compute images list --project $PROJECT
else
gcloud compute images export --project $PROJECT \
--async \
--image "$1" \
--destination-uri "gs://$BUCKET/$1.vmdk" \
--export-format=vmdk \
git filter-branch --index-filter "cp $PWD/.gitattributes . && git add .gitattributes" --tag-name-filter cat --prune-empty -- --all
#!/usr/bin/perl
## The fake API service for OpenVPN that allows to use client with simple setup mode.
use Mojo::File;
use Mojo::Util 'xml_escape';
use Mojolicious::Lite;
post '/RPC2' => sub {
my ($c) = @_;
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
global:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
labels: {}
kubectl get pod -o wide | perl -pe 's/\b (?! )\b/_/g' | q -H 'select node, count(*) from - group by node'
@dex4er
dex4er / .bash_aliases
Created June 16, 2020 08:32
Bash aliases for kubectl
alias k='kubectl'
alias kd='kubectl describe'
alias kdd='kubectl describe deployment'
alias kddn='kubectl describe deployment --namespace'
alias kdp='kubectl describe pod'
alias kdpn='kubectl describe pod --namespace'
alias kds='kubectl describe secret'
alias kdsn='kubectl describe secret --namespace'
alias kdsv='kubectl describe service'
alias kdsva='kubectl describe service --all-namespaces'
@dex4er
dex4er / tf-apply.sh
Last active October 11, 2022 23:42
Terraform less verbose and more bash friendly
#!/bin/bash
trap 'rm -rf terraform.tfplan' EXIT
trap '' INT
function filter_manifest_short() {
grep --line-buffered -v -P '\(known after apply\)|\(\d+ unchanged \w+ hidden\)'
}
function filter_manifest_compact() {
@dex4er
dex4er / docker-compose.yml
Created November 12, 2019 15:37
Example of docker compose
# Docker services for development environment
#
# Usage: docker-compose up -d --remove-orphans
version: "3"
services:
influxdb:
container_name: influxdb
image: influxdb:1.7
ports:
@dex4er
dex4er / README.md
Last active November 5, 2019 22:53

polish-vehicle-registration-certificate-decoder demo with Parcel

Install

Install with Node.js:

npm install
@dex4er
dex4er / make-ts-from-graphql.ts
Created May 20, 2019 00:33
make-ts-from-graphql
#!/usr/bin/env ts-node
/// <reference types="node" />
import glob from 'fast-glob'
import fs from 'fs'
import path from 'path'
import yargs from 'yargs'
const defaultPatterns = ['**/*.graphql', '**/*.gql', '!node_modules']