Skip to content

Instantly share code, notes, and snippets.

View satr's full-sized avatar

Sergey Smolnikov satr

View GitHub Profile
@satr
satr / openshift-deployment.yaml
Created February 23, 2022 09:17
openshift-deployment
kind: "DeploymentConfig"
apiVersion: "v1"
metadata:
name: "frontend"
spec:
template:
metadata:
labels:
name: "frontend"
spec:
@satr
satr / flux-setup.sh
Created September 20, 2021 20:53
flux
#----- flux 1
fluxctl install \
--git-user=${GHUSER} \
--git-branch=main \
--git-email=${GHUSER}@users.noreply.github.com \
[email protected]:${GHUSER}/flux-get-started \
--git-path=namespaces,workloads \
--namespace=flux-system | kubectl apply -f -
export GHUSER=satr
@satr
satr / ping-url-to-wait program running
Created September 10, 2021 10:19
Shell command to ping URL in loop and kill a process by name when URL is not responding
# "gedit" - here your programm to start and kill
# http://localhost:9000 - URL to ping (expecting code 200 for success)
# sleep 1 - period in seconds
nohup gedit & while [ 200 == $(curl -o /dev/null --silent -Iw '%{http_code}' http://localhost:9000) ]; do echo 'ping'; sleep 1 ; done; kill $(pgrep gedit)
@satr
satr / gist:da8fd528057a30ecad822fbd93265470
Created August 19, 2021 08:25
Setup Raspberry Pi as kiosk
sudo apt update
sudo apt upgrade -y
#add following line to the file /etc/xdg/lxsession/LXDE-pi/autostart or /home/pi/.config/lxsession/LXDE-pi/autostart
@chromium-browser --start-fullscreen --kiosk URL
#some people suggest to use files /etc/xdg/lxsession/LXDE /autostart or /home/pi/.config/lxsession/LXDE /autostart
# which does not work for me (as seems they are not for “pi” user)
#Options:
#”--kiosk" option – hides “F11 to full screen” message, but to exit from the browser - hit Alt+F4
#instead of specifying the URL in the autostart file – add the URL as a home startup page
#Disable Swap
@satr
satr / two-http-servers.go
Created May 27, 2021 07:47
Two open http ports in Go app
package main
import (
"net/http"
)
func main() {
go func() {
http.ListenAndServe(":8001", &fooHandler{})
}()
@satr
satr / openvino-rpi4-install-errata
Last active July 7, 2020 20:23
Errors and outdated info for guideline "Arm7* Single Board Computers and the Intel® Neural Compute Stick 2 (Intel® NCS 2)"
#Original guideline:
https://software.intel.com/content/www/us/en/develop/articles/arm-sbc-and-ncs2.html
#Following commands are actually three, with correct dash:
$ ./bootstrapmake –j4
$ make install
It should be:
$ ./bootstrap
$ make -j4
$ sudo make install
@satr
satr / gist:75902978080f136a996b1577e07ae579
Created June 12, 2020 06:08 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@satr
satr / ProactiveSubscriptionChanged.json
Created June 10, 2019 12:52
Un-subscribe from proactive events request the CustomProactiveSubscriptionChangedRequestHandler.java
{
"request": {
"timestamp": "2019-06-10T12:50:52Z",
"requestId": "0f5ed9e2-267e-4231-9c15-6b8f4b74e957",
"type": "AlexaSkillEvent.ProactiveSubscriptionChanged"
},
"version": "1.0",
"context": {
"System": {
"apiEndpoint": "https://api.amazonalexa.com",
@satr
satr / ProactiveSubscriptionChanged.json
Created June 10, 2019 12:49
Subscribe to proactive events request the CustomProactiveSubscriptionChangedRequestHandler.java
{
"request": {
"timestamp": "2019-06-10T12:00:15Z",
"requestId": "ef896d90-bff1-494b-bda5-aa49952e9687",
"body": {
"subscriptions": [
{
"eventName": "AMAZON.OrderStatus.Updated"
},
{
@satr
satr / SimpleAlexaSkillStreamHandler.java
Created June 10, 2019 12:40
SimpleAlexaSkillStreamHandler with CustomProactiveSubscriptionChangedRequestHandler
public class SimpleAlexaSkillStreamHandler extends SkillStreamHandler {
public SimpleAlexaSkillStreamHandler() {
super(Skills.standard()
.addRequestHandler(new WelcomeRequestHandler())
.addRequestHandler(new CustomLaunchRequestHandler())
.addRequestHandler(new CustomProactiveSubscriptionChangedRequestHandler())
.build());
}
}