Skip to content

Instantly share code, notes, and snippets.

View xakrume's full-sized avatar
emerge -auDN @world

Ruslan Kh. xakrume

emerge -auDN @world
View GitHub Profile
@xakrume
xakrume / nginx-proxy-geoip
Created May 23, 2018 23:27 — forked from gjuric/nginx-proxy-geoip
nginx - pass GEOIP headers to proxy host
# http block
geoip_city /usr/local/share/GeoIP/GeoIPCity.dat;
geoip_country /usr/local/share/GeoIP/GeoIPCountry.dat;
# location block
proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;
proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;
proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;
@xakrume
xakrume / ansible-summary.md
Created October 12, 2017 12:00 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

#!/bin/bash -x
# based on: http://superuser.com/questions/386506/hosting-iscsi-on-smartos
GROUPNAME=iscsi-1
TARGETNAME=iqn.2010-08.org.illumos:02:$GROUPNAME
LOCAL_ADDRESS=192.168.1.2
svcadm enable stmf
svcadm enable -r svc:/network/iscsi/target:default
@xakrume
xakrume / grafana-dashboard-exporter
Created April 25, 2016 13:42 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
@xakrume
xakrume / nginx.conf
Created April 1, 2016 14:14 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Run Netatalk in a SmartOS zone

This guide is based on this blog post: http://blog.smartcore.net.au/blazingly-fast-afp-on-a-smartos-zone/.

Import image and create virtual machine

Find the latest image, in this case 4166f6d6-ea5f-11e4-addd-8351b159d9b6 (15.1.0), or 24648664-e50c-11e4-be23-0349d0a5f3cf (14.4.1) if you need Long Term Support (LTS).

# imgadm avail | grep base-64
PATH="$PATH:/usr/local/go/bin"
export GOBIN="$HOME/bin"
export PATH=$PATH:$HOME/bin
export GOPATH=/tmp
go get -u github.com/nsf/gocode
cd $GOPATH/src/github.com/nsf/gocode/vim/
./update.bash
# Install htop under SmartOS on Global Zone
#
pkgin -y in htop
mkdir /system/lxproc
mount -F lxproc lxproc /system/lxproc
echo "lxproc - /system/lxproc lxproc - yes -" >> /etc/vfstab
htop