Instantly share code, notes, and snippets.

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 RPM package Samba4 4.8.4 (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 libldap2-dev
apt-get -yq install dnsutils acl attr libbsd-dev docbook-xsl libcups2-dev libgnutls28-dev curl
View create-rpm-samba4.sh
#!/bin/bash
## Create RPM package Samba4 4.8.4 (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
*/
View install_pagespeed_nginx.sh
#!/bin/bash
## Install PageSpeed on Debian 8/9 and Ubuntu 16.04 64Bits
## https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-16-04/
## http://nginx.org/en/linux_packages.html
## https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source
## https://developers.google.com/speed/pagespeed/module/
## Debian ISO: https://cdimage.debian.org/cdimage/archive/8.9.0/amd64/iso-cd/
## No Link abaixo tem o pacote do Nginx para o Debian 8 64Bits
## https://github.com/jniltinho/ispconfig/tree/master/packages/debian/jessie
## Run as root (sudo su)