Skip to content

Instantly share code, notes, and snippets.

@aursu
aursu / run-curl.sh
Created June 11, 2018 03:00
Connect to Cisco AnyConnect VPN
#!/bin/bash
loginscript=vpn-login
[ -f $loginscript ] && . $loginscript
VPNCOOKIE=$(curl -s -k "https://${VPNGATEWAY}/+webvpn+/index.html" \
-H 'Cookie: webvpnlogin=1' \
--data 'group_list=DefaultWEBVPNGroup' \
--data "username=${VPNLOGIN}" \
@aursu
aursu / gitlab.rb
Created June 11, 2018 03:40
GitLab: disable included monitoring
logrotate['enable'] = false
alertmanager['enable'] = false
prometheus_monitoring['enable'] = false
@aursu
aursu / vpn-ns.sh
Created June 11, 2018 09:38
Run Cisco AnyConnect VPN connection inside network namespace [DRAFT]
#!/bin/bash
cookie="$1"
vpnsettings=vpn-login
[ -f "$vpnsettings" ] && . $vpnsettings
# NOTE: works well with virbr0 from libvirtd
if [ ! -e /var/run/netns/vpn0 ]; then
@aursu
aursu / nginx.conf
Last active June 28, 2018 22:45
GitLab embedded nginx config
# root 10516 0.0 0.0 37940 3128 ? Ss Jun07 0:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
user gitlab-www gitlab-www;
worker_processes 8;
error_log stderr;
pid nginx.pid;
@aursu
aursu / gitlab-http.conf
Last active July 30, 2018 16:53
GitLab Omnibus distribution | Nginx nginx.conf: include /var/opt/gitlab/nginx/conf/gitlab-http.conf;
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
## GitLab
## Modified from https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl & https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab
##
## Lines starting with two hashes (##) are comments with information.
## Lines starting with one hash (#) are configuration parameters that can be uncommented.
##
@aursu
aursu / nginx-status.conf
Last active July 30, 2018 16:52
GitLab Omnibus distribution | Nginx nginx.conf: include /var/opt/gitlab/nginx/conf/nginx-status.conf;
server {
listen *:8060;
server_name localhost;
location /nginx_status {
stub_status on;
server_tokens off;
access_log off;
allow 127.0.0.1;
deny all;
}
@aursu
aursu / 00-proxy.conf
Last active July 30, 2018 16:51
GitLab Omnibus distribution | Nginx nginx.conf: include /etc/nginx/conf.d/00-proxy.conf
# http://nginx.org/en/docs/http/websocket.html
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
@aursu
aursu / 99-nginx-logging.conf
Last active July 30, 2018 16:50
GitLab Omnibus distribution | Nginx nginx.conf: include /etc/nginx/conf.d/99-nginx-logging.conf
log_format gitlab_access '$remote_addr - $remote_user [$time_local] "$request_method $filtered_request_uri $server_protocol" $status $body_bytes_sent "$filtered_http_referer" "$http_user_agent"';
log_format gitlab_mattermost_access '$remote_addr - $remote_user [$time_local] "$request_method $filtered_request_uri $server_protocol" $status $body_bytes_sent "$filtered_http_referer" "$http_user_agent"';
# Remove private_token from the request URI
# In: /foo?private_token=unfiltered&authenticity_token=unfiltered&rss_token=unfiltered&...
# Out: /foo?private_token=[FILTERED]&authenticity_token=unfiltered&rss_token=unfiltered&...
map $request_uri $temp_request_uri_1 {
default $request_uri;
~(?i)^(?<start>.*)(?<temp>[\?&]private[\-_]token)=[^&]*(?<rest>.*)$ "$start$temp=[FILTERED]$rest";
@aursu
aursu / docker-registry.note.txt
Last active July 9, 2018 22:32
Docker registry docs
https://docs.docker.com/registry/
https://docs.docker.com/registry/introduction/
https://docs.docker.com/registry/deploying/
GitHub:
https://github.com/docker/distribution
@aursu
aursu / circleci.note.md
Last active July 12, 2018 09:48
CircleCI documentation URLs

#circleci

A run is comprised of one or more named jobs. Jobs are specified in the jobs map. The name of the job is the key in the map, and the value is a map describing the job.

If you are using Workflows, jobs must have a name that is unique within the .circleci/config.yml file.