Skip to content

Instantly share code, notes, and snippets.

View LittleWat's full-sized avatar
🏠
Working from home

Kohei Watanabe LittleWat

🏠
Working from home
  • Tokyo
View GitHub Profile
/*
* Copyright 2020 JBoss Inc
*
* 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
*
@LittleWat
LittleWat / RESULT
Last active May 17, 2023 07:34
test-ytt
```shell
$ ytt -f template.yaml -f schema.yaml -f value-a.yaml -f value-b.yaml
channels:
b.atopic: <===== This should be `a.atopic`
name: atopic
b.btopic:
name: btopic
```
@LittleWat
LittleWat / kafka-connect.log
Last active March 28, 2023 08:45
Strimzi Log
Preparing truststore
Preparing truststore is complete
Starting Kafka Connect with configuration:
# Bootstrap servers
bootstrap.servers=<MskBootstrapServers>
# REST Listeners
rest.port=8083
rest.advertised.host.name=10.13.95.77
rest.advertised.port=8083
# Plugins
@LittleWat
LittleWat / find_subsets.py
Created February 11, 2022 10:35
How to find subsets without itertools in Python
def find_subsets(arr) :
result = []
n = len(arr)
for i in range(2**n):
binstr = format(i, f"0{n}b")
print(binstr)
tmp = []
for j, onebin in enumerate(binstr):
if onebin == "1":
@LittleWat
LittleWat / mask_kvs_stream.py
Created February 7, 2022 13:58
just sample of masking people using Yolact on Kinesis Video Streams
def mask_kvs_stream(net:Yolact, in_arn:str, out_arn:str, cuda:bool):
out_stream_name = out_arn.split(":")[-1].split("/")[1]
reader = KVSReader(in_arn)
while True:
streaming_url = reader.get_hls_streaming_session_url()
if not streaming_url:
time.sleep(1)
@LittleWat
LittleWat / notify_azure_cost.py
Last active June 9, 2022 21:17
Notify Azure Cost from AWS Lambd with python
import json
import os
from datetime import datetime
import requests
SLACK_WEBHOOK_URL = os.environ['SLACK_WEBHOOK_URL']
ENV = os.environ['ENV']
SUBSCRIPTION_ID = os.environ["SUBSCRIPTION_ID"]
TENANT = os.environ["TENANT"]
@LittleWat
LittleWat / install_nvidia_driver.md
Created November 8, 2021 06:05 — forked from espoirMur/install_nvidia_driver.md
How I fix this issue NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running

I had many driver installed I my virtual machine , so It was actually the reason why I was having the error.

To fix it I had first to remove all driver I have installed before using :

  • sudo apt-get purge nvidia-*
  • sudo apt-get update -sudo apt-get autoremove

After that I when a head and installed the latest version of it nvidia driver:

I did :

@LittleWat
LittleWat / m5stack-pir-switchbot.ino
Last active July 18, 2021 09:06
Move switchbot using m5stack with PIR sensor
#include "BLEDevice.h"
#include "Free_Fonts.h"
#include <M5Stack.h>
#define SWITCHBOT_MAC "E6:21:7F:F9:06:69" // FIXME
static BLEUUID serviceUUID("CBA20D00-224D-11E6-9FB8-0002A5D5C51B");
static BLEUUID characteristicUUID("CBA20002-224D-11E6-9FB8-0002A5D5C51B");
static BLEAdvertisedDevice* myDevice;
@LittleWat
LittleWat / audio_effects_demo_directory.cpp
Last active December 25, 2022 01:11
audio_effects_demo_directory.cpp
/*###############################################################################
#
# Copyright 2020 NVIDIA Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions: