Skip to content

Instantly share code, notes, and snippets.

body = """--{boundary}
Content-Type: application/json; charset=UTF-8
Content Disposition: attachment; name="metadata"
{{"message": "{message}"}}
--{boundary}
Content-Type: img/png
Content-Disposition: attachment; name="file"; filename="grafana.png"
Content-Transfer-Encoding: base64
{image}
  • exim4
  • icinga2
  • icingaweb2
  • lightdm-webkit-greeter
  • krb5-kdc
  • libpam-krb5
  • shutter
  • krb5-admin-server
  • libpam-ldapd
  • icinga2-ido-mysql
import fileinput
class bcolors:
FAIL = '\033[5;31m'
ENDC = '\033[0m'
BOLD = '\033[1m'
computers = []
current = (None, [])
for line in fileinput.input():
cat who.out | gawk 'function repeat(str,n,rep,i){for( ; i<n; i++){rep = rep str}; return rep} BEGIN {RS = "" ; FS = "\n"} {split($1, a, " | "); cname = a[1]; d[NR] = cname; for (i = 2; i <= NF; i++) {split($i, b, " "); c[cname][b[1]]++}} END {asort(d);maxC = 0; maxU = 0; for (cname in c) { if (length(cname) > maxC){maxC = length(cname);} for (user in c[cname]){if (length(user) > maxU){maxU = length(user)}}}; maxU += 3; maxC +=3; print repeat("-", maxC) "|" repeat("-", maxU); for(ci in d){cname = d[ci]; users = ""; current = 1; for (user in c[cname]){if(user != "cv"){users = users user; if(current < length(c[cname])){ users = users "\n" repeat(" ", maxC) "|" }}}; print cname repeat(" ", maxC-length(cname)) "|" users; print repeat("-", maxC) "|" repeat("-", maxU)}}' | less
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
eapol_version=1
ap_scan=1
fast_reauth=1
update_config=1
network={
ssid="CometNet"
key_mgmt=WPA-EAP
eap=PEAP
@dinoocch
dinoocch / cv_resolution.sh
Created July 23, 2015 01:34
Shell Script to set resolution and arrange monitors.
#!/bin/bash
connectedOutputs=$(xrandr | grep " connected" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/")
execute="xrandr "
previous=""
for display in $connectedOutputs
do