Skip to content

Instantly share code, notes, and snippets.

Avatar
🏚️
Work From Home

Thiên Toán toanalien

🏚️
Work From Home
View GitHub Profile
@toanalien
toanalien / admin-gogs.sh
Created Jun 14, 2019
create admin gogs
View admin-gogs.sh
#!/bin/bash
docker-compose exec --user git web bash
export USER=git
cd /app/gogs
./gogs admin create-user --name tmpuser --password tmppassword --admin --email email@example.com
View packstack.sh
sudo systemctl disable firewalld
sudo systemctl stop firewalld
sudo yum update -y
sudo yum install -y centos-release-openstack-stein
sudo yum update -y
sudo yum install -y openstack-packstack
sudo packstack --allinone
@toanalien
toanalien / import-glance.sh
Last active Jun 13, 2019
import image to glance
View import-glance.sh
#!/bin/bash
export CB_LATEST_IMAGE=cb-hdp-26-1808062221.img
export CB_LATEST_IMAGE_NAME=cb-hdp-26-1808062221.img
export OS_USERNAME=admin
export OS_AUTH_URL=http://localhost/identity
export OS_TENANT_NAME=admin
export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
glance image-create --name "$CB_LATEST_IMAGE_NAME" --file "$CB_LATEST_IMAGE" --disk-format qcow2 --container-format bare --progress
@toanalien
toanalien / change-mirror.sh
Last active Feb 28, 2020
Change mirror ubuntu
View change-mirror.sh
#!/bin/bash
#http://mirrors.ubuntu.com/mirrors.txt
#sudo sed -i 's%us.archive.ubuntu.com%mirror.ehost.vn%' /etc/apt/sources.list
sudo sed -i 's%us.archive.ubuntu.com%mirror.clearsky.vn%' /etc/apt/sources.list
View netselect-apt.sh
#!/bin/bash
# chmod +x netselect-apt.sh
# sudo netselect-apt.sh
rm -rf netselect*.deb
wget http://ftp.us.debian.org/debian/pool/main/n/netselect/netselect_0.3.ds1-28+b1_amd64.deb
sudo dpkg -i netselect_0.3.ds1-28+b1_amd64.deb
wget http://ftp.us.debian.org/debian/pool/main/n/netselect/netselect-apt_0.3.ds1-28_all.deb
sudo dpkg -i netselect-apt_0.3.ds1-28_all.deb
View hdinsighttemplate.json
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "0.9.0.0",
"parameters": {
"clusterName": {
"type": "string",
"metadata": {
"description": "The name of the HDInsight cluster to create."
}
},
@toanalien
toanalien / docker-compose.yml
Last active May 6, 2019
ParseServer + Dashboard + MongoDB
View docker-compose.yml
version: '3'
services:
mongo:
image: mongo
ports:
- 27017:27017
volumes:
- ./data-db:/data/db
View docker-compose.yml
version: '3.1'
services:
db:
image: postgres:10
restart: always
ports:
- 5432:5432
volumes:
@toanalien
toanalien / install_pyenv.sh
Created Jan 28, 2019 — forked from jmvrbanac/install_pyenv.sh
Install pyenv on Ubuntu
View install_pyenv.sh
#!/bin/bash
sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl
sudo pip install virtualenvwrapper
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
@toanalien
toanalien / docker-compose.yml
Created Jan 21, 2019
xxx project docker-compose file with bundle: django app, postgres, adminer (database web gui), rabbitmq, celery for worker process, flower (celery gui)
View docker-compose.yml
version: "3"
services:
rabbitmq:
image: rabbitmq:3
hostname: rabbit
postgres:
image: postgres:10
restart: always
environment: