Skip to content

Instantly share code, notes, and snippets.

View afoninsky's full-sized avatar

Andrey Afoninsky afoninsky

  • Saint Petersburg
View GitHub Profile
#!/bin/sh
v=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
VERSION=$(echo $v | sed -e "s/\./-/g")
DEPLOY=".deploy.yaml"
// Adalight protocol specification:
// A 'magic word' (along with LED count & checksum) precedes each block
// of LED data; this assists the microcontroller in syncing up with the
// host-side software and properly issuing the latch (host I/O is
// likely buffered, making usleep() unreliable for latch). You may see
// an initial glitchy frame or two until the two come into alignment.
// The magic word can be whatever sequence you like, but each character
// should be unique, and frequent pixel values like 0 and 255 are
// avoided -- fewer false positives. The host software will need to
// generate a compatible header: immediately following the magic word
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup()
{
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
2016-08-18T15:51:10.595Z o83jior0ltwh/1471535470569/35273/- INFO hello Seneca/2.1.0/o83jior0ltwh/1471535470569/35273/-
2016-08-18T15:51:10.609Z o83jior0ltwh/1471535470569/35273/- DEBUG options { log: { map: [ { level: 'all', handler: { [Function: print] routestr: '{ level: \'fatal\' }' } } ] }, tag: '-', idlen: 12, timeout: 11111, default_plugins: { basic: true, cluster: true, 'mem-store': true, repl: true, transport: true, web: true }, debug: { fragile: false, undead: false, print: { options: false }, act_caller: false, short_logs: false, callpoint: false }, strict: { result: true, fixedargs: true, add: false, find: true, maxloop: 11 }, actcache: { active: true, size: 11111 }, trace: { act: false, stack: false, unknown: 'warn' }, stats: { size: 1024, interval: 60000, running: false }, deathdelay: 11111, admin: { local: false, prefix: '/admin' }, plugin: {}, internal: { close_s
2016-08-18T15:52:27.963Z pm59c32dhnbz/1471535547940/35344/- INFO hello Seneca/2.1.0/pm59c32dhnbz/1471535547940/35344/-
2016-08-18T15:52:27.978Z pm59c32dhnbz/1471535547940/35344/- DEBUG options { log: { map: [ { level: 'all', handler: { [Function: print] routestr: '{ level: \'fatal\' }' } } ] }, tag: '-', idlen: 12, timeout: 11111, default_plugins: { basic: true, cluster: true, 'mem-store': true, repl: true, transport: true, web: true }, debug: { fragile: false, undead: false, print: { options: false }, act_caller: false, short_logs: false, callpoint: false }, strict: { result: true, fixedargs: true, add: false, find: true, maxloop: 11 }, actcache: { active: true, size: 11111 }, trace: { act: false, stack: false, unknown: 'warn' }, stats: { size: 1024, interval: 60000, running: false }, deathdelay: 11111, admin: { local: false, prefix: '/admin' }, plugin: {}, internal: { close_s
#!groovy
// https://jenkins.fulldive.com/env-vars.html/
node('nodejs-latest') {
try {
stage('Fetch') {
git url: 'https://github.com/afoninsky/micro-test'
// sh 'PACKAGE_NAME=$(node -pe "require(\'./package.json\').name")'
// sh 'PACKAGE_VERSION=$(node -pe "require(\'./package.json\').version")'
sh 'npm install'
}
FROM jenkinsci/jnlp-slave
ARG NODE_VERSION
USER root
RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz"
RUN usermod -G users jenkins
USER jenkins
machine:
environment:
REGISTRY_URL: us.gcr.io
GOOGLE_PROJECT_NAME: spair-api
CLUSTER_NAME: edissons-cluster
CLOUDSDK_COMPUTE_ZONE: us-central1-f
SERVICE_NAME: helloworld
services:
- docker
general:
branches:
ignore: # https://discuss.circleci.com/t/deploy-on-tag-not-running-please-help/5104/8
- /^(?!noSuchBranch).*$/
machine:
environment:
REGISTRY_URL: us.gcr.io
GOOGLE_PROJECT_NAME: spair-api
CLUSTER_NAME: edissons-cluster
@afoninsky
afoninsky / create-image.sh
Created November 28, 2016 14:25
GKE deploy image
#!/bin/bash
### run deployment from local machine (not CI)
docker info
if [ "$?" -ne "0" ]; then
exit
fi
REGISTRY_URL="us.gcr.io"
GOOGLE_PROJECT_NAME="spair-api"