Skip to content

Instantly share code, notes, and snippets.

View shonenada's full-sized avatar
🤷‍♂️
Focusing

Yaoda Liu shonenada

🤷‍♂️
Focusing
View GitHub Profile
@shonenada
shonenada / rtsp_pusher.py
Created December 15, 2022 06:27
Push random image to RTSP stream
import time
import subprocess
import sys
import numpy as np
FPS = 25
WIDTH = 1280
HEIGHT = 720
all: help
##@ General
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk commands is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
AT=$(echo -n "$DATA" | openssl sha1 -hmac "$QINIU_SK" -binary | openssl base64 -e)
echo "$QINIU_AK:$AT"
package main
import (
"fmt"
"log"
"net/http"
"os"
"github.com/hpcloud/tail"
)
printf "$1:$(openssl passwd -apr1 ${2})\n"
/**
<Gallery>
<Photo for="img in images">
<img class="Photo-img" :src="img.url" />
</Photo>
</Gallery>
**/
.Gallery {
column-count: 5;
## ref: https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04
#!/usr/bin/env bash
package=$1
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
exit 1
fi
import string
from random import choice
from Crypto import Random
from Crypto.Cipher import AES
KEY = ''.join([choice(string.printable) for i in range(16)])
# -*- coding: utf-8 -*-
import base64
import json
import os
import pprint
import sys
import urllib2
GITHUB_API = 'https://api.github.com'
import sys
import time
def follow(filename):
log_file = open(filename, 'r')
log_file.seek(0, 2)
while True:
line = log_file.readline()
if not line: