Skip to content

Instantly share code, notes, and snippets.

View aaam's full-sized avatar

Alex aaam

  • United Kingdom
  • 04:00 (UTC)
View GitHub Profile
@aaam
aaam / nginx.conf
Created February 4, 2022 15:19 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which

Patrick

Collection of helper tools for working with SB apps

Installation

composer --global config repositories.patrick vcs https://github.com/SentryBayLtd/patrick
composer global require sentrybayltd/patrick
@aaam
aaam / nvidia-gpu-sensor.pl
Created July 15, 2020 06:58 — forked from hacker1024/nvidia-gpu-sensor.pl
KDE KSysGuard NVIDIA GPU temperature/memory/utilization sensor, based on @frantic1048's script, but with units and total memory detection.
#!/usr/bin/perl -w
# act as a KSysGuard sensor
# provides NVIDIA GPU info via `nvidia-settings`
# Usage (e.g. add gpu temperature sensor)
# 1. save this file, make sure it has a exec permission
# 2. in KSysGuard's menu, open `File` -> `Monitor Remote Machine`
# 3.1 in new dialog, type `Host` whatever you want
# 3.2 set `Connection Type` to `Custom command`
openssl x509 -noout -text -in /etc/kubernetes/pki/etcd/server.crt |grep Validity -A2
kubeadm alpha certs check-expiration
@aaam
aaam / ansible_variable_precedence.md
Created June 6, 2020 09:07 — forked from ekreutz/ansible_variable_precedence.md
Ansible variable precedence (order, hierarchy)
@aaam
aaam / ansible_variable_precedence.md
Created June 6, 2020 09:07 — forked from ekreutz/ansible_variable_precedence.md
Ansible variable precedence (order, hierarchy)
kubectl -n kube-system describe secret `kubectl -n kube-system get secret|grep replicaset|cut -d\ -f1`|awk '/^token/{print $NF}'
- name: remove and recreate directory
file:
state: "{{ item }}"
path: "/path/to/directory/"
# owner: 1000 set owner, group, and mode if necessary
# group: 1000
mode: '0777' # make it full read and writeable
with_items:
- absent
- directory
@aaam
aaam / installdmg.inst
Created March 21, 2017 12:21
Install dmg pkg in OSX
hdiutil mount XQartz.dmg
#sudo cp -R "/Volumes/XQartz-X11/XQartz-X11.app" /Applications
sudo installer -package /Volumes/XQartz-X11/XQuartz-X11.pkg -target "/Volumes/Macintosh HD"
cd ~
hdiutil unmount "/Volumes/XQartz-X11"
@aaam
aaam / monitorwarmer.sh
Created February 14, 2017 00:16
Warm up monitors
for j in `seq 45`;do for i in `seq 40 1 47`;do echo -e "\e[${i}m\e[2J\e[1;1H";sleep 5;done;echo -e "\e[0m \e[2J";done