Skip to content

Instantly share code, notes, and snippets.

View Unitech's full-sized avatar

Alexandre Strzelewicz Unitech

View GitHub Profile
#!/bin/sh
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
> @nodriverai/[email protected] install /home/unitech/emca/imustang/icu/MAVJS
> cmake-js compile && tsc
[
'/home/unitech/.nvm/versions/node/v14.0.0/bin/node',
'/home/unitech/emca/imustang/icu/MAVJS/node_modules/.bin/cmake-js',
'compile'
]
info TOOL Using Unix Makefiles generator.
info CMD BUILD
@Unitech
Unitech / upload.sh
Created May 6, 2020 11:42
Image upload to S3 with auto exif rotation, compression and resize and print direct url access
QUALITY='-y -loglevel quiet -q:v 7 -vf scale=1680:-2'
S3_BUCKET='https://BUCKET.s3.eu-west-3.amazonaws.com/'
function upload() {
exiftran -a -i $f
ffmpeg -i $1 $QUALITY /tmp/$1
aws s3 cp /tmp/$1 s3://BUCKET/$2
}
2020-04-23T15:35:59: PM2 log: App name:child id:9 disconnected
2020-04-23T15:35:59: PM2 log: App [child:9] exited with code [0] via signal [SIGINT]
2020-04-23T15:35:59: PM2 log: pid=8987 msg=process killed
2) "after each" hook for "should start maximum processes depending on CPU numbers"
11 passing (1s)
2 failing
1) God
@Unitech
Unitech / main.js
Created March 29, 2020 21:01
Communication node<>python via JSON
process.env.PYTHONUNBUFFERED = '1'
const spawn = require('child_process').spawn
const path = require('path')
var pythonExec = function(algo_file, params, cb) {
var init_data = params.init_data
var receivedData = params.receivedData
var dataString = ''
const io = require('@pm2/io').init({
standalone: true, // mandatory
apmOptions: {
publicKey: 'xxx', // define the public key given in the dashboard
secretKey: 'yyyy', // define the private key given in the dashboard
appName: 'V10'
},
tracing: true
})
2019-11-14T19:34:42: PM2 log: ===============================================================================
2019-11-14T19:34:42: PM2 log: --- PM2 global error caught ---------------------------------------------------
2019-11-14T19:34:42: PM2 log: Time : Thu Nov 14 2019 19:34:42 GMT+0100 (CET)
2019-11-14T19:34:42: PM2 error: Converting circular structure to JSON
2019-11-14T19:34:42: PM2 error: TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at pack (/home/unitech/keymetrics/pm2-runtime/pm2/node_modules/amp-message/index.js:126:33)
at encode (/home/unitech/keymetrics/pm2-runtime/pm2/node_modules/amp-message/index.js:101:14)
at Message.toBuffer (/home/unitech/keymetrics/pm2-runtime/pm2/node_modules/amp-message/index.js:68:10)
at RepSocket.Socket.pack (/home/unitech/keymetrics/pm2-runtime/pm2/node_modules/pm2-axon/lib/sockets/sock.js:92:14)
function stats() {
echo "$1"
echo "XLEN $1" | redis-cli
}
stats "status"
stats "application:dependencies"
stats "mediator-reset:last"
stats "axm:reply"
stats "metrics"
ubuntu@nomad-worker-7:~$ sudo docker pull dockercloud/hello-world
Using default tag: latest
latest: Pulling from dockercloud/hello-world
486a8e636d62: Pull complete
03374a673b41: Pull complete
101d2c41032c: Pull complete
1252e1f36d2b: Pull complete
8385bb1a4377: Pull complete
f29c06131731: Pull complete
NetHogs version 0.8.5-2
PID USER PROGRAM DEV SENT RECEIVED
19138 unitech PM2 Agent v0.5.26: (/home/unitech/.pm2) wlp61s 5.246 0.251 KB/sec
6786 unitech /proc/self/exe wlp61s 0.064 0.039 KB/sec
5982 unitech /usr/share/skypeforlinux/skypeforlinux --executed-from=/home/unitech --pid=5974 wlp61s 0.013 0.013 KB/sec
? root unknown TCP 0.000 0.000 KB/sec
TOTAL 5.324 0.303 KB/sec