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/bash | |
CLUSTER="" | |
PROJECT_CMD="" | |
ZONE_CMD="" | |
SCOPES="" | |
NUM_NODES="1" | |
MACHINE_TYPE="" | |
DISK_SIZE="100GB" |
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
# Possibly add this to ~/.bash_profile | |
# Ensure you have the Google Cloud SDK installed | |
function gce-create() { | |
GCE_BIN=$(which gcloud) | |
GCE_SCOPES=default="https://www.googleapis.com/auth/cloud.useraccounts.readonly","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring.write" | |
GCE_IMAGE="https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20160219" | |
GCE_POLICY=MIGRATE | |
GCE_ZONE=us-central1-a | |
GCE_TYPE=f1-micro |
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/bash | |
COUNT=10 | |
while : | |
do | |
if [ $COUNT = 10 ] | |
then | |
printf "+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ \n" | |
printf "| TIME |ESTAB|LISTN|T_WAT|CLOSD|S_SEN|S_REC|C_WAT|F_WT1|F_WT2|CLOSI|L_ACK| \n" | |
printf "+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ \n" | |
COUNT=0 |
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/bash | |
# | |
# UPTIME MONITOR | |
# -------------- | |
# Usage: Setup a cronjob to execute the script and your done. | |
# | |
# Copyright (c) 2012, T. Zengerink | |
# Licensed under MIT License. | |
# See: https://raw.github.com/gist/3151357/9e8e01df4ee12b1f04cd61e0ecee3ea8bd6f617b/mit-license.txt |
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
# Set variables in .bash_profile for convenience: | |
# GOOGLE_COMPUTE_PROJECT_NAME - e.g. "my-project" | |
# | |
# Run locally: | |
# sudo ssh-add ~/.ssh/google_compute_engine | |
# gcutil ssh $GOOGLE_COMPUTE_INSTANCE_NAME | |
# Cache project name | |
gcutil getproject --project=$GOOGLE_COMPUTE_PROJECT_NAME --cache_flag_values |
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/bash -e | |
/usr/share/fk-3p-kafka/bin/kafka-topics.sh $ZOOKEEPER --describe --topic $1 \ | |
| grep Leader \ | |
| awk '{print $4,$8}' | sed 's/,/ /' \ | |
| awk '{ | |
for(i=1;i<7;++i){a[i]=0}; | |
sum[$2]++; sum[$3]++; | |
a[$2]=1; a[$3]=1; | |
printf "%3d ",$1; | |
for (i=1;i<7;++i) {printf "%3d ",a[i]}; printf "\n"; |
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/bash | |
# Copyright 2014 Google Inc. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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/bash | |
LOCAL_REGISTRY_NAME=local-docker-registry | |
GCS_BUCKET=some-bucket | |
CONFIG_DIR=$HOME/.config | |
LOCAL_REGISTRY_ID=`docker ps -q $LOCAL_REGISTRY_NAME` | |
if [ ! -z "$LOCAL_REGISTRY_ID" ]; then |
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
# Copyright 2014 Google Inc. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
mkdir MailX | |
cd MailX | |
#Download file | |
wget http://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz | |
#Download patch | |
wget http://www.linuxfromscratch.org/patches/blfs/svn/heirloom-mailx-12.5-fixes-1.patch | |
#unZip | |
tar -xvzf heirloom-mailx_12.5.orig.tar.gz |
NewerOlder