Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nilton Oliveira jniltinho

🏠
Working from home
View GitHub Profile
@jniltinho
jniltinho / create-rpm-samba4.sh
Last active Jul 23, 2021
FPM CentOS 7 Samba 4.11.5 RPM
View create-rpm-samba4.sh
#!/bin/bash
## Create RPM package Samba4 4.11.5 (CentOS 7)
## http://sig9.hatenablog.com/entry/2017/12/04/000000
## Run as root (sudo su)
VERSION=4.11.5
yum -y install epel-release
yum update -y
yum -y install gcc python3-devel curl rpm-build ruby ruby-devel rubygems ruby-libs make
@jniltinho
jniltinho / install-gitlab-runner.sh
Last active Jul 18, 2021
Install GitLab Runner on Ubuntu 16.04
View install-gitlab-runner.sh
#!/bin/bash
## Install GitLab Runner on Ubuntu 16.04
## https://docs.gitlab.com/runner/install/linux-manually.html
## Config do Runner /etc/gitlab-runner/config.toml
## Para registrar e usar uma CA auto assinada
## gitlab-runner register --tls-ca-file="/home/gitlab-runner/data/certs/ca.crt"
## Install Docker
apt-get update
apt-get upgrade
@jniltinho
jniltinho / myip.go
Created Mar 26, 2014
Get My IP Golang
View myip.go
package main
/*
URL: https://github.com/mccoyst/myip/blob/master/myip.go
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/
*/
import (
"net"
"os"
@jniltinho
jniltinho / sqlserver-linux-backup.py
Last active Jul 12, 2021
SQL Server command line Backup Linux
View sqlserver-linux-backup.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## SQL Server command line backup Linux
## On OpenSUSE 42.2 64Bits
## Author: Nilton OS -- www.linuxpro.com.br
## http://stackoverflow.com/questions/880487/sql-server-command-line-backup-statement
## https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-migrate-sqlpackage
## Version: 0.2
### BACKUP SCRIPT SQLSERVER CLI
@jniltinho
jniltinho / golang-sending-email.go
Last active Jun 27, 2021
Postfix and Golang - Sending emails
View golang-sending-email.go
package main
import (
"fmt"
"net/mail"
"net/smtp"
"strings"
)
var host = "127.0.0.1"
@jniltinho
jniltinho / install_php55_ubuntu.sh
Last active Jun 12, 2021
Install PHP 5.5.38 on Ubuntu 16.04 64Bits
View install_php55_ubuntu.sh
#!/bin/bash
### Install PHP 5.5.38 on Ubuntu 16.04 64Bits
### https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/
apt-get -y install build-essential libxml2-dev libxslt1-dev
apt-get -y install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libxml2-dev
apt-get -y install libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
apt-get -y install libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev
apt-get -y install libfreetype6-dev libkrb5-dev libpq-dev libicu-dev
View install-mt7612u-ubuntu.sh
#!/bin/bash
## Install USB WiFi adapter AC-1200 on Ubuntu 18.04
## Bus 002 Device 006: ID 0e8d:7612 MediaTek Inc.
## https://askubuntu.com/questions/1119004/usb-wifi-adapter-problem
## https://bbs.archlinux.org/viewtopic.php?id=250273
## http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=4&t=2830&view=next
## https://github.com/kaduke/Netgear-A6210
sudo apt install git dkms build-essential
git clone https://github.com/jeremyb31/mt7612u.git
@jniltinho
jniltinho / compile_hhvm.sh
Last active May 31, 2021
Compile HHVM on Debian 9.1 64Bits
View compile_hhvm.sh
#!/bin/bash
## Compile HHVM on Debian 9.1 64Bits
## https://docs.hhvm.com/hhvm/installation/building-from-source#debian-8-jessie
## Run as root (sudo su)
apt-get update && apt-get upgrade
apt-get install git-core cmake gawk default-libmysqlclient-dev \
View Ubuntu_Win_Active_Directory_Domain.sh
#!/bin/bash
## Integrar Ubuntu 16.04 32/64Bits no Windows Active Directory Domain – Fullest Integration
### Primeira Etapa ----------------------------------------------------------------------------
## Voce precisa mudar a linha abaixo
MY_DOMAIN="mydomain.local"
GET_ARCH=$(getconf LONG_BIT)
@jniltinho
jniltinho / install_setup_tidb.sh
Last active Apr 7, 2021
Install and Setup TiDB on Linux
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