Skip to content

Instantly share code, notes, and snippets.

View arcolife's full-sized avatar

Archit Sharma arcolife

View GitHub Profile
@arcolife
arcolife / sar_network.json
Created December 26, 2017 19:17
sar network example
{
"timed_out" : false,
"took" : 1,
"_shards" : {
"failed" : 0,
"successful" : 10,
"skipped" : 0,
"total" : 10
},
"hits" : {
$ npm run build
> grafana@5.0.0-pre1 build /home/arcolife/workspace/grafana
> grunt build
Version 5.0.0-pre1
Running "clean:release" (clean) task
>> 0 paths cleaned.
Running "clean:build" (clean) task
@arcolife
arcolife / es sarjitsu test.py
Last active December 24, 2017 12:49
test elasticsearch 6x
from elasticsearch import helpers
from elasticsearch import Elasticsearch
hosts = [dict(host='0.0.0.0', port=9200),]
es = Elasticsearch(hosts)
d = [{'_op_type': 'create', '_index': 'sarjitsu.sar-20160224', '_type': 'sar', '_id': '744f14216b8bfd2ce701de37f7cfd434', '_source': {'timestamp': {'date': '2016-02-24', 'time': '02:46:18', 'utc': 1, 'interval': 29778}, 'cpu-load-all': [{'usr': 0.0, 'nice': 0.0, 'sys': 0.0, 'iowait': 0.0, 'steal': 0.0, 'irq': 0.0, 'soft': 0.0, 'guest': 0.0, 'gnice': 0.0, 'idle': 0.0, 'cpu': 'all'}, {'usr': 11.9, 'nice': 0.13, 'sys': 1.64, 'iowait': 0.36, 'steal': 0.0, 'irq': 0.0, 'soft': 0.0, 'guest': 0.0, 'gnice': 0.0, 'idle': 85.97, 'cpu': 0}, {'usr': 0.0, 'nice': 0.0, 'sys': 0.0, 'iowait': 0.0, 'steal': 0.0, 'irq': 0.0, 'soft': 0.0, 'guest': 0.0, 'gnice': 0.0, 'idle': 0.0, 'cpu': 1}, {'usr': 0.0, 'nice': 0.0, 'sys': 0.0, 'iowait': 0.0, 'steal': 0.0, 'irq': 0.0, 'soft': 0.0, 'guest': 0.0, 'gnice': 0.0, 'idle': 0.0, 'cpu': 2}, {'usr': 0.0, 'nice': 0.0, 'sys': 0.0, 'iowait': 0.0, 'st
@arcolife
arcolife / versions.md
Created December 21, 2017 11:32
elasticsearch commandline option differences in 1.7.x and 6.1.x

ES 1.7.x rpm

$ /usr/share/elasticsearch/bin/elasticsearch --help

Usage: /usr/share/elasticsearch/bin/elasticsearch [-vdh] [-p pidfile] [-D prop] [-X prop]
Start elasticsearch.
    -d            daemonize (run in background)
    -p pidfile    write PID to <pidfile>
    -h
@arcolife
arcolife / redis_example.py
Last active January 28, 2018 09:12
redis sarjitsu sample data
```ipy
# summary
In [11]: %history
from redis import Redis
con = Redis(host='0.0.0.0', port=6379)
con.get('saDir')
con.keys('*')
con.keys('file_metadata*')
con.hmget('file_metadata:36f61983-ea5d-4cfb-bfd8-57a9ae706cb8:sa15_f19', "sadf_type_det")
con.hgetall('file_metadata:79b9895a-ceb9-43c0-a5b9-0d9cc7ee3da0:sa24_arco')
@arcolife
arcolife / numpy_backend_info.md
Last active December 5, 2017 09:22
numpy backend compile steps

show info

>>> numpy.__path__
['/usr/lib64/python2.7/site-packages/numpy']

>>> import numpy; numpy.show_config()

lapack_opt_info:
@arcolife
arcolife / count_msg_state_in_range.md
Last active December 1, 2017 11:32
CFME evm log message counts in state
@arcolife
arcolife / encrypt_with_public_key.md
Last active August 4, 2018 00:54
gpg keys generation / import / encryption with someone's public key

Import someone's public GPG key

# Down his public key and saving it to the file key.asc.
# Then use the following command to add it to your keyring:
$ gpg --import <path to key.asc>

# ..check if imported successfully:
$  gpg --list-keys
@arcolife
arcolife / 1_create_net_subnet_image_flavor.md
Last active April 26, 2020 21:18
openstack 10 (newton) network router create

create network / subnet / image / flavor

# create a net and a subnet
i=1;
while [ $i -lt 51 ]; do 
  neutron net-create scalenet$i --shared; 
  j=0; 
@arcolife
arcolife / vmdb.md
Last active November 7, 2017 12:48
postgresql change settings

change values

applied at 12:30 IST on 6th Nov'17 in CFME 5823

  1. change settings in /var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf as per https://bugzilla.redhat.com/show_bug.cgi?id=1489277#c0

  2. restart db: systemctl status rh-postgresql95-postgresql

new settings