Skip to content

Instantly share code, notes, and snippets.

View vazhnov's full-sized avatar

Alexey Vazhnov vazhnov

View GitHub Profile
@vazhnov
vazhnov / zabbix3_pgsql_install_1604_xenial.sh
Last active July 5, 2018 07:45
Quick install Zabbix 3.0 in Ubuntu 16.04 xenial with PostgreSQL
# License: CC0 1.0 or newer
# https://creativecommons.org/publicdomain/zero/1.0/
# You can download this script here: https://gist.github.com/vazhnov/fcb487e6ea432fec056793ef710b5a28
wget "http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+xenial_all.deb"
sudo dpkg -i zabbix-release_3.0-1+xenial_all.deb
sudo apt-get update
sudo apt-get install zabbix-server-pgsql zabbix-frontend-php libapache2-mod-php php-bcmath php-mbstring php7.0-xml php-pgsql
# Zabbix can't work without password (with ident), so you need to create user with password:
@jfriv
jfriv / prod-rds-snap-restore-to-dev-temp.sh
Created August 16, 2016 20:03
RDS manual snapshot and restore script
#!/bin/bash
# set up some variables
NOW_DATE=$(date '+%Y-%m-%d-%H-%M')
RESTORE_FROM_INSTANCE_ID=<source name>
TARGET_INSTANCE_ID=<target name>
TARGET_INSTANCE_CLASS=db.m4.large
VPC_ID=<vpc subnet id>
NEW_MASTER_PASS=<root password>
@jirutka
jirutka / ldap.conf
Last active July 17, 2024 10:40
Simple script for OpenSSH server to load authorization keys from LDAP. It requires just POSIX shell and ldapsearch utility. To manage keys in LDAP, use https://github.com/jirutka/ssh-ldap-pubkey.
# /etc/ssh/ldap.conf
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE ou=People,dc=example,dc=org
URI ldap://localhost
@mambroziak
mambroziak / awsEc2MetadataShortcuts.sh
Last active November 1, 2023 22:34
AWS EC2 Instance Metadata to BASH Script Variables
#!/bin/bash
# JQ is required to more easily parse json.
AWS_IAM_ROLE=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/`
AWS_ACCESS_KEY_ID=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.AccessKeyId'`
AWS_SECRET_ACCESS_KEY=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.SecretAccessKey'`
AWS_TOKEN=`curl -sL http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE/ | jq -r '.Token'`
AWS_AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
AWS_DEFAULT_REGION="`echo \"$AWS_AZ\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
LOCAL_IP=`curl -sL http://169.254.169.254/latest/meta-data/local-ipv4`
PUBLIC_IP=`curl -sL http://169.254.169.254/latest/meta-data/public-ipv4`
@danhilltech
danhilltech / acericoniaubuntu
Created June 26, 2011 16:47
Ubuntu on Acer Iconia W500
#By www.danhilltech.com
#package manager get fastest server + partners
sudo apt-get update
sudo apt-get install aptitude openssh-server
#switch to ssh
sudo sh -c 'echo "dan ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'