Pulseaudio Equalizer switch

#!/bin/bash
 
# install
# https://raw.githubusercontent.com/panticz/installit/master/install.pulseaudio-equalizer.sh
 
if [ "$(pulseaudio-equalizer status | grep "Equalizer status" | cut -d"[" -f2 | cut -d"]" -f1)" == "enabled" ]; then
    pulseaudio-equalizer disable
else
    pulseaudio-equalizer enable
fi

iDRAC

<strong>Key mapping for console redirection</strong>
Use the <ESC><1> key sequence for <F1>
Use the <ESC><2> key sequence for <F2> (System Setup)
Use the <ESC><3> key sequence for <F3>
Use the <ESC><0> key sequence for <F10> (Lifecycle Controller)
Use the <ESC><!> key sequence for <F11> (Boot Manager)
Use the <ESC><@> key sequence for <F12> (PXE Boot)
 
<strong>Management</strong>
# install ipmitool package on client (OPTIONAL)
sudo apt-get install -y ipmitool
 
# connect over SOL (Serial over LAN)
ipmitool -I lanplus -H <IP> -U <USER> -P <PASS> sol activate
 
# power on
ipmitool

letsencrypt

# Ubuntu Xenial package
apt-get install lets-encrypt

apt-get install -y git
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
/opt/letsencrypt-auto --help all

# create configuration file
apt-get install cron --no-install-recommends

cat <> /etc/letsencrypt/cli.ini
domains = www.example.com,example.com
rsa-key-size = 4096
email = mal@example.com
text = true
authenticator = webroot
webroot-path = /var/www/html
EOF

# create cron
cat < /etc/cron.d/letsencrypt

Json / jq

# processing Icinga warning Json list
PASSWORD=terceS
URL="http://monitoring.example.com/cgi-bin/icinga/status.cgi?servicestatustypes=20&noheader=1&servicestatustypes=29&sorttype=2&sortoption=3&scroll=963&jsonoutput"

wget -q --user=${USER} --password=${PASSWORD} "${URL}" -O - | jq --raw-output ' .status.service_status

 | select(.host_name | contains("integration")) | select(.status_information | contains("Apache", "Java")) | .host_name'
 
 
jq 'select(.geo != null)' all.json
jq '[ .devices | select(.key | startswith("dimmer")) | .value = .value.state ] | from_entries' filename.json

Install SonarQube

wget https://raw.githubusercontent.com/panticz/installit/master/install.sonarqube.sh -O - | bash -

#!/bin/bash

# install Java
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/installit/master/install.java-jdk.sh -O - | bash -

# install SonarQube
echo "deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/" > /etc/apt/sources.list.d/sonar.list
sudo apt-get update
sudo apt-get install -y --force-yes sonar

# autostart SonarQube
sudo update-rc.d sonar defaults

WebGUI
http://172.29.14.185:9000/

Logfile
tail -f /opt/sonar/logs/sonar.log

Links
http://sonar-pkg.sourceforge.net/
http://docs.sonarqube.org/display/SONAR/Requirements
https://github.com/Godin/sonar-native-packages
https://gist.github.com/micheleorsi/bd20912b2489f3432558

Install SSH VPN server

export CONTAINER=vpn

# create container
# TODO: configure MAC on create container
wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/lxc/master/create.jessie.sh -O - | bash -s -- -f

# configure container MAC address
sed -i 's|lxc.network.hwaddr = .*|lxc.network.hwaddr = 00:11:22:33:44:5e|' /var/lib/lxc/${CONTAINER}/config

# enable autostart
echo "lxc.start.auto = 1" | tee -a /var/lib/lxc/${CONTAINER}/config

# configure container
##echo "lxc.hook.autodev=/var/lib/lxc/vpn/autodev" >> /var/lib/lxc/${CONTAINER}/config

Jenkins CLI

# command overview
http://jenkins.example.com:8080/cli/

# add public key for user
http://jenkins.example.com:8080/me/configure

# authentificate by user / pass
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ list-jobs --username --password

# install plugin by name
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ install-plugin findbugs

# install plugin from URL?
java -jar jenkins-cli.jar -s http://jenkins.example.com:8080/ install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi

LXC: create Ubuntu Trusty container

#!/bin/bash

 && CONTAINER=trusty
LANG=en_US.UTF-8
 
# force, remove previous container
if [ "$1" == "-f" ]; then
  [ $(sudo lxc-ls ${CONTAINER} | wc -l) -gt 0 ] && sudo lxc-destroy -f -n ${CONTAINER}
fi
 
# create container
sudo lxc-create -t ubuntu -n ${CONTAINER} -- template-options -r trusty
 
# workaround for "Failed to mount cgroup at /sys/fs/cgroup/systemd: Permission denied"
echo "lxc.aa_profile = unconfined" | sudo tee -a /var/lib/lxc/${CONTAINER}/config
 
# start container in background
sudo lxc-start -d -n ${CONTAINER}

Create UEFI disc

# create disc image
mkfs.msdos -C /tmp/uefi.iso 2880
sudo mount /tmp/uefi.iso /mnt
sudo cp /tmp/your_uefi_files/* /mnt/
sudo umount /mnt
 
# boot to UEFI shell
press F11 on boot
 
# go to UEFI filesystem
fs0:
 
# Links
https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Important_UEFI_Shell_Commands
Syndicate content