This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <selinux/selinux.h> | |
int main(void) { | |
int enforce; | |
int rc = selinux_getenforcemode(&enforce); | |
std::cout << rc << std::endl; | |
std::cout << enforce << std::endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
zo.name1 as zone, | |
GROUP_CONCAT(zco.name1 ORDER BY zco.name1 ASC SEPARATOR ',') as children | |
FROM icinga_zones z | |
INNER JOIN icinga_objects zo ON zo.object_id = z.zone_object_id | |
LEFT JOIN icinga_zones zc ON zc.parent_zone_object_id = z.zone_object_id | |
LEFT JOIN icinga_objects zco ON zco.object_id = zc.zone_object_id | |
WHERE | |
z.is_global = 0 | |
AND zo.is_active = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: '2' | |
services: | |
web: | |
image: lazyfrosch/icingaweb2 | |
ports: | |
- 8081:80 | |
depends_on: | |
- db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Command": { | |
"cluster_services": { | |
"arguments": { | |
"output": { | |
"skip_key": true, | |
"value": { | |
"type": "Function", | |
"body": "var count_ok = 0\r\nvar count_warning = 0\r\nvar count_critical = 0\r\nvar count_unknown = 0\r\nvar outputs = []\r\n\r\nvar hosts = macro(\"$cluster_hosts$\")\r\nvar service = macro(\"$cluster_service$\")\r\nvar label = macro(\"$cluster_label$\")\r\nvar icingaweb = macro(\"$icingaweb_baseurl$\")\r\nif (!icingaweb) {\r\n icingaweb = \"\/icingaweb2\"\r\n}\r\n\r\nfor (var host in hosts) {\r\n var s = get_service(host, service)\r\n var link = \"<a class=\\\"action-link\\\" href=\\\"\" + icingaweb + \"\/monitoring\/service\/show?host=\" + host + \"&service=\" + service +\"\\\">\" + host + \"<\/a>\"\r\n var line = \"[\" + link + \"] \"\r\n if (s) {\r\n if (s.state == 0) {\r\n count_ok += 1\r\n line += \"[OK] \"\r\n } else if (s.state == 1) {\r\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
file="$(readlink -f "$0")" | |
root=/usr/share/acmeapp | |
exec patch -N -r /dev/null -p1 -d "$root" -i "$file" "$@" | |
PATCH/DIFF CONTENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Test | |
hosts: localhost | |
tasks: | |
- name: Manage SSH keys | |
authorized_key: | |
user: admin | |
exclusive: yes | |
key: | | |
{% for file in lookup("fileglob", "sshkeys/*.pub").split(",") -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
plugin_dir=${0%/*} | |
vip="$1" | |
shift | |
command="$1" | |
shift | |
if [ ! "$vip_exists" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
SOURCE=/data | |
cd "$HOME/mailcow-dockerized" | |
source mailcow.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo cat /var/lib/icinga2/icinga2.state | ./icinga2-debug-state.py | |
[ | |
{ | |
"name": "api", | |
"type": "ApiListener", | |
"update": { | |
"log_message_timestamp": 1522659331.677504, | |
"type": "ApiListener", | |
"version": 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
touchpadString="DLL075B:01 06CB:76AF Touchpad" | |
touchpadEnabled=$(xinput list-props "$touchpadString" | grep "Device Enabled" | awk -F ":" '{print $2}') | |
if [ "$touchpadEnabled" -eq 1 ]; then # Enabled now? | |
xinput --set-prop "$touchpadString" "Device Enabled" 0 | |
notify-send -t 1200 -i input-touchpad "Touchpad disabled" | |
# Yes, so disable it | |
else # Must be disabled, so... | |
xinput --set-prop "$touchpadString" "Device Enabled" 1 |