Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Vikas Kumar vikas027

🏠
Working from home
  • Sydney, Australia
View GitHub Profile
@vikas027
vikas027 / s3_file_upload_ruby_sdk_v2.rb
Last active Aug 29, 2015
Upload file on AWS S3 using Ruby SDK v2
View s3_file_upload_ruby_sdk_v2.rb
#!/usr/local/rvm/rubies/ruby-2.1.5/bin/ruby
# This needs to be run as ./script_name source/file/path
# I recommend using relative paths than absolute paths
require 'aws-sdk' # gem install aws-sdk
# Change these variables as per your environment
bucket_name = 'vikas-bucket'
sub_bucket_name = 'vikas/reachvikas.com'
myregion = 'us-west-1'
@vikas027
vikas027 / fix_ova.sh
Created Mar 5, 2016
Fix of Banno/packer-post-processor-vsphere-ova
View fix_ova.sh
#!/bin/bash -eux
# This script fix an issue in https://github.com/Banno/packer-post-processor-vsphere-ova/issues/
# name of my builder in packer.json is virtualbox-vsphere
dir='output-virtualbox-vsphere'
ova_file=`ls ${dir}/*.ova | awk -F"/" '{ print $2 }' | sed 's/.ova//'`
tar xvf ${dir}/${ova_file}.ova -C ${dir}
ovf_file=`ls ${dir}/*.ovf`
View Packer_Debug_Log_Issue-3315.txt
$ PACKER_LOG=1 packer build -force bug_test.json
2016/03/06 15:24:04 [INFO] Packer version: 0.9.0 a643faae672ec8b8424352476d2b91b7a7f7b06e
2016/03/06 15:24:04 Packer Target OS/Arch: darwin amd64
2016/03/06 15:24:04 Built with Go Version: go1.6
2016/03/06 15:24:04 [DEBUG] Discovered plugin: vsphere-ova = /usr/local/bin/packer-post-processor-vsphere-ova
2016/03/06 15:24:04 Detected home directory from env var: /Users/vikas
2016/03/06 15:24:04 Using internal plugin for file
2016/03/06 15:24:04 Using internal plugin for openstack
2016/03/06 15:24:04 Using internal plugin for amazon-chroot
2016/03/06 15:24:04 Using internal plugin for vmware-vmx
@vikas027
vikas027 / Packer_Debug_Log_Pull_Request-3321.txt
Last active Mar 11, 2016
Packer Debug Log for Pull Request 3321
View Packer_Debug_Log_Pull_Request-3321.txt
## https://github.com/mitchellh/packer/pull/3321
# PACKER_LOG=1 packer build packer.json
2016/03/12 02:52:53 [INFO] Packer version: 0.9.1 dev 3efdcb45eeac7a3a7566296ba94e9ff642ea37de
2016/03/12 02:52:53 Packer Target OS/Arch: linux amd64
2016/03/12 02:52:53 Built with Go Version: go1.6
2016/03/12 02:52:53 Detected home directory from env var: /root
2016/03/12 02:52:53 Using internal plugin for null
2016/03/12 02:52:53 Using internal plugin for openstack
2016/03/12 02:52:53 Using internal plugin for amazon-chroot
@vikas027
vikas027 / Vagrant_vsphere_debug.log
Created Mar 12, 2016
Vagrant Log for issue 182
View Vagrant_vsphere_debug.log
This file has been truncated, but you can view the full file.
## https://github.com/nsidc/vagrant-vsphere/issues/182
# vagrant up --debug
INFO global: Vagrant version: 1.8.1
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_MAIL="/var/spool/mail/root"
INFO global: VAGRANT_OLD_ENV_LANG="en_IN"
INFO global: VAGRANT_OLD_ENV_XDG_SESSION_ID="2"
INFO global: VAGRANT_OLD_ENV_SHELL="/bin/bash"
@vikas027
vikas027 / upgrade_ansible_tower_2.3.1.txt
Created Oct 27, 2015
Ansible Tower v2.3.1 Install/Upgrade
View upgrade_ansible_tower_2.3.1.txt
I got many errors while working on the Ansible Tower upgrade from v2.1.0 to v2.3.1. I faced many issues in this journey, so thought of documenting those here.
==============
ISSUES FIXED
==============
1) ./setup.sh script fails while trying to look for postgres user 'awx'
TASK: [postgres | determine if postgresql user exists] ************************
fatal: [localhost] => error while evaluating conditional: pg_user_exists.stdout != '1'
2) Error while trying to upgrade supervisor
@vikas027
vikas027 / Terraform_Issue_12108_first run
Created Feb 20, 2017
Terraform_Issue_12108_first run
View Terraform_Issue_12108_first run
This file has been truncated, but you can view the full file.
2017/02/20 23:05:58 [INFO] Terraform version: 0.8.7
2017/02/20 23:05:58 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.8.7/bin/terraform", "apply", "-target=module.docker_repos"}
2017/02/20 23:05:58 [DEBUG] Detected home directory from env var: /Users/vikas
2017/02/20 23:05:58 [DEBUG] Detected home directory from env var: /Users/vikas
2017/02/20 23:05:58 [DEBUG] Attempting to open CLI config file: /Users/vikas/.terraformrc
2017/02/20 23:05:58 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/02/20 23:05:58 [DEBUG] Detected home directory from env var: /Users/vikas
2017/02/20 23:05:58 [DEBUG] vertex "module.ssh_key_pairs": static expanding
2017/02/20 23:05:58 [DEBUG] vertex "module.http_server": static expanding
@vikas027
vikas027 / Terraform_Issue_12108_second run
Created Feb 20, 2017
Terraform_Issue_12108_second run
View Terraform_Issue_12108_second run
This file has been truncated, but you can view the full file.
2017/02/20 23:06:50 [INFO] Terraform version: 0.8.7
2017/02/20 23:06:50 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.8.7/bin/terraform", "apply", "-target=module.docker_repos"}
2017/02/20 23:06:50 [DEBUG] Detected home directory from env var: /Users/vikas
2017/02/20 23:06:50 [DEBUG] Detected home directory from env var: /Users/vikas
2017/02/20 23:06:50 [DEBUG] Attempting to open CLI config file: /Users/vikas/.terraformrc
2017/02/20 23:06:50 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/02/20 23:06:50 [DEBUG] Detected home directory from env var: /Users/vikas
2017/02/20 23:06:50 [DEBUG] vertex "module.docker_repos": static expanding
2017/02/20 23:06:50 [DEBUG] vertex "module.vpc": static expanding
@vikas027
vikas027 / openssl_s_client_log.log
Last active Sep 25, 2017
Openssl s_client log for nginx forum
View openssl_s_client_log.log
#### SHORT LOG
$ openssl 2>&1 s_client -quiet -connect server.test.com:443 -servername server.test.com -tls1 -key /root/ca/intermediate/private/client.key.pem -cert /root/ca/intermediate/certs/client.cert.pem -CAfile /root/certs/ca.cert.pem
depth=2 C = GB, ST = England, L = Melbourne, O = Alice Ltd, OU = IT Services, CN = rootca.test.com, emailAddress = root@rootca.test.com
verify return:1
depth=1 C = GB, ST = England, O = Alice Ltd, OU = Shared Services, CN = intermediateca.test.com, emailAddress = root@intermediateca.test.com
verify return:1
depth=0 C = US, ST = California, L = Mountain View, O = Alice Ltd, OU = Alice Ltd Web Services, CN = server.test.com, emailAddress = root@server.test.com
verify return:1
HTTP/1.1 400 Bad Request
View bumpme
Sat Apr 28 06:44:09 UTC 2018