Skip to content

Instantly share code, notes, and snippets.

@weldpua2008
weldpua2008 / Recursively deploys folder content to artifactory.sh
Created January 15, 2017 08:40
How to recursively upload files to Artifactory
#!/bin/bash
# Recursively deploys folder content. Attempt checksum deploy first to optimize upload time.
repo_url="http://artifactory:8081/artifactory"
tgt_repo="some_repository"
user=user
pass=password
dir="$2"
if [ -z "$dir" ]; then echo "Please specify a directory to recursively upload from!"; exit 1; fi
if [ ! -x "`which sha1sum`" ]; then echo "You need to have the 'sha1sum' command in your path."; exit 1; fi
# Upload by checksum all jars and pom from the source dir to the target repo
@weldpua2008
weldpua2008 / esxi_change_net_label.py
Created January 15, 2017 09:16
Change VM networks label by nic index on ESXi
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################
# Change VM networks label by nic index on ESXi
#
##############################################################
# author: Valeriy Solovyov <[email protected]>
# version 0.1 <4.11.2015>
# - initial
##############################################################
@weldpua2008
weldpua2008 / resolve_url_from_jenkins.py
Created January 15, 2017 09:21
Get an artifact url from Jenkins
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################
# Get an artifact url
#
##############################################################
# author: Valeriy Solovyov <[email protected]>
# version 0.1 <3.15.2016>
# - initial
##############################################################
@weldpua2008
weldpua2008 / esxi_getip_by_name.py
Created January 15, 2017 09:29
Get IP of any VM by name on ESXi
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################
# Get IP of VM by name on ESXi
#
##############################################################
##############################################################
# author: Valeriy Solovyov <[email protected]>
# version 0.2 <4.11.2015>
# - fixed issue on getting ip. By default return same as you
@weldpua2008
weldpua2008 / racadm.sh
Created January 15, 2017 09:32
Manage a host through iDRAC or mount iso on it
#!/usr/bin/env bash
##############################################################
# Manage a host through iDRAC or mount iso on it
#
##############################################################
# author: Valeriy Solovyov <[email protected]>
# version 0.1 <30.11.2015>
# - initial
##############################################################
if [ "$(id -u)" != "0" ]; then
@weldpua2008
weldpua2008 / esxi_remove_vm_by_name.py
Created January 15, 2017 09:34
Remove a VM by name from ESXI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################
# Remove VM by name on ESXI
#
##############################################################
##############################################################
# author: Valeriy Solovyov <[email protected]>
# version 0.1 <3.11.2015>
# - initial
@weldpua2008
weldpua2008 / esxi_shutdown_vm_by_name.py
Created January 15, 2017 09:34
Shutdown VM by name on ESXI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################
# Shutdown VM by name on ESXI
#
##############################################################
##############################################################
# author: Valeriy Solovyov <[email protected]>
# version 0.1 <3.11.2015>
# - initial
@weldpua2008
weldpua2008 / ssh_config_cleaner.pl
Created January 15, 2017 09:37
Removing a section from ssh config file
#!/usr/bin/perl
################################################
# Removing a section from ssh config file
################################################
# cat /root/.ssh/config
# Host some-host12
# HostName some-host1
# Port 22
# User root
# IdentityFile /root/.ssh/id_rsa.host
@weldpua2008
weldpua2008 / elasticsearch.service
Created January 15, 2017 12:37
ElasticSearch service into CoreOS
[Unit]
Description=elasticsearch
# Requirements
Requires=etcd.service
Requires=docker.service
# Dependency ordering
After=etcd.service
After=docker.service
@weldpua2008
weldpua2008 / kibana.service
Created January 15, 2017 12:39
Kibana service for CoreOS
[Unit]
Description=kibana
# Requirements
Requires=etcd.service
Requires=docker.service
Requires=elasticsearch.service
# Dependency ordering
After=etcd.service
After=docker.service