This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to check if a port is available | |
check_port() { | |
local port=$1 | |
if ! lsof -i:$port > /dev/null; then | |
echo $port | |
else | |
while lsof -i:$port > /dev/null; do | |
port=$((port+1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
import urllib.request | |
import base64 | |
import json | |
import time | |
import os | |
webui_server_url = 'http://127.0.0.1:7860' | |
out_dir = 'api_out' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
volumes: | |
postgres: | |
services: | |
postgres: | |
image: postgres | |
restart: unless-stopped | |
healthcheck: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.
You can download Windows 10 or Windows 11 directly from Microsoft.
After plugging the drive to your machine, identify the name of the USB device using diskutil list
, which should return an output like the one below. In my case, the correct disk name is disk2
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ========================================================================= | |
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817 | |
# ========================================================================= | |
# This script will compile and install a static FFmpeg build with | |
# support for NVENC in Ubuntu. Developed in Ubuntu 23.10, | |
# with NVIDIA Drivers v535.129.03 and CUDA v12.2 with a GPU | |
# with CUDA capability 8.6 (RTX 3080) (see ccap below). | |
# It assumes NVIDA drivers are installed and that you have a | |
# CUDA-compatible GPU. You can check installed drivers with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
gh api graphql --paginate \
--jq '.data.organization.repositories.nodes[] | .defaultBranchRef.name + "\t" + .name' \
-F org=SomeOrg \
-f query='
query($org:String!, $endCursor:String) {
organization(login:$org) {
repositories(first: 100, after: $endCursor, isFork:false, orderBy: {field:NAME, direction:ASC}) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fragment branchProtection on BranchProtectionRule { | |
allowsDeletions | |
allowsForcePushes | |
creator { | |
login | |
} | |
id | |
isAdminEnforced | |
requiredStatusCheckContexts | |
requiredApprovingReviewCount |
NewerOlder