This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Links EOE: | |
I am adding some of my own: | |
Tuning beats: | |
https://www.elastic.co/blog/how-to-tune-elastic-beats-performance-a-practical-example-with-batch-size-worker-count-and-more | |
Tuning logstash: | |
https://www.elastic.co/guide/en/logstash/current/performance-tuning.html | |
Tuning Es for index: | |
https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html | |
Tuning Es for search: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb | |
apt-get install fontconfig libxrender1 xfonts-75dpi xfonts-base | |
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/knife' | |
require 'chef/knife/base_vsphere_command' | |
# Set specific disk IOPS for an aattached disk to the VM | |
# VsphereVmdisklist extends the BaseVspherecommand | |
class Chef::Knife::VsphereVmDiskIops < Chef::Knife::BaseVsphereCommand | |
banner 'knife vsphere vm disk iops VMNAME DISKINDEX IOPS' | |
common_options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'chef/knife' | |
require 'chef/knife/base_vsphere_command' | |
# Remove specific disk attached to a VM | |
# VsphereVmdisklist extends the BaseVspherecommand | |
class Chef::Knife::VsphereVmDiskRemove < Chef::Knife::BaseVsphereCommand | |
banner 'knife vsphere vm disk remove VMNAME DISKINDEX' | |
common_options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Example of pulling data from DC Capital bikeshare to Elasticsearch in real time | |
## HTTP Poller -> XML Splitting -> Elasticsearch | |
input { | |
## pull data from Capital Bikeshare every 60 seconds | |
http_poller { | |
urls => { | |
bikeshare_dc => "https://www.capitalbikeshare.com/data/stations/bikeStations.xml" | |
} | |
request_timeout => 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim = RbVmomi::VIM.connect host: vcenter.hostname, user: vcenter.username, password: vcenter.password, insecure: true | |
pm = vim.serviceInstance.content.perfManager | |
# this is for a single cluster with hosts directly in one cluster. 'first' returns the cluster object. | |
hosts = vim.serviceInstance.find_datacenter.hostFolder.children.first.host | |
pm.retrieve_stats([hosts[0]], ['cpu.usagemhz'], {interval: '300', start_time: (Time.now - 6.hours)}).first[1][:metrics]['cpu.usagemhz'] | |
# This above query queries for the 'cpu.usagemhz' counter, which by default matches the (none) rollup counter (NOT THE AVERAGE) in vSphere API. | |
# This is a problem with the RbVmomi gem helper function "retrieve_stats" only. To override this, use the following manual counter selection: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rbvmomi' | |
require 'pry-byebug' | |
require 'socket' | |
require 'openssl' | |
require 'digest/sha1' | |
require 'io/console' | |
def get_thumbprint(vc) | |
ssl_context = OpenSSL::SSL::SSLContext.new | |
tcp_client = TCPSocket.new vc, 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function getRefreshTokenResponse($code) | |
{ | |
$response = $this->getHttpClient()->post($this->getTokenUrl(), [ | |
'headers' => ['Accept' => 'application/json'], | |
'form_params' => $this->getRefreshTokenFields($code), | |
]); | |
return json_decode($response->getBody(), true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/Cellar/ansible/ && git clone https://github.com/ansible/ansible.git --recursive devel | |
cd /usr/local/Cellar/ansible/devel && git submodule update --init --recursive | |
sudo make install | |
source hacking/env-setup | |
brew switch ansible devel | |
brew link --overwrite ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Config for SSL. | |
echo "--- Making SSL Directory ---" | |
mkdir /etc/nginx/ssl | |
echo "--- Copying $i SSL crt and key ---" | |
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com" | |
echo "--- Turning SSL on in nginx.conf. ---" |
NewerOlder