Skip to content

Instantly share code, notes, and snippets.

View askb's full-sized avatar

askb askb

View GitHub Profile
@AlexAtkinson
AlexAtkinson / FOO_ENV.md
Created May 10, 2023 18:09
An explanation of how $FOO_ENV environment variable configurations work.

FOO_ENV Environment Variables

These variables, such as $GITHUB_ENV, $ENV0_ENV, etc., simply point at a file that is sourced to populate an environment with the contained code, much like a .bashrc file.

These enviornment variables, while convenient, present a great amount of difficulty if they're not understood. Errors like ambiguous redirect, or no such file or directory, are common. In the worst case they get deleted, in which case they'll have to be re-created with the default content.

Beyond the simple foobars that users might have with this convenience utility, they also present an additional challenge in that they may persist data that is deisrable to delete. Clearing this data is another challenge. See below for more.

Demo

@ftuyama
ftuyama / volume_alert.js
Created July 4, 2019 14:37
Binance Volume alert
// Access Volume Monitor: https://agile-cliffs-23967.herokuapp.com/binance
// Copy and past on chrome console:
var audio = new Audio("/static/beep.wav");
var audioCtx = new AudioContext();
var source = audioCtx.createMediaElementSource(audio);
// create a gain node
var gainNode = audioCtx.createGain();
@matt2005
matt2005 / lambda_function.py
Last active July 19, 2024 17:57 — forked from awarecan/lambda_function.py
Alexa Smart Home Skill Adapter for Home Assistant
"""
Copyright 2019 Jason Hu <awaregit at gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@diffficult
diffficult / hikvision_rtsp.md
Last active December 22, 2021 22:24
Hik Vision RTSP feeds

Live View URL

rtsp://<address>:<port>/Streaming/Channels/<id>/

rtsp://<username>:<password>@<address>:<port>/Streaming/Channels/<id>/

Where <address> is the IP address of your camera, <port> is the RTSP port of the camera, and <username> and <password> refer to the login credentials of your camera.

OOM_GIT_SHA=$1
NEXUS_HELM_STAGING_PATH="https://nexus.onap.org/content/sites/oom-helm-staging/$OOM_GIT_SHA"
NEXUS_HELM_RELEASE_PATH="https://nexus.onap.org/content/sites/oom-helm-release/3.0.0"
echo $OOM_GIT_SHA
echo $NEXUS_HELM_STAGING_PATH
echo $NEXUS_HELM_RELEASE_PATH
# fetch index.yaml
curl -o index.yaml "$NEXUS_HELM_STAGING_PATH/index.yaml"
@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active July 19, 2024 07:06
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@arthurzhukovski
arthurzhukovski / cctv-startup.bat
Created July 17, 2018 14:49
RTSP to HTTP with VLC (Windows)
:: The following line is neccessary if you need an ability to restart the streams with this batch file
:: Kill all existing streams (the command actually suspends ALL the vlc processes):
taskkill /f /im "vlc.exe"
:: Run two instances of VLC. These would transcode MP4 rtsp-stream to Motion JPEG http-stream:
start vlc -vvv -Idummy rtsp://login:password@192.168.0.2/streaming/channels/2/preview --sout #transcode{vcodec=MJPG,venc=ffmpeg{strict=1},fps=10,width=640,height=360}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:9911/}
start vlc -vvv -Idummy rtsp://login:password@192.168.0.3/streaming/channels/2/preview --sout #transcode{vcodec=MJPG,venc=ffmpeg{strict=1},fps=10,width=640,height=360}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:9912/}
:: In order to execute VLC with `vlc` as in exapmle above, you have to add corresponding value to the PATH variable.
:: Otherwise you have t
@ThomasLeister
ThomasLeister / cloud-ubuntu-netplan-secondary-ip-static.md
Created May 25, 2018 08:30
Ubuntu netplan config for secondary ip address

In case there's already a DHCP config for netplan for the private IP address:

File: /etc/netplan/50-cloud-init.yaml

Contents:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active June 17, 2024 15:05
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@sivel
sivel / ansible-git.md
Last active October 16, 2023 16:44
Ansible Contributors Guide for working with git/GitHub

Ansible Contributors Guide for working with git/GitHub

First Note

Never, ever, modify or commit things to devel, always do work in a feature branch

Setting up the ansible and modules repos from forks

export GITHUB_USER=sivel