Skip to content

Instantly share code, notes, and snippets.

View alazycoder101's full-sized avatar

Lazy coder alazycoder101

View GitHub Profile
\set QUIET on
\set STOP_ON_ERROR on
\echo 'Creating a schema named memory...'
CREATE SCHEMA IF NOT EXISTS memory;
/**
* Get the number of shared buffers.
#!/bin/bash
#
# Script to renew wildcard certificate and apply to target proxy on Google Cloud Platform
# Requirements: certbot
# certificate renew has been handled by certbot alredy. This script is just to apply the renewed one to Global Load Balancer
DIR=/etc/letsencrypt/live
TARGET_PROXY_NAME=staging-load-balancer-proxy
PROJECT="--project=my-project"

Bluestacks 5 is not available now.

cd /Application/Genymotion.app/Contents/MacOS/
./gmtool admin -h
gmtool config --hypervisor qemu

--hypervisor <virtualbox|qemu>	

Coming back to this with VSCode 1.67.0 on Ubuntu 22.04, I no longer require solargraph. However, I did struggle a bit to figure out the exact steps to get it working:

  • Open File: Preferences: Extensions.

  • Search for Ruby by Peng Lv, and install it.

  • Open File: Preferences: Settings.

  • Click the button in the top right to open the JSON settings file: enter image description here

# validate multiple files
$ kubevious guard pepsi/service.yaml pepsi/deployment.yaml
# validate against live server
$ kubevious guard pepsi/service.yaml pepsi/deployment.yaml --live-k8s

$ kubevious lint invalid-service-1.yaml
$ kubevious lint istio-gateway.yaml --live-k8s

# troubleshooting existing cluster

Cloudflare

  1. Goto Domain
  2. Click on SSL/TLS and choose Origin Server.
  3. Click on Create Certificate
  4. more details origin configuration

Screenshot 2022-12-01 at 00 16 38

Screenshot 2022-12-01 at 00 16 11

@alazycoder101
alazycoder101 / trimtrees.pl
Last active November 30, 2022 14:46
script to reduce disk space cost by linking duplicate files.
#!/usr/bin/perl -w
use strict;
use Cwd;
use Digest::MD5 qw(md5);
use Dumpvalue;
use File::Compare qw(compare);
use File::Copy qw(cp);
use File::Find;
use File::Temp qw(tempfile);

finch

components

  • nerdctl: containerd client tool
  • containerd: container runtime
  • lima: Linux virtual machines, typically on macOS, for running containerd
  • buildkit: Open Container Initiative (OCI) image builds
@alazycoder101
alazycoder101 / pg-tool.yml
Last active November 26, 2022 13:16
pod to migrate data, backup and restore database for recovery
kind: Pod
apiVersion: v1
metadata:
name: pg-tool
spec:
volumes:
- name: pg-volume
persistentVolumeClaim:
claimName: name-of-pvc
containers:
#!/bin/bash -
server='http://assets-server/project'
files=`find . -name '*.mp3'|sed 's/^\.\///g'`
for file in $files
do
result=`curl -s -S -f -m 10 -w '%{content_type}' -H "Cache-Control:no-cache" $server/$file -o /dev/null`
if [ $? -ne 0 ]
then