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
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); |
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
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 |
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
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 |
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
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 |
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
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 |
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
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 \ |
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
# 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 |
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
# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04 | |
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh | |
bash install_nvm.sh | |
{ cat << 'EOT'; cat << EOF; } >> ~/.$(echo $SHELL | grep -o '[^/]*$')rc | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
EOT | |
EOF | |
source ~/.$(echo $SHELL | grep -o '[^/]*$')rc |
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
sudo apt update && sudo apt install -y postgis postgresql-10-postgis-2.4 | |
sudo -u postgres createuser postgis_test | |
sudo -u postgres createdb postgis_db -O postgis_test | |
sudo -u postgres psql -d postgis_db -c 'CREATE EXTENSION postgis' | |
sudo -u postgres psql -d postgis_db -c 'SELECT PostGIS_version()' |
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
# https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-18-04 | |
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list | |
sudo apt update && sudo apt install -y elasticsearch | |
sudo sed -i -E "s/^\#?network\.host:\s+.*$/network.host: localhost/" /etc/elasticsearch/elasticsearch.yml | |
sudo service elasticsearch start # start as a service | |
systemctl list-units --type service | grep elasticsearch # check it is active and enabled on boot # https://askubuntu.com/questions/912216/16-04-command-to-list-all-services-started-on-boot |
OlderNewer