A script to fix EDID problems on external monitors in Mac OS.
-
Connect the problem monitor.
-
Download this script into your
/System/Library/Displays/Overrides
(note: this file is only writeable by root, so some commands requiresudo
).
function adb_toggle_airplane_mode { | |
# Open airplane mode settings | |
adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS | |
# Key UP to focus on the first switch = toggle airplane mode, then sleep 100ms | |
adb shell input keyevent 19 ; sleep 0.1 | |
# Key CENTER to toggle the first switch, then sleep 100ms | |
adb shell input keyevent 23 ; sleep 0.1 |
#!/bin/bash | |
# Easy script to create OpenVPN client configuration with the user, pre-generating user's | |
# RSA key and certificate. | |
# | |
# Configuration template must exist in the same directory, with only missing part: certificates. | |
# | |
# (c) Dmytro Kovalov, 2015 | |
# | |
cd $(dirname ${BASH_SOURCE[0]}) |
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |
Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.
nginx -V
for the following:
...
TLS SNI support enabled
sshuttle: | |
pkg.installed: [] | |
group.present: | |
- gid: 2024 | |
user.present: | |
- fullname: sshuttle | |
- uid: 2024 | |
- gid: 2024 | |
- allow_uid_change: True |
A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.
This is specific to k8s and containers that have CPU limits set.
To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:
sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just