Skip to content

Instantly share code, notes, and snippets.

View notsobad's full-sized avatar

notsobad notsobad

View GitHub Profile
@rain-1
rain-1 / LLM.md
Last active May 7, 2024 13:50
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@Lekensteyn
Lekensteyn / inject-tls-secrets.py
Last active April 30, 2024 10:40
Extracts a subset of TLS secrets and injects them in an existing capture file (requires Wireshark 3.0).
#!/usr/bin/env python3
# Extracts a subset of TLS secrets and injects them in an existing capture file.
#
# Author: Peter Wu <peter@lekensteyn.nl>
import argparse
import os
import shlex
import subprocess
import sys
@leapar
leapar / alerta.md
Created August 24, 2017 09:52
alerta,预警,通知

alerta

预警,通知是任何监控以及运维的核心模块。所有报警信息肯定需要一个独立的系统进行存储整理,方便管理以及展示。 而alerta刚好就是负责这个。 alerta包含三大块内容:

  1. Heartbeat心跳包,不停采集心跳信息,如果没有发送,那么就产生超时,表示系统不可用。
  2. Housekeeping这是一个独立程序,定时检查更新告警信息状态,例如删除过期的消息。可以设置多久清除过期的告警信息。
  3. Alert告警信息,每个告警信息默认一天超时
@valeriansaliou
valeriansaliou / iptables-http-dos-shield.txt
Last active September 21, 2023 07:34
HTTP/HTTPS DOS shield w/ IPTables
# Those rules protect HTTP/HTTPS services for both IPv4 and IPv6 sources as such:
# 1. Prevent a /32 IPv4 or /64 IPv6 to open more than 10 HTTPS?/TCP connections per second (the limit is high, but this still shield against some attacks) — DROP TCP packets in this case, to avoid generating egress traffic sending a RST
# 2. Limit ingress bandwidth to HTTPS? services to 32KB/sec (adjust to your needs, in my case it is used to shield a WebSocket backend against incoming WebSocket message floods)
# 3. Limit the number of simultaneous ongoing connections to HTTPS? to 40 (also, high limit, adjust to your needs)
# The protections those rules offer:
# 1. Prevent crypto-DOS (ie. a client that proceed too many key exchanges and thus exhaust server CPU)
# 2. Prevent WebSocket floodings (eg. I use this for Socket.IO, which has no efficient way to rate-limit received messages before they get parsed)
# 3. Prevent ephemeral TCP port exhaustion due to a client holding too many TCP connections
# 4. Prevent IPv6 rotation attac
@bom-d-van
bom-d-van / ddos.txt
Created February 12, 2017 11:46
Detecting and Mitigating DDOS Attacks
Detecting and Mitigating DDOS Attacks
#List all Finish (FIN) packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0'
#List all SYN and SYN-ACK packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0'
@terrydang
terrydang / install_nvidia_driver_in_ubuntu1604.md
Last active August 8, 2022 09:31
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@drmalex07
drmalex07 / celeryconfig.py
Last active August 31, 2023 03:53
A quickstart example with celery queue. #celery
# This is a quickstart! In the real world use a real broker (message queue)
# such as Redis or RabbitMQ !!
BROKER_URL = 'sqlalchemy+sqlite:///tasks.db'
CELERY_RESULT_BACKEND = "db+sqlite:///results.db"
CELERY_IMPORTS = ['tasks']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
@vitalybe
vitalybe / tab.bash
Last active May 11, 2022 08:14 — forked from bobthecow/tab.bash
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc`
#
@3v1n0
3v1n0 / gpControl.json
Last active November 2, 2020 22:05
GoPro Hero4 Remote tools
{
"version":2.0,
"display_hints":[
{
"key":"GPCAMERA_GROUP_VIDEO",
"display_name":"Video Settings",
"settings":[
{
"setting_id":5,
"widget_type":"select",
from tornado.testing import AsyncHTTPTestCase, gen_test
from tornado.web import Application
from tornado.web import RequestHandler
from tornado.gen import coroutine, Return
class HelloHandler(RequestHandler):
@coroutine