Skip to content

Instantly share code, notes, and snippets.

@suuuch
suuuch / glance.yaml
Created April 13, 2025 04:18
Glance Configure yaml
pages:
- name: Daily Read
columns:
- size: small
widgets:
- type: clock
hour-format: 24h
timezones:
- timezone: Europe/Paris
label: Paris
@suuuch
suuuch / prowlarr-radarr-sonarr-qbt.yaml
Last active February 15, 2025 12:51
docker-compose.yaml
---
services:
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- WEBUI_PORT=8080
@suuuch
suuuch / docker-compose.yaml
Last active January 5, 2024 06:16
Nextcloud + Onlyoffice + drawio
version: '2'
services:
app:
container_name: nextcloud_app
image: nextcloud:28.0.0
restart: always
ports:
- 30080:80
- 39000:9000
@suuuch
suuuch / draw_klines.py
Created March 10, 2022 06:32
K线图绘制
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec #分割子图
import mpl_finance as mpf
import os
import numpy as np
import pandas as pd
import talib
from mootdx.reader import Reader
import datetime
@suuuch
suuuch / redash_install.sh
Created September 2, 2019 06:52
redash install on ubuntu
#!/bin/bash
#
# This script setups Redash along with supervisor, nginx, PostgreSQL and Redis. It was written to be used on
# Ubuntu 18.04. Technically it can work with other Ubuntu versions, but you might get non compatible versions
# of PostgreSQL, Redis and maybe some other dependencies.
#
# This script is not idempotent and if it stops in the middle, you can't just run it again. You should either
# understand what parts of it to exclude or just start over on a new VM (assuming you're using a VM).
# If OS is Windows , Execute this sed: sed -i 's/\r$//' filename
#!/bin/sh
# Can be used by your scripts to send iMessages from the shell
# Usage:
# ./SendMessage.sh 1234567890 'hi there!'
recipient="${1}"
message="${*:2}"
cat<<EOF | osascript - "${recipient}" "${message}"
on run {targetBuddyPhone, targetMessage}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
@suuuch
suuuch / send_imessage_by_py.py
Created May 13, 2019 06:31
Python imessage
import os
cmd = """osascript<<END
tell application "Messages"
send "TEXT" to buddy "VALID E-MAIL OR PHONE #" of (service 1 whose service type is iMessage)
end tell
@suuuch
suuuch / template_spider.py
Last active April 24, 2019 03:08
[Simple Spider] Python Request Templage #Spider #Python #requests
# coding=utf-8
import requests
def get_page(url):
header = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36'}
return requests.get(url, headers=header)
@suuuch
suuuch / pg_dump_store.sh
Last active August 21, 2021 07:21
[PostgreSQL Manager] Database Backup #PostgreSQL #Backup #Restore
#1. Backup and Restore Single Database
#Backup: single database in PostgreSQL. Replace your actual database name with mydb.
pg_dump -U postgres -d mydb > mydb.pgsql
#Restore: single database backup in PostgreSQL.
psql -U postgres -d mydb < mydb.pgsql
#2. Backup and Restore All Databases
#Backup: all databases in PostgreSQL using pg_dumpall utility.
@suuuch
suuuch / us_options.py
Last active April 17, 2018 01:47
Nasdaq 股票下载地址
#code=utf-8
import requests
import pandas as pd
from bs4 import BeautifulSoup
def get_stock_options(url,is_start_page=False):
all_data = []
headers = {
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36'}
content = requests.get(url, headers=headers)
soup = BeautifulSoup(content.text,'lxml')