Skip to content

Instantly share code, notes, and snippets.

Function CheckProcess
{
$Service = $(Get-Service -ComputerName $Computer -Name $ServiceName -ErrorAction SilentlyContinue)
IF ($Service -eq $null)
{Write-Host "No service named" $ServiceName "on" $Computer "or the computer could not be reached."}
ELSE {Write-Host $Service "is" $Service.Status "on" $Computer.ToUpper()}
IF ($Service.Status -eq "Stopped") {StartService} # Call Start function if service is stopped
ELSEIF ($Service.Status -eq "StopPending") {KillProcess} # Forcefully kill the process
ELSEIF ($Service.Status -eq "Running" -and $count -lt 1) {KillProcess}
@bndabbs
bndabbs / AddKolaRepos.sh
Last active March 2, 2016 16:08
Create Kolla Docker Repos
for i in "centos-rdo-keystone" "centos-rdo-base" "centos-rdo-glance-base" "centos-rdo-horizon" "centos-rdo-mariadb-app" "centos-rdo-neutron-base" "centos-rdo-nova-base" "centos-rdo-nova-compute" "centos-rdo-nova-libvirt" "centos-rdo-nova-network" "centos-rdo-rabbitmq" "fedora-rdo-base" "fedora-rdo-glance-api" "fedora-rdo-glance-registry" "fedora-rdo-keystone" "fedora-rdo-mariadb" "fedora-rdo-nova-api" "fedora-rdo-nova-base" "fedora-rdo-nova-compute" "fedora-rdo-nova-conductor" "fedora-rdo-nova-libvirt" "fedora-rdo-nova-network" "fedora-rdo-nova-scheduler" "fedora-rdo-rabbitmq" "fedora-rdo-zaqar";
do hammer -u brad -p sanitized repository create --content-type "docker" --docker-upstream-name kollaglue/$i --name $i --label $i --product Kolla --url https://registry.hub.docker.com --organization "Default Organization";
done
@bndabbs
bndabbs / disable_repos.sh
Created April 4, 2016 13:54
disable all yum repos
repos=$(yum -v repolist |grep Repo-id |awk '{print $3}'|awk -F/ '{print $1}')
for i in "${repos[@]}"; do yum-config-manager --disable $i; done
@bndabbs
bndabbs / delete_images.sh
Created May 20, 2016 14:50
Delete all docker images. Add sudo if you aren't a member of the docker group
#!/bin/bash
images=`docker images | awk '{print $3}' |grep -v IMAGE`
for i in $images; do docker rmi $i; done
[DEFAULT]
#
# From nova
#
# Number of times to retry live-migration before failing. If == -1, try until
# out of hosts. If == 0, only try once, no retries. (integer value)
#migrate_max_retries=-1
" Leader
let mapleader = " "
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
set history=50
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
# Exact Solarized Dark color theme for the color GNU ls utility.
# Designed for dircolors (GNU coreutils) 5.97
#
# This simple theme was simultaneously designed for these terminal color schemes:
# - Solarized dark (best)
# - Solarized light
# - default dark
# - default light
# with a slight optimization for Solarized Dark.
#
KAFKA_JVM_PERFORMANCE_OPTS=-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=trueKAFKA_GC_LOG_OPTS=-Xloggc:/var/log/kafka/suricata-to-kafka-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps
KAFKA_JMX_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
KAFKA_LOGJ4_OPTS=-Dkafka.logs.dir=/opt/kafka/logs -Dlog4j.configuration=file:/opt/kafka/config/connect-log4j.properties
KAFKA_CONNECT_OPTS=org.apache.kafka.connect.cli.ConnectStandalone /opt/kafka/config/connect-standalone.properties /opt/kafka/config/suricata.properties
CLASSPATH=:/opt/kafka/libs/aopalliance-repackaged-2.4.0-b34.jar \
:/opt/kafka/libs/argparse4j-0.5.0.jar \
:/opt/kafka/libs/connect-api-0.10.0.0.jar \
:/opt/kafka/libs/connect-file-0.10.0.0.jar \
:/opt/kafka/libs/connect-json-0.10.0.0.jar \
:/opt/kafka/libs/connect-runtime-0.10.0.0.jar \
SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
SCM_GIT_CHAR="${bold_cyan}±${normal}"
SCM_SVN_CHAR="${bold_green}⑆${normal}"
SCM_HG_CHAR="${bold_red}☿${normal}"
#Mysql Prompt