Compare commits
3 Commits
2ed69bc664
...
feature/up
| Author | SHA1 | Date | |
|---|---|---|---|
| 0456dba5d1 | |||
| 66fbc7eeab | |||
| a1186a2c1c |
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.vscode
|
||||||
|
workspace.code-workspace
|
||||||
|
.git
|
||||||
|
.venv
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
.vscode
|
.vscode
|
||||||
twaiceAWS.fish
|
workspace.code-workspace
|
||||||
64
1_main_setup.sh
Executable file
64
1_main_setup.sh
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# run as root/sudo
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root / sudo"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
DOCKER_COMPOSE_VERSION=v2.23.0
|
||||||
|
|
||||||
|
# Update sources
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
#tzdata region settings
|
||||||
|
TZ_REGION=Europe
|
||||||
|
TZ_ZONE=Berlin
|
||||||
|
# make tzdata noninteractive on docker...
|
||||||
|
echo "tzdata tzdata/Areas select $TZ_REGION" | debconf-set-selections
|
||||||
|
echo "tzdata tzdata/Zones/$TZ_REGION select $TZ_ZONE" | debconf-set-selections
|
||||||
|
DEBIAN_FRONTEND="noninteractive" apt install tzdata -y
|
||||||
|
|
||||||
|
# Upgrade System:
|
||||||
|
apt-get upgrade -y
|
||||||
|
|
||||||
|
# install env packages
|
||||||
|
apt-get install git fish build-essential jq vim curl sudo unzip fzf htop -y
|
||||||
|
|
||||||
|
# pyenv dependencies
|
||||||
|
apt-get install python3-dev python3-setuptools python3-pip python3-venv python3-smbus pipx liblzma-dev libffi-dev libssl-dev openssl zlib1g-dev libsqlite3-dev tk-dev libreadline-dev libbz2-dev -y
|
||||||
|
|
||||||
|
# install docker stable, if this failes try below
|
||||||
|
curl -fsSLo- https://get.docker.com | sh
|
||||||
|
#curl -fsSLo- https://test.docker.com | sh
|
||||||
|
|
||||||
|
# install docker-compose
|
||||||
|
curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||||
|
chmod +x /usr/local/bin/docker-compose
|
||||||
|
|
||||||
|
# aws cli
|
||||||
|
cd /tmp
|
||||||
|
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||||
|
unzip awscliv2.zip
|
||||||
|
./aws/install
|
||||||
|
rm awscliv2.zip
|
||||||
|
rm -rf ./aws
|
||||||
|
|
||||||
|
# session manager plugin
|
||||||
|
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"
|
||||||
|
dpkg -i session-manager-plugin.deb
|
||||||
|
cd -
|
||||||
|
|
||||||
|
read -p "User that will be used after installation complete: " NEW_USER
|
||||||
|
passwd $NEW_USER
|
||||||
|
|
||||||
|
# give user docker permissions
|
||||||
|
usermod -aG docker $NEW_USER
|
||||||
|
|
||||||
|
echo "######################################"
|
||||||
|
echo "# Changing default shell to fish now #"
|
||||||
|
echo "# Please call ./2_fish_setup.sh #"
|
||||||
|
echo "######################################"
|
||||||
|
chsh $NEW_USER -s /usr/bin/fish
|
||||||
|
sudo -i -u $NEW_USER fish
|
||||||
72
2_fish_setup.sh
Executable file
72
2_fish_setup.sh
Executable file
@ -0,0 +1,72 @@
|
|||||||
|
#!/bin/fish
|
||||||
|
|
||||||
|
set PYTHON_VERSION 3.11.6
|
||||||
|
set NODE_VERSION lts/hydrogen
|
||||||
|
|
||||||
|
# dont run as root/sudo
|
||||||
|
if [ "$EUID" -eq 0 ]
|
||||||
|
then echo "Please do not run as root / sudo"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
# install rust toolchain
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
|
||||||
|
# install pyenv
|
||||||
|
git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv
|
||||||
|
|
||||||
|
# install nvm
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
|
||||||
|
|
||||||
|
# install fzf from source
|
||||||
|
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
||||||
|
bash ~/.fzf/install --no-update-rc --completion --key-bindings
|
||||||
|
|
||||||
|
# install fisher
|
||||||
|
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
|
||||||
|
|
||||||
|
# copy fish config
|
||||||
|
if test -f "~/.config/fish/functions/config.fish"; then
|
||||||
|
echo "config.fish already exist, please rename to continue."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
cp fish/config.fish ~/.config/fish/
|
||||||
|
|
||||||
|
# copy fishfile
|
||||||
|
if test -f "~/.config/fish/fish_plugins"; then
|
||||||
|
echo "fish_plugins already exist, please rename to continue."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
cp fish/fish_plugins ~/.config/fish/
|
||||||
|
|
||||||
|
# setup pyenv, cargo + local bin paths in fish
|
||||||
|
mkdir $HOME/.local/bin
|
||||||
|
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||||
|
fish_add_path $PYENV_ROOT/bin
|
||||||
|
fish_add_path $HOME/.local/bin
|
||||||
|
fish_add_path $HOME/.cargo/bin
|
||||||
|
|
||||||
|
# install packages from fishfile
|
||||||
|
fisher update
|
||||||
|
|
||||||
|
cp -R fish/theme-t31m/functions/* ~/.config/fish/functions/
|
||||||
|
|
||||||
|
# install node via nvm
|
||||||
|
nvm install $NODE_VERSION
|
||||||
|
nvm alias default $NODE_VERSION
|
||||||
|
|
||||||
|
# Install Python
|
||||||
|
pyenv install $PYTHON_VERSION
|
||||||
|
# pip install --upgrade pip
|
||||||
|
|
||||||
|
# Install pipx for future non-user local packages
|
||||||
|
pipx ensurepath
|
||||||
|
|
||||||
|
# pipx completions
|
||||||
|
pipx completions
|
||||||
|
register-python-argcomplete --shell fish pipx >~/.config/fish/completions/pipx.fish
|
||||||
|
|
||||||
|
# cp vimrc
|
||||||
|
echo "Installing .vimrc"
|
||||||
|
cp dot.vimrc $HOME/.vimrc
|
||||||
|
|
||||||
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM ubuntu:mantic
|
||||||
|
|
||||||
|
ARG USER=testuser
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get upgrade -y && \
|
||||||
|
apt-get install git fish build-essential jq vim curl sudo unzip fzf htop \
|
||||||
|
python3-dev python3-setuptools python3-pip python3-venv python3-smbus pipx liblzma-dev libffi-dev \
|
||||||
|
libssl-dev openssl zlib1g-dev libsqlite3-dev tk-dev libreadline-dev libbz2-dev locales -y \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||||
|
|
||||||
|
ENV LANG en_US.utf8
|
||||||
|
|
||||||
|
RUN useradd -m -s /usr/bin/bash $USER
|
||||||
|
RUN usermod -aG sudo $USER
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/bin/bash" ]
|
||||||
@ -11,6 +11,13 @@ T31M Dotfiles Repository
|
|||||||
### Contents ###
|
### Contents ###
|
||||||
* FiSH Shell Setup & Configuration
|
* FiSH Shell Setup & Configuration
|
||||||
* Theme/Prompt Based heavily on: omf/theme-sushi check it out
|
* Theme/Prompt Based heavily on: omf/theme-sushi check it out
|
||||||
* NVM + NVM FiSH support
|
* NVM + Pyenv / PipX / AWS FiSH support
|
||||||
* edc/bass
|
* edc/bass
|
||||||
* fzf
|
* fzf
|
||||||
|
|
||||||
|
### Test in Docker
|
||||||
|
|
||||||
|
There are some runtime issues due to mounting of .git folder when executing container for test installation !
|
||||||
|
|
||||||
|
* `docker build --build-arg USER=*your user* -t fish-test .`
|
||||||
|
* `docker run --rm -it -v (pwd):/app --mount type=volume,dst=/app/.git --name fish-test fish-test`
|
||||||
@ -1,7 +1,8 @@
|
|||||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
if status is-interactive
|
||||||
set -Ux fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
# Commands to run in interactive sessions can go here
|
||||||
|
|
||||||
# pyenv init
|
# pyenv init
|
||||||
if command -v pyenv 1>/dev/null 2>&1
|
if command -v pyenv 1>/dev/null 2>&1
|
||||||
pyenv init - | source
|
pyenv init - | source
|
||||||
end
|
end
|
||||||
|
end
|
||||||
@ -1,4 +1,3 @@
|
|||||||
jorgebucaran/fisher
|
|
||||||
edc/bass
|
edc/bass
|
||||||
jethrokuan/fzf
|
jethrokuan/fzf
|
||||||
FabioAntunes/fish-nvm
|
FabioAntunes/fish-nvm
|
||||||
|
|||||||
4
fish/theme-t31m/functions/cdk2.fish
Normal file
4
fish/theme-t31m/functions/cdk2.fish
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Defined in - @ line 1
|
||||||
|
function cdk --wraps='npx aws-cdk@2.x' --description 'alias cdk=npx aws-cdk@2.x'
|
||||||
|
npx aws-cdk@2.x $argv;
|
||||||
|
end
|
||||||
@ -4,7 +4,7 @@
|
|||||||
set AWS_IAM_USER ""
|
set AWS_IAM_USER ""
|
||||||
|
|
||||||
# TODO setup your aws-mfa credential keys in the credentials file
|
# TODO setup your aws-mfa credential keys in the credentials file
|
||||||
# TODO replace "Administrator" Role with the actual role you want to assume.
|
# TODO replace "PLACE_YOUR_ROLE_HERE" with the actual role you want to assume.
|
||||||
|
|
||||||
# AWS Account details
|
# AWS Account details
|
||||||
set DEV_ACCOUNT_ID ""
|
set DEV_ACCOUNT_ID ""
|
||||||
@ -26,19 +26,19 @@ function envAWS --description 'switch to different aws account environments (-)
|
|||||||
switch $argv[1]
|
switch $argv[1]
|
||||||
case dev
|
case dev
|
||||||
echo "switching to /refreshing dev"
|
echo "switching to /refreshing dev"
|
||||||
aws-mfa --assume-role arn:aws:iam::$DEV_ACCOUNT_ID:role/Administrator --duration 43200 --role-session-name $AWS_IAM_USER
|
aws-mfa --assume-role arn:aws:iam::$DEV_ACCOUNT_ID:role/PLACE_YOUR_ROLE_HERE --duration 43200 --role-session-name "$AWS_IAM_USER"
|
||||||
getAWSenv
|
getAWSenv
|
||||||
case stg
|
case stg
|
||||||
echo "switching to /refreshing staging"
|
echo "switching to /refreshing staging"
|
||||||
aws-mfa --assume-role arn:aws:iam::$STG_ACCOUNT_ID:role/Administrator --duration 43200 --role-session-name $AWS_IAM_USER
|
aws-mfa --assume-role arn:aws:iam::$STG_ACCOUNT_ID:role/PLACE_YOUR_ROLE_HERE --duration 43200 --role-session-name "$AWS_IAM_USER"
|
||||||
getAWSenv
|
getAWSenv
|
||||||
case prod
|
case prod
|
||||||
echo "switching to /refreshing prod"
|
echo "switching to /refreshing prod"
|
||||||
aws-mfa --assume-role arn:aws:iam::$PROD_ACCOUNT_ID:role/Administrator --duration 3600 --role-session-name $AWS_IAM_USER
|
aws-mfa --assume-role arn:aws:iam::$PROD_ACCOUNT_ID:role/PLACE_YOUR_ROLE_HERE --duration 3600 --role-session-name "$AWS_IAM_USER"
|
||||||
getAWSenv
|
getAWSenv
|
||||||
case ops
|
case ops
|
||||||
echo "switching to /refreshing ops"
|
echo "switching to /refreshing ops"
|
||||||
aws-mfa --assume-role arn:aws:iam::$OPS_ACCOUNT_ID:role/Administrator --duration 3600 --role-session-name $AWS_IAM_USER
|
aws-mfa --assume-role arn:aws:iam::$OPS_ACCOUNT_ID:role/PLACE_YOUR_ROLE_HERE --duration 3600 --role-session-name "$AWS_IAM_USER"
|
||||||
getAWSenv
|
getAWSenv
|
||||||
case '*'
|
case '*'
|
||||||
echo "Wrong / Invalid Environment provided"
|
echo "Wrong / Invalid Environment provided"
|
||||||
@ -67,3 +67,12 @@ function getAWSenv --description 'verify and set environment'
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getSecretAWS --description 'get & decrypt secrets from ssm parameter store via cli command if permissions are granted'
|
||||||
|
if test (count $argv) -lt 1
|
||||||
|
echo "Provide a Path to the Secret"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
aws ssm get-parameter --name "$argv[1]" --with-decryption | jq .Parameter.Value -r
|
||||||
|
end
|
||||||
12
fish/theme-t31m/functions/envsource.fish
Normal file
12
fish/theme-t31m/functions/envsource.fish
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Place this in your Fish functions folder to make it available immediately
|
||||||
|
# e.g. ~/.config/fish/functions/envsource.fish
|
||||||
|
#
|
||||||
|
# Usage: envsource <path/to/env>
|
||||||
|
|
||||||
|
function envsource
|
||||||
|
for line in (cat $argv | grep -v '^#')
|
||||||
|
set item (string split -m 1 '=' $line)
|
||||||
|
set -gx $item[1] $item[2]
|
||||||
|
echo "Exported key $item[1]"
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,4 +1,6 @@
|
|||||||
function ssm_tunnel --description 'access private AWS ressources via Bastion Host'
|
# See: https://aws.amazon.com/about-aws/whats-new/2022/05/aws-systems-manager-support-port-forwarding-remote-hosts-using-session-manager/
|
||||||
|
# And: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html#sessions-remote-port-forwarding
|
||||||
|
function ssm_tunnel --description 'Access private AWS ressources via native SSM port forwarding through bastion'
|
||||||
|
|
||||||
if test (count $argv) -lt 2
|
if test (count $argv) -lt 2
|
||||||
echo "Provide an Host:Port Mapping & an Local Port"
|
echo "Provide an Host:Port Mapping & an Local Port"
|
||||||
@ -12,32 +14,61 @@ function ssm_tunnel --description 'access private AWS ressources via Bastion Hos
|
|||||||
|
|
||||||
# Get bastion host ID using it's name
|
# Get bastion host ID using it's name
|
||||||
set INSTANCE_ID (aws ec2 describe-instances \
|
set INSTANCE_ID (aws ec2 describe-instances \
|
||||||
--filter 'Name=tag:Name,Values=ops-infrastructure-bastion'\
|
--filter 'Name=tag:Name,Values=INSTANCE_NAME_HERE'\
|
||||||
--query "Reservations[].Instances[?State.Name == 'running'].InstanceId[]"\
|
--query "Reservations[].Instances[?State.Name == 'running'].InstanceId[]"\
|
||||||
--output text)
|
--output text)
|
||||||
|
|
||||||
# AWS Remote host i.e elastic.aws.com:80
|
# AWS Remote host i.e AWS Remote host i.e internal.x.yourdns / xxx.eu-west-1.elb.amazonaws.com
|
||||||
set REMOTE_HOST $argv[1]
|
set REMOTE_HOST (string split -f1 : $argv[1])
|
||||||
|
set REMOTE_PORT (string split -f2 : $argv[1])
|
||||||
# Ports to bind for forwarding
|
# Local port to bind for forwarding
|
||||||
set LOCAL_PORT $argv[2]
|
set LOCAL_PORT $argv[2]
|
||||||
set REM_PORT (math (random) % 65535 + 2000)
|
|
||||||
set TIMEOUT 21600 #seconds until forwarding session times out (48h max)
|
|
||||||
|
|
||||||
# make sure jq is installed
|
# Seconds until forwarding session times out (6h max)
|
||||||
# Start socat on the remote server
|
set TIMEOUT 21600
|
||||||
set CMD "'sudo socat TCP4-LISTEN:$REM_PORT,reuseaddr,fork TCP4:$REMOTE_HOST'"
|
|
||||||
set CMD_INVOC_ID (aws ssm send-command --instance-ids $INSTANCE_ID \
|
|
||||||
--document-name 'AWS-RunShellScript' \
|
|
||||||
--parameters "commands=$CMD,executionTimeout=$TIMEOUT" --output json | jq -r '.Command.CommandId')
|
|
||||||
|
|
||||||
# Start tunnel session
|
# Start tunnel session
|
||||||
echo "Starting Tunnel"
|
echo "Starting Tunnel"
|
||||||
aws ssm start-session --target $INSTANCE_ID \
|
aws ssm start-session --target $INSTANCE_ID \
|
||||||
--document-name "AWS-StartPortForwardingSession" \
|
--document-name "AWS-StartPortForwardingSessionToRemoteHost" \
|
||||||
--parameters "portNumber=$REM_PORT,localPortNumber=$LOCAL_PORT"
|
--parameters "host=[$REMOTE_HOST],portNumber=[$REMOTE_PORT],localPortNumber=[$LOCAL_PORT]"
|
||||||
|
|
||||||
# stop socat on the bastion
|
echo "Tunneling Session Exited."
|
||||||
aws ssm cancel-command --command-id $CMD_INVOC_ID
|
end
|
||||||
echo "Command Cancelled Successfully."
|
|
||||||
|
# This function is for custom & higher privileged users only.
|
||||||
|
function ssm_tunnel_admin --description 'Access private AWS ressources via native SSM port forwarding through bastion'
|
||||||
|
|
||||||
|
if test (count $argv) -lt 2
|
||||||
|
echo "Provide an Host:Port Mapping & an Local Port"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if [ "$env" != "ops" ]
|
||||||
|
echo "Switch to OPS ENV first"
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
# Get bastion host ID using it's name
|
||||||
|
set INSTANCE_ID (aws ec2 describe-instances \
|
||||||
|
--filter 'Name=tag:Name,Values=INSTANCE_NAME_HERE'\
|
||||||
|
--query "Reservations[].Instances[?State.Name == 'running'].InstanceId[]"\
|
||||||
|
--output text)
|
||||||
|
|
||||||
|
# AWS Remote host i.e internal.x.yourdns / xxx.eu-west-1.elb.amazonaws.com
|
||||||
|
set REMOTE_HOST (string split -f1 : $argv[1])
|
||||||
|
set REMOTE_PORT (string split -f2 : $argv[1])
|
||||||
|
# Local port to bind for forwarding
|
||||||
|
set LOCAL_PORT $argv[2]
|
||||||
|
|
||||||
|
# Seconds until forwarding session times out (6h max)
|
||||||
|
set TIMEOUT 21600
|
||||||
|
|
||||||
|
# Start tunnel session
|
||||||
|
echo "Starting Tunnel"
|
||||||
|
aws ssm start-session --target $INSTANCE_ID \
|
||||||
|
--document-name "AWS-StartPortForwardingSessionToRemoteHost" \
|
||||||
|
--parameters "host=[$REMOTE_HOST],portNumber=[$REMOTE_PORT],localPortNumber=[$LOCAL_PORT]"
|
||||||
|
|
||||||
|
echo "Tunneling Session Exited."
|
||||||
end
|
end
|
||||||
@ -22,7 +22,6 @@ function prompt::pyenv
|
|||||||
set venv (echo "$VIRTUAL_ENV" | grep -Eo '[^/]+/?$' | cut -d / -f1)
|
set venv (echo "$VIRTUAL_ENV" | grep -Eo '[^/]+/?$' | cut -d / -f1)
|
||||||
echo -n -s (printf '%s' \U1F40D)(yellow)"["(cyan)"$venv"(yellow)"@"(off)"$python_version"(yellow)"]"(off)
|
echo -n -s (printf '%s' \U1F40D)(yellow)"["(cyan)"$venv"(yellow)"@"(off)"$python_version"(yellow)"]"(off)
|
||||||
else if test -n "$PYENV_VERSION"; and [ "$PYENV_VERSION" != "$python_version" ]
|
else if test -n "$PYENV_VERSION"; and [ "$PYENV_VERSION" != "$python_version" ]
|
||||||
# echo -n -s (yellow)(printf '%s' \U1F40D)"["(cyan)(pyenv version-name | sed 's/:.*$//' )(off)"@$python_version"(yellow)"]"(off)
|
|
||||||
echo -n -s (yellow)(printf '%s' \U1F40D)"["(cyan)(pyenv version-name )(off)"@$python_version"(yellow)"]"(off)
|
echo -n -s (yellow)(printf '%s' \U1F40D)"["(cyan)(pyenv version-name )(off)"@$python_version"(yellow)"]"(off)
|
||||||
else if test -n "$python_version"
|
else if test -n "$python_version"
|
||||||
echo -n -s (yellow)(printf '%s' \U1F40D)"["(off)$python_version(yellow)"]"(off)
|
echo -n -s (yellow)(printf '%s' \U1F40D)"["(off)$python_version(yellow)"]"(off)
|
||||||
|
|||||||
@ -1,46 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# install nvm
|
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
|
|
||||||
|
|
||||||
# install pyenv
|
|
||||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
|
||||||
|
|
||||||
# install fzf from source
|
|
||||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
|
||||||
bash ~/.fzf/install --no-update-rc --completion --key-bindings
|
|
||||||
|
|
||||||
# install fisher
|
|
||||||
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher $plugins
|
|
||||||
|
|
||||||
# copy fish config
|
|
||||||
if test -f "~/.config/fish/functions/config.fish"; then
|
|
||||||
echo "config.fish already exist, please rename to continue."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cp fish/config.fish ~/.config/fish/functions/
|
|
||||||
|
|
||||||
# copy fishfile
|
|
||||||
if test -f "~/.config/fish/fish_plugins"; then
|
|
||||||
echo "fish_plugins already exist, please rename to continue."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cp fish/fish_plugins ~/.config/fish/
|
|
||||||
|
|
||||||
echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish
|
|
||||||
|
|
||||||
# install packages from fishfile
|
|
||||||
fish -c "fisher install jorgebucaran/fisher"
|
|
||||||
fish -c "fisher install (pwd)/fish/theme-t31m"
|
|
||||||
fish -c "fisher install FabioAntunes/fish-nvm"
|
|
||||||
fish -c "fisher update"
|
|
||||||
|
|
||||||
# set fish default shell
|
|
||||||
echo "Change your default Shell to FiSH: chsh -s /usr/bin/fish"
|
|
||||||
|
|
||||||
# cp vimrc
|
|
||||||
echo "Installing .vimrc"
|
|
||||||
cp dot.vimrc ~/.vimrc
|
|
||||||
|
|
||||||
27
main.sh
27
main.sh
@ -1,27 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
USER=t31m
|
|
||||||
|
|
||||||
# update repos + system
|
|
||||||
apt-get update && apt-get upgrade
|
|
||||||
|
|
||||||
# install env packages
|
|
||||||
apt-get install git fish fzf build-essential jq vim curl -y
|
|
||||||
|
|
||||||
# pyenv dependencies ?
|
|
||||||
apt-get install python3-dev python3-setuptools python3-pip python3-smbus libffi-dev libssl-dev openssl zlib1g-dev libsqlite3-dev tk-dev libreadline-dev libbz2-dev -y
|
|
||||||
|
|
||||||
# install docker stable, if this failes try below
|
|
||||||
curl -fsSL https://get.docker.com | sh
|
|
||||||
#curl -fsSL https://test.docker.com | sh
|
|
||||||
|
|
||||||
# install docker-compose
|
|
||||||
# v1
|
|
||||||
# curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
|
||||||
# v2
|
|
||||||
curl -L https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
|
||||||
chmod +x /usr/local/bin/docker-compose
|
|
||||||
|
|
||||||
usermod -aG docker t31m
|
|
||||||
|
|
||||||
echo "Initial Setup Complete. Please run fish_setup.sh for env setup"
|
|
||||||
Reference in New Issue
Block a user