This file contains hidden or 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 | |
current="$1" | |
pattern='JIRA-[0-9]+' | |
while [[ ${current} =~ (${pattern}) ]]; do | |
echo "${BASH_REMATCH[1]}" | |
current=${current##*${BASH_REMATCH[1]}} | |
done |
This file contains hidden or 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
setupFirewall() { | |
# Flushing firewall rules. | |
sudo iptables -F | |
# Enabling outgoing packets. | |
sudo iptables -P OUTPUT ACCEPT | |
sudo iptables -P INPUT DROP | |
sudo iptables -P FORWARD DROP | |
sudo iptables -A INPUT --in-interface lo -j ACCEPT |
This file contains hidden or 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-hostname() { | |
local hostname=$1 | |
sudo hostname $hostname | |
echo "$hostname" | sudo tee /etc/hostname | |
echo "127.0.0.1 $hostname" | sudo tee -a /etc/hosts | |
} |
This file contains hidden or 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
create-user() { | |
local username=$1 | |
local password=$2 | |
sudo useradd -p $(openssl passwd -1 $password) -c "$username" -m -s /bin/bash $username | |
} |
This file contains hidden or 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
fetchArchive() { | |
local host=$1 | |
local token=$2 | |
local projectId=$3 | |
if [[ -z "$host" ]] || [[ -z "$token" ]] || [[ -z "$projectId" ]]; then | |
echo | |
echo "Usage: $FUNCNAME <host> <gitlab account token> <project id>" | |
echo | |
return 1 |
This file contains hidden or 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 | |
################################################################################ | |
# To use this script copy and paste the following line without the "#" character | |
# into a "git bash" - installed by msysgit (http://msysgit.github.io/) | |
################################################################################ | |
# curl -sLo env-setup http://epa.ms/env-setup && source env-setup | |
################################################################################ | |
host="https://git.epam.com" | |
if [ ! -z "$1" ] ; then |
This file contains hidden or 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 | |
################################################################################ | |
# To use this script copy and paste the following line without the "#" character | |
# into a "git bash" - installed by msysgit (http://msysgit.github.io/) | |
################################################################################ | |
# curl -sLo env-setup http://epa.ms/env-setup && source env-setup | |
################################################################################ | |
host="https://git.epam.com" | |
if [ ! -z "$1" ] ; then |
This file contains hidden or 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 | |
################################################################################ | |
# To use this script copy and paste the following line without the "#" character | |
# into a "git bash" - installed by msysgit (http://msysgit.github.io/) | |
################################################################################ | |
# curl -sLo add-key.sh http://epa.ms/gitkey && chmod u+x add-key.sh && ./add-key.sh | |
################################################################################ | |
url="https://git.epam.com" | |
if [ ! -z "$1" ] ; then |