Skip to content

Instantly share code, notes, and snippets.

View toanalien's full-sized avatar
🎯
Focusing

Thiên Toán toanalien

🎯
Focusing
View GitHub Profile
@toanalien
toanalien / admin-gogs.sh
Created June 14, 2019 09:03
create admin gogs
#!/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
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 June 13, 2019 15:55
import image to glance
#!/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 February 28, 2020 07:51
Change mirror ubuntu
#!/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
#!/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
{
"$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 05:01
ParseServer + Dashboard + MongoDB
version: '3'
services:
mongo:
image: mongo
ports:
- 27017:27017
volumes:
- ./data-db:/data/db
version: '3.1'
services:
db:
image: postgres:10
restart: always
ports:
- 5432:5432
volumes:
@toanalien
toanalien / install_pyenv.sh
Created January 28, 2019 02:55 — forked from jmvrbanac/install_pyenv.sh
Install pyenv on Ubuntu
#!/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 January 21, 2019 11:25
xxx project docker-compose file with bundle: django app, postgres, adminer (database web gui), rabbitmq, celery for worker process, flower (celery gui)
version: "3"
services:
rabbitmq:
image: rabbitmq:3
hostname: rabbit
postgres:
image: postgres:10
restart: always
environment: