Instantly share code, notes, and snippets.

View create-rpm-opensuse-samba4.sh
#!/bin/bash
## Create RPM package Samba4 4.9.2 (OpenSUSE 15)
## http://sig9.hatenablog.com/entry/2017/12/04/000000
## Run as root (sudo su)
## docker run --rm -it -v "${PWD}:/usr/src" -e LANG=en_US.UTF-8 opensuse/leap:15 /bin/bash
zypper in -y ruby-devel rpm-build wget tar gzip
zypper in -y pkg-config libblkid-devel autoconf make python-devel gdb sqlite3-devel libgnutls-devel libjansson-devel
zypper in -y perl perl-TimeDate git-core pam-devel libsepol-devel ccache cracklib-devel gdbm-devel libgpgme-devel
View golang-sending-email.go
package main
import (
"fmt"
"net/mail"
"net/smtp"
"strings"
)
var host = "127.0.0.1"
View create-deb-samba4.sh
#!/bin/bash
## Create DEB package Samba4 4.9.1 (Debian 9)
## http://sig9.hatenablog.com/entry/2017/12/04/000000
## Run as root (sudo su)
apt-get update
apt-get -yq install ruby-dev
apt-get -yq install libreadline-dev git build-essential libattr1-dev libblkid-dev libpam0g-dev
apt-get -yq install autoconf python-dev python-dnspython libacl1-dev gdb pkg-config libpopt-dev
apt-get -yq install libldap2-dev libtirpc-dev libxslt1-dev python-pycryptopp libgnutls28-dev
View create-rpm-samba4.sh
#!/bin/bash
## Create RPM package Samba4 4.9.1 (CentOS 7)
## http://sig9.hatenablog.com/entry/2017/12/04/000000
## Run as root (sudo su)
yum -y install \
gcc \
rpm-build \
ruby \
ruby-devel \
View install-rancher-ubuntu.md

Instalando Rancher no Ubuntu 16.04 64Bits

O ambiente foi criado na nuvem do Google

Preparando ambiente Manager

1 Agent Server: 2 CPUs, 7.5GB de RAM, 30GB de HD.

Para ambiente de Homologação (HOMO)

View install-wine-centos7.sh
#!/bin/bash
# Download, build and install wine 32-bit on CentOS 7
# For details of this script, please check
# https://www.systutorials.com/239913/install-32-bit-wine-1-8-centos-7/
# Author: Eric Zhiqiang Ma (zma@ericzma.com)
function compile_wine {
View install_tidb_on_ispconfig.sh
#!/bin/bash
## Install and Setup TiDB on Linux
## https://github.com/pingcap/tidb
## https://github.com/pingcap/docs/blob/master/sql/privilege.md
## https://pingcap.com/blog/2016-10-17-how-we-build-tidb/
## https://github.com/pingcap/tidb/blob/master/config/config.toml.example
## Remove MariaDB/Mysql
systemctl stop mysql mysqld
View install_setup_tidb.sh
#!/bin/bash
## Install and Setup TiDB on Linux
## https://github.com/pingcap/tidb
## https://github.com/pingcap/docs/blob/master/sql/privilege.md
## https://pingcap.com/blog/2016-10-17-how-we-build-tidb/
useradd tidb -d /var/lib/tidb -m
usermod -a -G tidb tidb
cd /var/lib/tidb
View get_linux_dist.go
package main
import (
"log"
"os/exec"
"strings"
)
func main() {
View gowget.go
package main
/*
Usage of ./gowget [URL] for download
URL: https://github.com/thbar/golang-playground/blob/master/download-files.go
URL: https://stackoverflow.com/questions/11692860/how-can-i-efficiently-download-a-large-file-using-go
*/