Skip to content

Instantly share code, notes, and snippets.

View Detavern's full-sized avatar
🎯
Focusing

wYw Detavern

🎯
Focusing
View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active September 20, 2024 16:38
set -e, -u, -o, -x pipefail explanation
@stroebs
stroebs / make-chr.sh
Last active August 31, 2024 02:51
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 20.04 tested working 29/03/2022)
#!/bin/bash
#
# Digital Ocean Ubuntu 18.04 x64 Droplet with "Regular Intel" CPU.
# Running:
# git clone https://gist.github.com/54fc09734a3911e91eeeb43434f117df.git
# cd 54fc09734a3911e91eeeb43434f117df/
# chmod +x make-chr.sh
# ./make-chr.sh
#
# Once the reboot is done, login with root/CHANGEME and change the password!
@fire1ce
fire1ce / oh-my-zsh on openwrt or lede-project.md
Last active September 2, 2024 05:06
Install oh-my-zsh on openwrt/lede-project

Install oh-my-zsh on OpenWrt

Install Requirements Packages

opkg update && opkg install ca-certificates zsh curl git-http

Install oh-my-zsh

@Jamesits
Jamesits / vps2routeros.sh
Last active February 3, 2023 01:57
Convert your VPS to RouterOS - works on Ubuntu 16.04+. https://blog.swineson.me/install-routeros-on-any-ubuntu-vps/
#!/bin/bash
# This project has been moved to https://github.com/Jamesits/vps2routeros.
# This script is still kept for compatibility, but it will not be updated anymore.
echo "You are using an old version of vps2routeros. Please download the new version from https://github.com/Jamesits/vps2routeros ."
# VPS2RouterOS
#
# !!!!!!!!!PLEASE READ ALL THE FOLLOWING TEXT BEFORE RUNNING THIS!!!!!!!!!!!
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active September 15, 2024 18:49
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@melvincabatuan
melvincabatuan / BOOSTwithPython3
Created April 5, 2015 10:47
Compile BOOST with Python3 support
1. Check Python3 root
>>> import sys
>>> import os
>>> sys.executable
'/usr/local/bin/python3'
OR
$ which python3
/usr/local/bin/python3
@klzgrad
klzgrad / 00-README.txt
Last active April 19, 2024 09:26
DNS compression pointer mutation
$ LD_PRELOAD=$PWD/sendmsg.so dig twitter.com @8.8.8.8
;; Warning: Message parser reports malformed message packet. <-- malformed 因为把压缩指针当作域名一部分了
;; Question section mismatch: got twitter.com/RESERVED0/CLASS256
; <<>> DiG 9.9.5-3-Ubuntu <<>> twitter.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44722
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
@nhoad
nhoad / gist:8966377
Last active March 2, 2023 09:30
Async stdio with asyncio
import os
import asyncio
import sys
from asyncio.streams import StreamWriter, FlowControlMixin
reader, writer = None, None
@asyncio.coroutine
def stdio(loop=None):
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//