Skip to content

Instantly share code, notes, and snippets.

@yura415
yura415 / gist:9d4e59f6914ae718c139bc3b24a3901c
Created December 12, 2019 16:05
node-rdkafka consumer logs
This file has been truncated, but you can view the full file.
[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node enqueue.js`
written 100 messages
reading...
{ severity: 7,
fac: 'SASL',
message:
#!/bin/bash
set -o errexit
set -o pipefail
set -u
set -x
NVIDIA_DRIVER_VERSION="${NVIDIA_DRIVER_VERSION:-384.125}"
NVIDIA_DRIVER_DOWNLOAD_URL_DEFAULT="https://us.download.nvidia.com/tesla/${NVIDIA_DRIVER_VERSION}/NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}.run"
NVIDIA_DRIVER_DOWNLOAD_URL="${NVIDIA_DRIVER_DOWNLOAD_URL:-$NVIDIA_DRIVER_DOWNLOAD_URL_DEFAULT}"
@yura415
yura415 / init-script.sh
Last active January 23, 2019 10:42
SETUP KUBERNETES MASTER NODE ON UBUNTU WITH FLANNEL
# init cluster
sudo swapoff -a
sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=HOST_IP
# apply kubectl config
sudo cp -f /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
# untaint master
kubectl taint nodes --all node-role.kubernetes.io/master-
# install docker
apt-get update
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
let path = require("path");
let { ServiceBroker } = require("moleculer");
let ApiGatewayService = require("../../index");
// Create broker
let broker = new ServiceBroker({
logger: console,
cacher: "memory",
metrics: true,
validation: true
@yura415
yura415 / .eslintrc.json
Created October 18, 2018 17:59
Eslint config for node.js with ES2018 License: https://creativecommons.org/publicdomain/zero/1.0/
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
@yura415
yura415 / tsconfig.json
Last active August 26, 2018 15:12
tsconfig настроенный для работы с js проектом на vscode
{
"compilerOptions": {
"module": "es2015",
"moduleResolution": "node",
"target": "es2015",
"noImplicitAny": false,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"baseUrl": ".",
@yura415
yura415 / CopyStreamingAssets.cs
Last active April 12, 2018 12:52
Copy assets from streaming assets to persistent data path. Also add unique suffix to links and scripts included in html files to disable webview caching.
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngine;
using Random = UnityEngine.Random;
/// <summary>
/// Copy contents of StreamingAssets to Application.persistentDataPath
@yura415
yura415 / index.js
Created November 15, 2015 03:25
requirebin sketch
var bs58 = require('bs58')
var unencodedData = "003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187"
var out = bs58.encode(new Buffer(unencodedData, 'hex'))
console.log(out) // => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS
@yura415
yura415 / PlayPCMStreamOverTCP.cs
Created November 11, 2015 13:06
Play audio PCM stream over TCP in Unity with example broadcaster.
using UnityEngine;
using System.IO;
using System.Net.Sockets;
using System.Collections;
using System;
public class PlayPCMStreamOverTCP : MonoBehaviour
{
public TcpClient Client { get; private set; }