Skip to content

Instantly share code, notes, and snippets.

View 0xBigBoss's full-sized avatar
🤠

Big Boss 0xBigBoss

🤠
View GitHub Profile
# pip install diffusers transformers accelerate
# Load model
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
import torch
repo_id = "stabilityai/stable-diffusion-2"
device = "cuda"
pipe = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.float16, revision="fp16")
@0xBigBoss
0xBigBoss / merge-two-repos-and-combine-histories.sh
Created January 17, 2023 04:56
How to merge two separate repos, combine git histories, and nesting one inside a directory.
https://stackoverflow.com/a/10548919/20335188
# steps to merge child-repo into parent-repo
brew install git-filter-repo # will need it later
git clone https://github.com/yourusername/child-repo.git
cd child-repo
git filter-repo --to-subdirectory-filter child-repo # rewrite history to move all files to child-repo folder
@0xBigBoss
0xBigBoss / analyze_docker_context.sh
Created May 27, 2023 04:14
analyze dockerignore in current directory
printf 'FROM scratch\nCOPY . /' | DOCKER_BUILDKIT=1 docker build -f - -o /tmp/docker-context .
@0xBigBoss
0xBigBoss / k8s_dash
Last active June 13, 2023 18:50
Installs and opens the Kubernetes dashboard using the recommended Quickstart settings.
#!/bin/bash
# Function to check if Kubernetes Dashboard is installed
function is_dashboard_installed {
kubectl get services --namespace=kubernetes-dashboard | grep kubernetes-dashboard >/dev/null 2>&1
return $?
}
# Function to check if Service Account and ClusterRoleBinding are installed
function is_user_installed {
@0xBigBoss
0xBigBoss / gencert.sh
Last active June 21, 2023 20:45
Generate a local self-signed certificate for example.com and *.example.com.
#!/bin/bash
# Set the domain name
domain="example.com"
wildcard_domain="*.example.com"
# Check if the certificate and key files already exist
if [[ -f "${domain}.crt" && -f "${domain}.key" ]]; then
echo "Certificate and key files already exist. Exiting..."
exit 0
@0xBigBoss
0xBigBoss / draft.md
Created June 30, 2023 03:29
[E2E Feature Flags] Onchain Feature Flags

Objective

Implementing F. E2E Feature Flags 🔴

  1. Adding New Feature 🔴
  2. Enabling Feature 🔴
  3. Disabling Feature 🔴
  4. Modifying Feature Value 🔴

Origin Document

➤ YN0000: built @my/ui in 4528 ms
➤ YN0000: Done in 5s 16ms
- info Loaded env from /Users/0xbigboss/send/send-distributions-app/apps/next/.env.local
- info Loaded env from /Users/0xbigboss/send/send-distributions-app/apps/next/.env
Welcome to Tamagui!
You can update this monorepo to the latest Tamagui release just by running:
@0xBigBoss
0xBigBoss / upgrade.zx.md
Last active July 29, 2023 22:25
Pocket Network v1 Upgrade Feature e2e

Upgrade Feature e2e

You need to have zx installed before executing this file.

npm install -g zx
zx upgrade.zx.md

Ensure ACL Owner is imported

@0xBigBoss
0xBigBoss / docker_context_analyze.sh
Created October 13, 2023 03:30
Analyze a docker context and what files would be included in your docker image. Creates a directory at /tmp/docker-context.
printf 'FROM scratch\nCOPY . /' | DOCKER_BUILDKIT=1 docker build -f - -o /tmp/docker-context .
@0xBigBoss
0xBigBoss / gh-org-contribs
Last active October 25, 2023 18:07
ZX script to fetch all contributors to an organization public repos.
#!/usr/bin/env zx
// -*- mode: js -*-
const orgName = process.argv[3];
if (!orgName) {
console.log(`Usage: gh-org-contribs ${chalk.bold("<org-name>")}`);
process.exit(1);
}