Skip to content

Instantly share code, notes, and snippets.

View bllli's full-sized avatar
🙇‍♂️
Working

BLLLI bllli

🙇‍♂️
Working
View GitHub Profile
@bllli
bllli / C语言练习.md
Last active November 8, 2017 01:24
给大宝贝儿写的C语言练习题
  • 共用体中辨析多个字节变量如何存储在内存中?详见union.c
@bllli
bllli / MySQL 事务.md
Last active November 15, 2017 14:17
MySQL 学习记录

MySQL 事务

测试环境 mysqld Ver 5.7.20-0ubuntu0.17.04.1 for Linux on x86_64 ((Ubuntu))

隔离级别

对比

隔离级别 脏读(Dirty Read) 不可重复读(NonRepeatble) 幻读(Phantom Read)
@bllli
bllli / Django多数据库配置.md
Last active January 10, 2018 06:16
工作中使用Django的一些记录

双库配置

使用场景

数据后台
1个读写库,用于存放分析结果数据、数据后台管理   1个另一个项目生产环境的只读库,是本系统统计数据的来源

配置代码

# settings.py
DATABASES = {
@bllli
bllli / MYSQL开放3306端口.md
Last active November 6, 2018 12:04
cosplay运维

0x01 检查防火墙是否放行3306

0x02 查看3306监听情况

$ netstat -an | grep 3306
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN

这样的就是3306端口只是在IP 127.0.0.1上监听,所以拒绝了其他IP的访问。

解决办法

// ==UserScript==
// @name 去你大爷的 CSDN 全文阅读
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 把登录后查看全文阅读的那个啥玩意儿给干掉
// @author laobubu
// @match http://blog.csdn.net/*/article/details/*
// @match https://blog.csdn.net/*/article/details/*
// @grant none
// ==/UserScript==
@bllli
bllli / Read file from resources folder in Spring Boot
Last active May 22, 2019 05:41
[SpringBoot] Spring的一些基础应用 #Spring #Java
// https://stackoverflow.com/questions/44399422/read-file-from-resources-folder-in-spring-boot/44399541
// file path: /path/to/src/main/resources/config/sample.txt
import org.springframework.util.ResourceUtils;
import java.io.File;
import java.nio.file.Files;
File file = ResourceUtils.getFile("classpath:config/sample.txt")
@bllli
bllli / main.go
Last active September 19, 2021 09:22
package main
import (
"context"
"fmt"
"time"
)
func main() {
tr := NewTracker()
@bllli
bllli / asdf
Last active February 26, 2022 15:52
fuck gfw
asdf plugin-add python https://gitee.com/bllli/asdf-python.git
# pyenv 使用gitee加速
sed -i 's/https:\/\/github.com\/pyenv\/pyenv.git/https:\/\/gitee.com\/bllli\/pyenv.git/g' `grep 'https://github.com/pyenv/pyenv.git' -rl .asdf --include "*"`
sed -i 's/git:\/\/github.com\/pyenv\/pyenv.git/git@gitee.com:bllli\/pyenv.git/g' `grep 'git://github.com/pyenv/pyenv.git' -rl .asdf --include "*"`
# Python包使用华为云加速
# https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz
version: "3"
services:
mysql5_5:
restart: always
container_name: mysql5_5
command:
--lower_case_table_names=1
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--max_allowed_packet=128M
import asyncio
import datetime
import random
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import StreamingResponse
app = FastAPI()