Skip to content

Instantly share code, notes, and snippets.

View esin's full-sized avatar
🖥️
Engineering

Andrey Esin esin

🖥️
Engineering
View GitHub Profile
@krisek
krisek / alert.rules.yml
Last active November 10, 2024 20:09
Prometheus alert rules for node exporter
groups:
- name: node_exporter_alerts
rules:
- alert: Node down
expr: up{job="monitoring-pi"} == 0
for: 2m
labels:
severity: warning
annotations:
title: Node {{ $labels.instance }} is down
@mariodian
mariodian / zte-sms-control.sh
Created December 4, 2019 11:39
Read SMS on ZTE
#!/bin/bash
URL=http://192.168.0.1
REFERER="$URL/index.html"
URL_SET="$URL/goform/goform_set_cmd_process"
URL_GET="$URL/goform/goform_get_cmd_process"
CONTENT_PREVIEW_LENGTH=40
command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not installed. Aborting."; exit 1; }
@mayneyao
mayneyao / notion2blog.js
Last active September 14, 2024 01:22
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
kubectl() {
if [[ $1 == "apply" ]] || [[ $1 == "create" ]] || [[ $1 == "delete" ]] || [[ $1 == "edit" ]] || [[ $1 == "patch" ]]; then
cc=$(/usr/bin/kubectl config current-context);
read -p $'Current context is \e[1m'$cc$'\e[0m. Show must go on? ' -n1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
/usr/bin/kubectl $@
return 0
fi
@bretton
bretton / improved-lnd-bitcoind-install.md
Last active January 25, 2022 14:07
updated & improved guide to installing LND, Bitcoind, on Ubuntu 16.04 Server on testnet

2018-03-18: Updating of this guide is taking a backseat to the mainnet version at

Intro

This guide is specific to getting LND and bitcoind running on ubuntu 16.04 LTS for testnet.

It does not address mainnet, or using btcd, or neutrino.

Original installation guide:

@marshyon
marshyon / main.go
Created November 11, 2016 14:30
golang concurrent http client with worker and generator 'load balance' mechanism and pool of workers
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func getPage(url string) (int, error) {
resp, err := http.Get(url)
repo=openshift/origin && curl -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull" | jq --raw-output .token)" "https://registry.hub.docker.com/v2/${repo}/manifests/latest"
@groundrace
groundrace / webcryptoapi.html
Created April 13, 2016 23:56 — forked from deiu/webcryptoapi.html
Web Crypto API: RSA keygen & export & import & sign & verify & encrypt & decrypt
<html>
<head>
<script>
function generateKey(alg, scope) {
return new Promise(function(resolve) {
var genkey = crypto.subtle.generateKey(alg, true, scope)
genkey.then(function (pair) {
resolve(pair)
})
})
@Jamesits
Jamesits / esp12e-blink.ino
Last active September 24, 2020 03:22
Blink for ESP8266 ESP-12E NodeMCU 1.0 Board, Arduino IDE: Hello world and function tests.
@fideloper
fideloper / update_curl.sh
Last active January 11, 2024 15:23
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2