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
# hello.go
package main
import "fmt"
func main() {
fmt.Println("Hello, World")
}
# run source
go run hello.go
# build
go build hello.go
Install
sudo apt install -y curl python-pip qemu-utils
pip install diskimage-builder
# packages
dib/elements/my_pkg/package-installs.yaml
...
vlan:
wget:
linux-image-generic:
uninstall: True
Elements
https://docs.openstack.org/diskimage-builder/latest/elements.html
Documentation
https://docs.openstack.org/diskimage-builder/latest/elements/package-installs/README.html
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,foo.example.com"
EOF
cat < /etc/apt/apt.conf.d/12proxy
Acquire::http::Proxy "http://${PROXY_USER}:${PROXY_PASS}@192.168.0.222:8080";
Install
https://flight-manual.atom.io/getting-started/sections/installing-atom/
Add-ons
ls -l ~/.atom/packages/
apm install atom-beautify
Alternatives
https://code.visualstudio.com/
Links
http://atom-packages.directory/category/tools-beautify/
#
# 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?
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 from repository
sudo apt-get install -y prometheus
# optional
sudo apt-get install -y prometheus-node-exporter
sudo apt-get install -y prometheus-alertmanager
sudo apt-get install -y prometheus-pushgateway
Ansible installation
https://github.com/panticz/ansible/tree/master/roles/prometheus
- hosts: localhost
roles:
- prometheus
Login
http://SERVER_IP:9090/
Commands
avg_over_time(node_memory_MemAvailable[5m])/1024/1024
Repositroy
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
# 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
# install autofs package
apt-get install -y autofs
# create required directories
mkdir /etc/auto.master.d
# Configure NFS mount nas.example.com:/volume1/backup to /media/backup
echo "/media /etc/auto.media" >> /etc/auto.master.d/media.autofs
echo "backup -fstype=nfs,rw,async,vers=3 nas.example.com:/volume1/backup" >> /etc/auto.media
# check (directory will by created on access)
ll /media/backup
# debug
service autofs stop
sudo automount -f -v
Ansible playbook
https://github.com/panticz/ansible/blob/master/autofs-test.yml