Use Bash
to expand the brace. If you don't like this,
you may look at more professional way at https://gist.github.com/ewoodh2o/3829405
This method invokes a system call to ask Bash to expand.
FIXME: This is not secure!!!
class String
Use Bash
to expand the brace. If you don't like this,
you may look at more professional way at https://gist.github.com/ewoodh2o/3829405
This method invokes a system call to ask Bash to expand.
FIXME: This is not secure!!!
class String
#!/bin/bash | |
# Purpose: | |
# See how nginx loads/includes its configuration files | |
# Very useful to detect quickly where there errors come from. | |
# Author : Anh K. Huynh | |
# Date : 2015 Aug 14th | |
# License: MIT | |
# Notes : | |
# Some system has a different level. Here it's 3. |
mainly used in start-up script
When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.
How to:
- Enable reboot via SMS.
- Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.
Fixed by @williamtsoi1 at: https://gist.github.com/williamtsoi1/104531c65852a852399a3dc1096a2dcc
#!/usr/bin/perl -w | |
# Key generation for BTsync. | |
# Author : Johan Vromans | |
# Created On : Sun Apr 27 20:31:57 2014 | |
# Last Modified By: Johan Vromans | |
# Last Modified On: Fri May 2 15:37:24 2014 | |
# Update Count : 47 | |
# Status : Unknown, Use with caution! |
#!/bin/sh | |
#/ Usage: btsync-secret [option]... | |
#/ A Bittorrent Sync Secret Generator | |
set -e | |
h_flag=false | |
v_flag=false | |
e_flag=false | |
n_flag=false | |
c_flag=false |
MIT License | |
Copyright (c) 2014 Piotr Kuczynski | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR |
#!/bin/sh | |
# script to automate the creation of chroot jail | |
# w/ minimal executables to run git | |
export CHROOT=/var/chroot | |
function copy_binary() { | |
for i in $(ldd $*|grep -v dynamic|cut -d " " -f 3|sed 's/://'|sort|uniq) | |
do | |
cp --parents $i $CHROOT |
Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.
In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.
YMMV. Caveat usufructuarius.
#!/bin/sh | |
VIP=$1 | |
IF=$2 | |
# Determine the interface's MAC address | |
MAC=`ip link show $IF | awk '/ether/ {print $2}'` | |
# Determine ENI ID of the interface | |
ENI_ID=`curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MAC/interface-id` |