Skip to content

Instantly share code, notes, and snippets.

View delfer's full-sized avatar

Alexander Chumakov delfer

View GitHub Profile
@delfer
delfer / describe.py
Created July 19, 2024 16:43
AI file describer
import sys
import os
import base64
from PIL import Image
import textract
import litellm
import csv
import io
from PyPDF2 import PdfReader
@delfer
delfer / install-outline.sh
Last active October 29, 2024 12:57
Instal Outline Server without Docker
# Tested on:
# - Ubuntu 20.04 LTS
# - Ubuntu 22.04.2 LTS
#
# Tested with https://github.com/Jigsaw-Code/outline-server/commit/9a3498112d5f7c59f7017e1666678e2921fad46f from May 16 2024
# Install prerequirements
# 7zip to extract zip
apt install p7zip-full
# task to run app
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
@delfer
delfer / 3d-printer-status-bot.sh
Last active September 20, 2022 10:35
Flying Bear Ghost 5 Telegram Bot
#!/bin/bash
PRINTER_IP={IP}
API=https://api.telegram.org/bot{TOKEN}
CHAT={CHAT}
STATE_FILE=/run/3d-printer-sate.mon
MESSAGE_ID_FILE=/run/3d-printer-msg-id.mon
# Status table
STATE_OFFLINE=f
@delfer
delfer / wg0.conf
Created March 30, 2022 06:39
Example Nyr wg0.conf
# Do not alter the commented lines
# They are used by wireguard-install
# ENDPOINT 123.32.1.123
[Interface]
Address = 10.7.0.1/24
PrivateKey = 6BHdTUCKVScVazHW7hlWHG02HP58qVbdS5UZ/UgZrHU=
#ListenPort = Commented line
ListenPort = 51820
## One more comment for Address = PrivateKey = ListenPort =
@delfer
delfer / crontab
Created December 22, 2020 17:32
autoclean tmp
0 12 * * * find ~/tmp/1day -mtime +1 -exec rm -rf {} \;
0 13 * * * find ~/tmp/7days -mtime +7 -exec rm -rf {} \;
@delfer
delfer / gist:a29aad138386556f727850764a17995e
Created September 21, 2020 19:10
jasperserver StringIndexOutOfBoundsException
# this is because Browser sent empty Accept-Language header
2020-09-21 22:05:10,214 ERROR SystemErrorController,http-nio-0.0.0.0-8080-exec-10:86 - Internal server error
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: 2
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
@delfer
delfer / .dockerignore
Last active June 17, 2020 14:32
Dummy 500Mb Docker image
# Ignore everything
*
@delfer
delfer / import_github_keys.sh
Created March 17, 2020 07:17
Import keys from GitHub accounts to SSH authorized_keys
#!/bin/sh
#set user or user list!!!
USERS="delfer user2 user3"
mkdir ~/.ssh || true
for USER in $USERS; do
URL=https://github.com/${USER}.keys
STORE=~/.ssh/authorized_keys
@delfer
delfer / postgresql.conf
Created November 28, 2019 14:22
Non-Durable PostgreSQL
#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------
# Add settings for extensions here
wal_level = minimal
max_wal_senders = 0
fsync = off
synchronous_commit = off
full_page_writes = off
@delfer
delfer / configuration.yaml
Last active November 28, 2019 14:00
ha_pg_disk_write_test
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts: