Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"math/rand"
"time"
)
const (
width = 80
@davecoutts
davecoutts / unifi_ubuntu_2004.sh
Last active October 22, 2024 16:08
Install Ubiquiti Unifi Controller on Ubuntu 20.04
# Install Ubiquiti Unifi Controller on Ubuntu 20.04.
# As tested on a fresh install of ubuntu-20.04.1-live-server, August 22nd 2020.
# Thanks to https://gist.github.com/tmuncks for posting the updated install steps.
sudo apt update
sudo apt install --yes apt-transport-https
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
@habibutsu
habibutsu / notes.md
Last active November 13, 2024 09:57
ETL frameworks

Distributed computation

Libraries:

@tapanhp
tapanhp / logger_utils.py
Created February 12, 2020 09:32
Python Logging module utilities
import datetime
import logging
import os
import re
import constants
log_separator = "\n===================================================================================================="
@krast
krast / ssh_config
Created December 26, 2019 05:09
tmux-template
TCPKeepAlive yes
ServerAliveInterval 60
ServerAliveCountMax 10
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Host jumpserver
User krast
Hostname jumpserver.krast.net
Port 6666
@kimbo
kimbo / scrape-doh-providers.py
Last active November 10, 2024 03:12
Scrape DoH provider URLs from cURL's wiki page (see https://raw.githubusercontent.com/wiki/curl/curl/DNS-over-HTTPS)
#!/usr/bin/env python
#
# Scrape Doh provider URLs from Curl's DNS-over-HTTPS wiki (https://raw.githubusercontent.com/wiki/curl/curl/DNS-over-HTTPS).
#
# Example usage: ./scrape_doh_providers.py '"{} - {}".format(o["url"], o["name"])'
#
import argparse
import re
import urllib.request
@shaposhnikoff
shaposhnikoff / mikrotik two WAN backup
Created November 6, 2019 22:16
mikrotik two WAN backup
/ip firewall mangle
# mark incoming connections (same rules cover both traffic for router and traffic forwarded to LAN)
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=ether1-primary new-connection-mark=conn_primary passthrough=no
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=ether2-backup new-connection-mark=conn_backup passthrough=no
# jump to another table for all potentially outgoing connections
@milolav
milolav / OwaGalExtractor.js
Last active May 22, 2024 12:04
Download Global Address List (GAL) entries as .vcf files from browser. With photos too. Can be used with Puppeteer (headless Chrome) to integrate with other systems. Doesn’t require any administrative privileges. Log in to https://outlook.office.com/people paste into console window and run one of the functions at the bottom.
/*!
OwaGalExtractor
Copyright (c) 2019-2020 milolav
Released under the MIT License
*/
; (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.OwaGalExtractor = factory()
}(this, (function () {
@lrita
lrita / main.go
Created January 29, 2019 17:25
分布式存储系统可靠性-注解
package main
import (
"fmt"
"math"
)
func C(N, K int64) float64 {
a, b := 1.0, 1.0
if N == 0 {
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active November 8, 2024 20:14
Front-end frameworks popularity (React, Vue, Angular and Svelte)