Skip to main content

Posts

Showing posts with the label data

Saltstack and Vault integration

First install and configure vault using this tutorial: https://apassionatechie.wordpress.com/2017/03/05/hashicorp-vault/ Use the latest version of vault. Then install salt using the steps given here: https://docs.saltstack.com/en/latest/topics/installation/ If you face any issues then refer these links: https://apassionatechie.wordpress.com/2017/07/31/salt-issues/ https://apassionatechie.wordpress.com/2017/08/03/salt-stack-formulas/ Now let's integrate vault and salt so that we can access vault secrets from inside salt state. First let's add some key values into our vault. vault write secret/ssh/user1 password="abc123" Then you can check it by reading: vault read secret/ssh/user1 To allow salt to access your secrets you must firstly create a policy as follows: salt-policy.hcl [code] path "secret/*" { capabilities = ["read", "list"] } path "auth/*" { capabilities = ["read", "list","sudo",...

Diamond installation on centos 7

$  yum install make rpm-build python-configobj python-setuptools $  git clone  https://github.com/python-diamond/Diamond $  cd Diamond $  make buildrpm Then use the package you built like this: $  yum localinstall –nogpgcheck dist/diamond-4.0.449-0.noarch.rpm $  cp /etc/diamond/{diamond.conf.example,diamond.conf} $  $EDITOR /etc/diamond/diamond.conf # Start Diamond service via service manager. $  service diamond start diamond-setup -C ElasticSearchCollector diamond-setup -C NetworkCollector Issues failed to connect socket to ‘/var/run/libvirt/libvirt-sock-ro’ no such file or directory execute: egrep ‘(vmx|svm)’ /proc/cpuinfo 2. If the above commands returns with any output showing vmx or svm then your hardware supports VT else it does not. yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer

Diamond installation on centos 7

$ yum install make rpm-build python-configobj python-setuptools $ git clone https://github.com/python-diamond/Diamond $ cd Diamond $ make buildrpm Then use the package you built like this: $ yum localinstall --nogpgcheck dist/diamond-4.0.449-0.noarch.rpm $ cp /etc/diamond/{diamond.conf.example,diamond.conf} $ $EDITOR /etc/diamond/diamond.conf # Start Diamond service via service manager. $ service diamond start diamond-setup -C ElasticSearchCollector diamond-setup -C NetworkCollector Issues failed to connect socket to '/var/run/libvirt/libvirt-sock-ro' no such file or directory execute: egrep '(vmx|svm)' /proc/cpuinfo 2. If the above commands returns with any output showing vmx or svm then your hardware supports VT else it does not. yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer

Elasticsearch Queries (1)

Create indices 1 2 3 4 5 6 7 8 9 10 curl -XPUT 'localhost:9200/twitter?pretty' -H 'Content-Type: application/json' -d' {   "settings" : {   "index" : {   "number_of_shards" : 3,   "number_of_replicas" : 2   }   } } ' 2. Search 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 curl -XGET 'localhost:9200/sw/_search?pretty' -H 'Content-Type: application/json' -d' {   "query" : { "match_all" : {} },   "_source" : [ "gender" , "height" ] } '< /pre > 3. Creating index and adding documents to it <pre>curl -XPUT 'localhost:9200/my_index?pretty' -H 'Content-Type: application/json' -d' {   "mappings" : {   "my_t...