Skip to content

Instantly share code, notes, and snippets.

@c80609a
c80609a / README.md
Created March 30, 2025 12:02 — forked from ihciah/README.md
V2ray with cloudflare websocket

Configure v2ray with cloudflare with docker and docker-compose

  • caddy-*: http server related files
  • v2ray-*: v2ray related files
  • forword-*: files to relay requests
@c80609a
c80609a / pgplaybook.yml
Created March 25, 2025 01:18 — forked from internetuser2008/pgplaybook.yml
custom Ansible Playbook to deploy PostgerSql or PostgreSql BDR + Pgbackrest + Pgbouncer
# Usage
# host supply IP
# -t(tags) run specific tasks ie. db=master, dbslave=slave1/2, promote=update slave to master, remove= remove host
# ansible-playbook pg.yml -e "host=192.169.99.2 -t db ##Build Master
# ansible-playbook pg.yml -e "host=192.168.99.3" -t dbslave ##Build Slave
# ansible-playbook pg.yml -e "host=192.168.99.3" -t promote ##Promoe slave to master
# ansible-playbook pg.yml -e "host=192.168.99.2" -t remove ##Remove node from cluster
# ansible-playbook /var/lib/pgsql/pg.yml -e "host=192.168.99.4" -s -t db --user=user1 --ask-sudo-pass ##Ubuntu
# Created Bimal Patel
---
@c80609a
c80609a / update_zapret.sh
Created March 5, 2025 16:48 — forked from kotsmotritnastul/update_zapret.sh
как обновить zapret одним скриптом
#!/bin/sh
unset latest_version_on_github
unset current_version_on_router
main()
{
find_out_what_os_we_work_in
find_out_what_version_is_here
find_out_what_version_is_on_github
if compare_version
then
@c80609a
c80609a / mocker.py
Created December 26, 2024 11:21 — forked from ikonst/mocker.py
pytest_mock with patch.method
import gc
import sys
import types
import unittest.mock
from typing import Any
from typing import Callable
from typing import Generator
from typing import Optional
from typing import TYPE_CHECKING
@c80609a
c80609a / workflow_ssd1b.json
Created December 25, 2024 08:06 — forked from 4rmx/workflow_ssd1b.json
ComfyUI Workflow for test SSD-1B model
{
"last_node_id": 152,
"last_link_id": 387,
"nodes": [
{
"id": 11,
"type": "VAEDecode",
"pos": [
4250,
-150
@c80609a
c80609a / Runpod_SD_download.sh
Created December 22, 2024 16:08 — forked from TheCraigFergus/Runpod_SD_download.sh
Runpod_SD_download
## Download SD's models, loras, textual inversions to Runpod's machine
# Checkpoints
cd /workspace/stable-diffusion-webui/models/Stable-diffusion
wget -O AbsoluteReality.safetensors https://civitai.com/api/download/models/132760?type=Model&format=SafeTensor&size=pruned&fp=fp16
wget -O RealisticVision-v51.safetensors https://civitai.com/api/download/models/130072?type=Model&format=SafeTensor&size=full&fp=fp16
wget -O CyberRealistic.safetensors https://civitai.com/api/download/models/114429?type=Model&format=SafeTensor&size=pruned&fp=fp32
wget -O EpicRealism.safetensors https://civitai.com/api/download/models/127742?type=Model&format=SafeTensor&size=pruned&fp=fp16
wget -O MajicMIX.safetensors https://civitai.com/api/download/models/94640?type=Model&format=SafeTensor&size=pruned&fp=fp16
wget -O URPM.safetensors https://civitai.com/api/download/models/15640?type=Model&format=SafeTensor&size=full&fp=fp16
@c80609a
c80609a / date-timezones-by-offset
Created December 19, 2024 08:40 — forked from gerardroche/date-timezones-by-offset
Timezones by offset
name: Pacific/Kiritimati , cc: KI , offset: 50400 (14 hours) , comments: Line Islands
name: Pacific/Chatham , cc: NZ , offset: 49500 (13.75 hours) , comments: Chatham Islands
name: Pacific/Fakaofo , cc: TK , offset: 46800 (13 hours) , comments:
name: Antarctica/South_Pole , cc: AQ , offset: 46800 (13 hours) , comments: Amundsen-Scott Station, South Pole
name: Antarctica/McMurdo , cc: AQ , offset: 46800 (13 hours) , comments: McMurdo Station, Ross Island
name: Pacific/Tongatapu , cc: TO , offset: 46800 (13 hours) , comments:
name: Pacific/Enderbury , cc: KI , offset: 46800 (13 hours) , comments: Phoenix Islands
name: Pacific/Apia , cc: WS , offset: 46800 (13 hours) , comments:
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
class BinaryNode:
__slots__ = ("value", "left", "right")
def __init__(self, value=None, left=None, right=None):
self.value = value
self.left = left
self.right = right
def __repr__(self):
return f"<BinaryNode value={self.value}; {1 if self.left else 0 + 1 if self.right else 0} children>"
@c80609a
c80609a / convert2voice.sh
Created September 12, 2023 06:44 — forked from samoshkin/convert2voice.sh
Google Text-to-Speech API example
#!/bin/bash
text=$(cat -)
request="{
'input':{
'ssml':'<speak>$text</speak>'
},
'voice':{
'languageCode':'en-gb',
'name':'en-GB-Wavenet-D',