Skip to content

Instantly share code, notes, and snippets.

View JSONOrona's full-sized avatar

Jason Orona JSONOrona

View GitHub Profile
#!/bin/bash
# set -x
REPO='v3'
USER='bitrix'
# Dir paths on remote server
# These are associated with branches within a git project
DEV_BRANCH='dev0'
DEV="${USER}@${DEV_BRANCH}.4lph40m3g4.com:/home/${DEV_BRANCH}"
@JSONOrona
JSONOrona / knife cheat
Created October 4, 2018 17:51 — forked from ipedrazas/knife cheat
Hello!
# knife cheat
## Search Examples
knife search "name:ip*"
knife search "platform:ubuntu*"
knife search "platform:*" -a macaddress
knife search "platform:ubuntu*" -a uptime
knife search "platform:ubuntu*" -a virtualization.system
knife search "platform:ubuntu*" -a network.default_gateway
@JSONOrona
JSONOrona / Trading Checklist
Created November 6, 2018 15:48
Forex trading checklist
Answer this questions and make sure they align with your bias.
● Is this your session?
● Is the chart trending or consolidating (choppy)? Do not trade if is consolidating!
● Is there any market structure break on the 15m chart?
● What zones are currently being rejected on the 30min/1hr chart? (This can give off obvious signs of direction)
● What is the overall trend on the 4hr chart? (Look at your indicators)
● From all this gathered information, what formed confluence?
● Should you place this trade or stay cash for the day?
@JSONOrona
JSONOrona / multi_env_knife_config
Created May 9, 2019 16:08 — forked from kevinkarwaski/multi_env_knife_config
Knife config for Multiple Chef Environments
#
# This is an example of a knife.rb configuration that uses yml and a
# simple env var (CHEF_ENV) to manage multiple hosted Chef environments.
#
# Example usage:
# export CHEF_ENV=evnironment_01
# knife status
#
# Based on: http://blog.blankpad.net/2010/09/28/multiple-knife-environments---the-return/
#

Version

Chef-Client 15.x

Environment: OS: Windows 2016

Scenario:

Chef Infra Client is installed in our environment using an unattended bootstrap script. When passing our custom attributes via a first-boot.json we recieve this error TypeError: wrong argument type Hash (expected String). This doesn't not happen on versions 14.x and below.

version = node['openjdk']['version']
major_version = version.split(".")[0]
default['openjdk']['path'] = {
'windows' => "C:\\Program Files\\OpenJDK\\jdk-#{major_version}",
'rhel' => "/usr/lib/jvm/java-#{major_version}-openjdk-#{major_version}",
'fedora' => "/usr/lib/jvm/java-#{major_version}-openjdk-#{major_version}",
'amazon' => "/usr/lib/jvm/java-#{major_version}-openjdk-#{major_version}",
'debian' => "/usr/lib/jvm/java-#{major_version}-openjdk-amd64"
}
Name "Chef Client Installation"
OutFile "install-chef-client.exe"
; Constants
!define CHEF_VERSION "16.3.73"
!define CHEF_MSI "chef-client-${CHEF_VERSION}.msi"
; Variables
Var ChefClientInstalled
$workstation_version = "21.11.416"
$install_path = "C:\opscode\chef-workstation"
if (Test-Path $install_path) {
$existing_version = (Get-Command "chef" -ErrorAction SilentlyContinue).FileVersionInfo.ProductVersion
if ($existing_version -eq $workstation_version) {
Write-Host "Chef Workstation $workstation_version is already installed."
return
} else {
#!/bin/bash
# Parse command line arguments
while getopts ":u:p:" opt; do
case ${opt} in
u )
USERNAME=$OPTARG
;;
p )
PASSWORD=$OPTARG

Helpful Knife Commands and More

Knife

Show nodes runlist and metadata

knife node show <node_name> 

# Example: