Skip to content

Instantly share code, notes, and snippets.

View defaye's full-sized avatar

Jono Feist defaye

  • England
View GitHub Profile
@defaye
defaye / install_docker.sh
Last active July 12, 2021 11:06
Install Docker and Docker Compose
# https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
# https://docs.docker.com/compose/install/
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
@defaye
defaye / install_ruby_on_rails.sh
Last active July 12, 2021 11:08
Install Ruby on Rails with rbenv on Ubuntu 18.04
sudo apt update && sudo apt install -y git-all \
autoconf \
bison \
build-essential \
libssl-dev \
libyaml-dev \
libreadline6-dev \
zlib1g-dev \
libncurses5-dev \
libffi-dev \
@defaye
defaye / install_cyberduck.sh
Last active July 5, 2021 12:32
Install Cyberduck cloud storage command line tool on Ubuntu 18.04
echo -e "deb https://s3.amazonaws.com/repo.deb.cyberduck.io stable main" | sudo tee /etc/apt/sources.list.d/cyberduck.list > /dev/null
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FE7097963FEFBE72
sudo apt-get update && sudo apt install -y duck
@defaye
defaye / install_redis_server.sh
Last active June 2, 2020 19:59
Install Redis Server on Ubuntu 18.04
sudo apt update && sudo apt install -y redis-server
sudo sed -i -E "s/^supervised .*$/supervised systemd/" /etc/redis/redis.conf # make redis a background service
sudo service redis restart
@defaye
defaye / install_zsh.sh
Last active December 23, 2020 12:15
Install ZSH with Oh-My-ZSH including some useful plugins on Ubuntu 18.04
sudo apt update && sudo apt install -y zsh git-core fonts-powerline curl
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
chsh -s `which zsh`
touch ~/.zshrc
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sed -i -E "s/ZSH_THEME=.*/ZSH_THEME=\"agnoster\"/" ~/.zshrc
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
sed -i -E "s/^plugins=\((.*)\)/plugins=(\1 zsh-completions)/" ~/.zshrc
sed -i -E "s/^plugins=.*$/&\nautoload -U compinit \&\& compinit/" ~/.zshrc
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
@defaye
defaye / install_postgresql.sh
Last active June 2, 2020 20:00
Install PostgreSQL 10 for local development on Ubuntu 18.04
sudo apt update && sudo apt install -y postgresql-10 libpq-dev postgresql-contrib
sudo cp /etc/postgresql/10/main/pg_hba.conf /etc/postgresql/10/main/pg_hba.conf.backup
sudo sed -i -E "s/^(local\s+all\s+postgres\s+)peer$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo sed -i -E "s/^(local\s+all\s+all\s+)md5$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo sed -i -E "s/^(host\s+all\s+all\s+127\.0\.0\.1\/32\s+)md5$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo sed -i -E "s/^(host\s+all\s+all\s+::1\/128\s+)md5$/\1trust/" /etc/postgresql/10/main/pg_hba.conf
sudo service postgresql restart
@defaye
defaye / download-file.js
Created August 12, 2019 13:08 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);