Skip to content

Instantly share code, notes, and snippets.

@trojblue
trojblue / obsidian-declutter.css
Created October 2, 2020 17:28
Decluttering Obsidian edit mode
/* DECLUTTER;
from Obuntu Theme https://github.com/DubininDmitry/Obuntu-theme-for-Obsidian/blob/master/obsidian.css
copy&paste this to your obsidian.css to get a edit mode kind of similar to WYSIWYM
*/
/* change heading size in edit mode */
/* for better looking after enable Clutter free edit mode */
.cm-header-1 {
font-size: 30px;
color: var(--text-accent);
root@kali:/home/kali/CSC/smd# source venv/bin/activate
(venv) root@kali:/home/kali/CSC/smd# pip3 install -r requirements.txt
Collecting beautifulsoup4==4.8.0
Using cached beautifulsoup4-4.8.0-py3-none-any.whl (97 kB)
Collecting Flask==0.12.2
Using cached Flask-0.12.2-py2.py3-none-any.whl (83 kB)
Collecting humanize==0.5.1
Using cached humanize-0.5.1-py3-none-any.whl
Collecting imageio==2.3.0
Using cached imageio-2.3.0-py2.py3-none-any.whl (3.3 MB)
@trojblue
trojblue / bbr.md
Last active January 19, 2021 19:14
Enabling CentOS 7 BBR in 4 lines

install newest kernel & bbr:

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org && sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.el repo.noarch.rpm && sudo yum --enablerepo=elrepo-kernel install kernel-ml -y &&sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \' 

check bbr ranking on boot list:

 sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
title
test page

This is the test document for using non-alphabetical symbols in quartz;

Steps to reproduce

  • save this file to quartz/content/test/test.md
  • start hugo
  • search for recherchée in the search box
@trojblue
trojblue / christmas_tags.py
Last active December 21, 2022 10:53
christmas tags
import random
start_str = "a clean painting of ((1girl)), best quality, "
description_tags = "short pointy ears, solo, red hair, palace, carpet, royal, town, bangs, medium hair, long sleeves, blue rose, striped, rose, long hair, elf, alternative costume, crown".split(", ")
christmas_tags = "jingle bell, official art, shawl, shorts, christmas ornaments, scenery, snow, gift, full body, confetti, postage stamp, stuffed toy, tassle, white flower, (close-up:0.5), fur collar, scenery, christmas tree".split(', ')
end_str = "original"
[random.shuffle(i) for i in (description_tags, christmas_tags)]

FFMPEG-commands

自用简单操作备份


基本设置

码率, 分辨率

  • b:v 视频码率; b:a 音频码率
@trojblue
trojblue / webui_heartbeat.sh
Last active March 4, 2023 00:44
Checks if stable diffusion webui is not running every 5 seconds, and restarts if it is killed
#!/bin/bash
# Start the program
cd /root/webui
source /root/miniconda3/bin/activate /root/miniconda3/envs/py310
python ~/webui/launch.py --lowram --no-half-vae --port 6006 --disable-console-progressbars --disable-safe-unpickle --api & pid=$!
# Wait for the program to start
while ! netstat -an | grep "LISTEN" | grep ":6006" > /dev/null; do
sleep 1

更新环境:

apt-get -y update && apt-get -y upgrade && apt-get -y install iftop libgl1

miniconda:

cd ~/
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -P miniconda.sh
bash miniconda.sh
import re
import json
from selenium import webdriver
def try_get_page():
url = "https://bcy.net/illust/toppost100?type=week&date=20230612"
# You need to have the correct WebDriver executable (geckodriver for Firefox) in your PATH
driver = webdriver.Chrome()
# use in a ipynb notebook
import os
from PIL import Image
from IPython.core.display import HTML, display as disp
import io
import base64
# Disable truncating of text
pd.set_option('display.max_colwidth', None)