Skip to content

Instantly share code, notes, and snippets.

View azasypkin's full-sized avatar

Aleh Zasypkin azasypkin

View GitHub Profile
@azasypkin
azasypkin / index.js
Last active February 27, 2025 14:15
Natural Language User Interface (NLUI) for the Kibana Role Creation API
#!/usr/bin/env node
'use strict';
import { inspect } from 'util';
import { uniqueNamesGenerator, adjectives, animals } from 'unique-names-generator';
const KIBANA_HOST = process.env.KBN_HOST || 'http://localhost:5601';
const KIBANA_USERNAME = process.env.KBN_USERNAME || 'elastic';
const KIBANA_PASSWORD = process.env.KBN_PASSWORD || 'changeme';
@azasypkin
azasypkin / index.js
Last active February 12, 2025 13:50
Kibana mass login
#!/usr/bin/env node
'use strict';
import autocannon from 'autocannon';
import { uniqueNamesGenerator, adjectives, animals } from 'unique-names-generator';
const USERS_COUNT = process.env.AZ_USERS_COUNT || 3;
const SESSIONS_PER_USER_COUNT = process.env.AZ_SESSIONS_PER_USER_COUNT || 1000;
const MAX_CONNECTIONS = process.env.AZ_MAX_CONNECTIONS || 100;
POST /_security/role_mapping/kibana_sso
{
"roles": [ "superuser" ],
"enabled": true,
"rules": { "all": [{"field" : { "realm.name" : "*" }}] }
}
This file has been truncated, but you can view the full file.
{
"formats": {
"number": {
"currency": {
"style": "currency"
},
"percent": {
"style": "percent"
}
},
@azasypkin
azasypkin / en.json
Created April 16, 2020 12:26
en.json
This file has been truncated, but you can view the full file.
{
"formats": {
"number": {
"currency": {
"style": "currency"
},
"percent": {
"style": "percent"
}
},

Keybase proof

I hereby claim:

  • I am azasypkin on github.
  • I am oxycom (https://keybase.io/oxycom) on keybase.
  • I have a public key ASD31oUqT7Onld3C0viInsajU1Gbo2HTMqM8-3BjZy_0ygo

To claim this, I am signing this object:

@azasypkin
azasypkin / linux_fusion360.md
Created January 16, 2019 22:56 — forked from probonopd/linux_fusion360.md
Autodesk Fusion 360 in the Linux Browser
@azasypkin
azasypkin / make-phantom-report.js
Created November 8, 2018 18:16
make-phantom-report.js
var url = "http://elastic:[email protected]:5601/app/kibana#/visualize/edit/1a36d1d0-e371-11e8-8a31-0d7a694da690?_g=()&_a=(filters:!(),linked:!f,query:(language:lucene,query:''),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'2',params:(field:_type,missingBucket:!f,missingBucketLabel:Missing,order:desc,orderBy:'1',otherBucket:!f,otherBucketLabel:Other,size:5),schema:segment,type:terms)),params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,categoryAxes:!((id:CategoryAxis-1,labels:(show:!t,truncate:100),position:bottom,scale:(type:linear),show:!t,style:(),title:(),type:category)),grid:(categoryLines:!f,style:(color:%23eee)),legendPosition:right,seriesParams:!((data:(id:'1',label:Count),drawLinesBetweenPoints:!t,interpolate:linear,mode:stacked,show:true,showCircles:!t,type:area,valueAxis:ValueAxis-1)),times:!(),type:area,valueAxes:!((id:ValueAxis-1,labels:(filter:!f,rotate:0,show:!t,truncate:100),name:LeftAxis-1,position:left,scale:(mode:normal,type:linear),show:!t,s
@azasypkin
azasypkin / index.js
Last active August 30, 2018 08:54 — forked from yankouskia/en.json
translate (npx https://gist.github.com/azasypkin/e3e3526c7bb73223ac53b5cb126ecfae /absolute-path/en.json zh-cn)
#!/usr/bin/env node
const fs = require('fs');
const translate = require('google-translate-api');
const [,, enFile, targetLocale] = process.argv;
console.log(`File ${enFile}, translate to locale ${targetLocale}`);
const en = require(enFile);
#!/usr/bin/env node
console.log('yay gist');
var IntlMessageFormat = require('intl-messageformat');
var memoizeFormatConstructor = require('intl-format-cache');
IntlMessageFormat.defaultLocale = 'ru';
console.log(`Default locale BEFORE memoize: ${IntlMessageFormat.defaultLocale}`);