Skip to content

Instantly share code, notes, and snippets.

View meoww-bot's full-sized avatar
🐱
meow sucking

meoww-bot meoww-bot

🐱
meow sucking
View GitHub Profile
@zh-h
zh-h / who-weibo.js
Last active February 27, 2021 19:00
是谁发的微博微博图片
function decodeBase62(number) {
var alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
var out = 0
var len = number.length - 1
for (var t = 0; t <= len; t++) {
out = out + alphabet.indexOf(number.substr(t, 1)) * Math.pow(62, len - t)
}
return out
}
@boseji
boseji / Rpi-InfluxDB-Install.md
Last active February 5, 2022 17:34
Raspberry Pi InfluxDB installation

Raspberry Pi InfluxDB: The solution for IoT Data storage

Raspberry Pi is costeffect linux computer very commonly used for IoT home automation projects.

Here are the 3 problems with conventional databases for IoT data store applications:

  • Too much or complex configuration
  • Unable to expire data / set retentional policies
  • Not tailor made of Time Series Data
@mauri870
mauri870 / manjaro-avell-g1513.md
Last active March 2, 2022 02:23
Installation of Manjaro 17 and nvidia/bumblebee drivers on Avell G1513

After a weekend of research, stress and pain I finally figure out how to install manjaro 17 and configure the nvidia/bumblebee drivers on my avell laptop

Here's my notebook specs:

$ inxi -MGCNA

Machine:   Device: laptop System: Avell High Performance product: 1513
           Mobo: N/A model: N/A v: 0.1 UEFI: American Megatrends v: N.1.02 date: 09/28/2016
Battery    BAT0: charge: 44.0 Wh 100.0% condition: 44.0/44.0 Wh (100%)
@linar-jether
linar-jether / simple_python_datasource.py
Last active May 24, 2023 01:22
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource ---- Up-to-date version maintained @ https://github.com/panodata/grafana-pandas-datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@badstreff
badstreff / csrandom.py
Last active December 4, 2022 22:40
Partial Python Implementation of C#'s Random Class
from ctypes import *
# implemented from:
# http://referencesource.microsoft.com/#mscorlib/system/random.cs,dec894a7e816e665
class Random(object):
def __init__(self, seed):
self.seed = c_int(seed).value
self.MBIG = 2147483647
self.MMIN = -2147483648
self.MZ = 0
self.MSEED = 161803398
# https://gist.github.com/achillean/1428757481e4b74e17bac962b6f71d55
# ASN Data: http://thyme.apnic.net/
10.30.10.2 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
10.30.10.32 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
10.30.1.130 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
10.34.100.2 -> (AS3356) LEVEL3 - Level 3 Communications, Inc., US
125.10.31.145 -> (AS9824) JTCL-JP-AS Jupiter Telecommunication Co. Ltd, JP
129.187.244.204 -> (AS12816) MWN-AS, DE
129.194.41.4 -> (AS559) SWITCH Peering requests: <peering@switch.ch>, CH
129.194.49.47 -> (AS559) SWITCH Peering requests: <peering@switch.ch>, CH
@mdonkers
mdonkers / server.py
Last active April 30, 2024 23:26
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active May 3, 2024 11:06
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email 'firstname.lastname@gov.bc.ca'
    
@RichiH
RichiH / gist:f2ffb824d428d8ca0c7c40cd62022b56
Last active July 24, 2023 13:06
Prometheus relabelling to get rid of port number
============================================
============================================
============================================
This does what it should:
regex: (.+?)(:80)?
Also see https://golang.org/pkg/regexp/syntax/
@nickoala
nickoala / 0_python_email.md
Last active April 29, 2024 05:54
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria