Go language

# hello.go
package main

import "fmt"

func main() {
fmt.Println("Hello, World")
}

# run source
go run hello.go

# build
go build hello.go

Configure proxy

export http_proxy=http://10.203.0.1:5187/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

cat <> /etc/environment
export http_proxy="http://${PROXY_USER}:${PROXY_PASS}@192.168.0.222:8080"
export https_proxy="http://${PROXY_USER}:${PROXY_PASS}@192.168.0.222:8080"
export no_proxy="localhost,127.0.0.1,gitlab.unixsrv.everyware.zone"
EOF

cat < /etc/apt/apt.conf.d/12proxy
Acquire::http::Proxy "http://${PROXY_USER}:${PROXY_PASS}@192.168.0.222:8080";

LVM: remove PV from VG

#
# Create test LV
#
for i in {1..3}; do
    truncate -s 1G disk${i}.img
    losetup /dev/loop${i} disk${i}.img
    pvcreate /dev/loop${i}
done
 
pvs
 
vgcreate vg0 /dev/loop1 /dev/loop2 /dev/loop3
 
vgs
 
lvcreate -n lv0 -l 100%FREE vg0
 
lvs
 
mkfs.ext4 /dev/vg0/lv0
 
mount /dev/vg0/lv0 /mnt/
 
df -h /mnt/
 
for i in {1..15}; do
    dd if=/dev/urandom of=/mnt/file${i} bs=1M count=100
done
 
md5sum /mnt/file?

Grafana

Install from repository
curl https://packagecloud.io/gpg.key | sudo apt-key add -
echo "deb https://packagecloud.io/grafana/stable/debian/ stretch main" | tee /etc/apt/sources.list.d/grafana_stable.list
sudo apt-get update
sudo apt install -y grafana

Credentials
http://SERVER_IP:3000/

Docker container
docker run -i -p 3000:3000 -e "GF_SERVER_ROOT_URL=http://10.0.3.164" -e "GF_SECURITY_ADMIN_PASSWORD=admin" grafana/grafana
user: admin
pass: admin

Configure Graphite datasource
Name: Graphite
Type: Graphite

Install prometheus under Ubuntu

Install from repository
sudo apt-get install -y prometheus

sudo apt-get install -y prometheus-node-exporter
sudo apt-get install -y prometheus-alertmanager
sudo apt-get install -y prometheus-pushgateway

Login
http://SERVER_IP:9090/

Commands
avg_over_time(node_memory_MemAvailable[5m])/1024/1024

Ansible
https://github.com/cloudalchemy/ansible-prometheus

Docker
docker run --name prometheus -d -p 127.0.0.1:9090:9090 quay.io/prometheus/prometheus

Ports

Install Couch DB under Ubuntu

Installation
wget https://couchdb.apache.org/repo/bintray-pubkey.asc -qO - | sudo apt-key add -
echo "deb https://apache.bintray.com/couchdb-deb $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/couchdb.list
sudo apt update

debconf-set-selections <<\EOF
couchdb couchdb/adminpass string admin
couchdb couchdb/adminpass_again string admin
couchdb couchdb/mode select standalone
couchdb couchdb/bindaddress string 0.0.0.0
EOF

sudo apt-get install -y couchdb

Login
http://SERVER_IP:5984/_utils/
user: admin
pass: admin

Build Wildfly deb package

# http://wildfly.org/downloads/
# https://github.com/mattthias/wildfly-packaging

VERSION=13.0.0.Final
REVISION=1

sudo apt-get install -y devscripts

# Download the "source" (the binary "Java EE7 Full & Web Distribution")
# wget http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.tar.gz
# https://github.com/ilanddev/wildfly-debian/tree/master/debian

# download archive
mkdir /tmp/wildfly
wget http://download.jboss.org/wildfly/${VERSION}/wildfly-${VERSION}.tar.gz -q -O /tmp/wildfly/wildfly-${VERSION}.tar.gz

# create a link to archive
cd /tmp/wildfly

Syndicate content