commit 8fa81f0231b3c94877911b14bb3fabbdf11624e7 Author: Adam Goldsmith Date: Mon Nov 11 14:22:13 2019 -0500 Initial Commit diff --git a/_runners/cms_net.py b/_runners/cms_net.py new file mode 100644 index 0000000..01bc01a --- /dev/null +++ b/_runners/cms_net.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +''' +Network tools to run from the Master, specific to the Claremont MakerSpace +''' + +import logging +import socket + +log = logging.getLogger(__name__) + +def wolmatch(tgt, destport=9): + ''' + Send a "Magic Packet" to wake up Minions that are matched in the + grains cache, automatically determining the destination broadcast address + + CLI Example: + + .. code-block:: bash + + salt-run network.wolmatch minion_id + + ''' + ret = [] + minions = __salt__['cache.grains'](tgt, 'compound') + for name, minion in minions.items(): + if 'hwaddr_interfaces' not in minion: + continue + # NOTE: FIVE, NINE, and TEN all should have eth addr as well, why is there only one printed? + for iface, mac in minion['hwaddr_interfaces'].items(): + if iface == 'lo': + continue + mac = mac.strip() + #print(name, iface, mac, minion['ip_interfaces']) + if 'ip4_interfaces' in minion and iface in minion['ip_interfaces']: + ip_addrs = minion['ip4_interfaces'][iface] + for ip_addr in ip_addrs: + [subnet, _, _] = ip_addr.rpartition('.') + bcast = subnet + '.255' + __salt__['network.wol'](mac, bcast, destport) + log.info('Waking up %s', mac) + ret.append(f"{name}: {ip_addrs} {mac}") + return ret diff --git a/bad_shortcuts.yaml b/bad_shortcuts.yaml new file mode 100644 index 0000000..5fad833 --- /dev/null +++ b/bad_shortcuts.yaml @@ -0,0 +1,16 @@ +- Browse VCarve Pro - ShopBot Edition V9.0 Tutorials.lnk +- Corel CAPTURE 2017 (64-Bit).lnk +- Corel CONNECT 2017 (64-Bit).lnk +- Corel Font Manager 2017 (64-Bit).lnk +- Corel PHOTO-PAINT 2017 (64-Bit).lnk +- Dell Backup and Recovery.lnk +- Dell Precision Optimizer.lnk +- Intel(R) HD Graphics Control Panel.lnk +- Intel(R) WiDi.lnk +- Protected Workspace.lnk +- Shop for HP Supplies.lnk +- Style Builder 2017.lnk +- LayOut 2017.lnk +- gVim 8.1.lnk +- gVim Easy 8.1.lnk +- gVim Read only 8.1.lnk diff --git a/corelDRAW.sls b/corelDRAW.sls new file mode 100644 index 0000000..ca8b808 --- /dev/null +++ b/corelDRAW.sls @@ -0,0 +1,6 @@ +# Apply the crack to CorelDRAW +# Note: We do own a key and this is a registered copy, but like this +# we can disable the annoying login prompt for every user +"C:\\Program Files\\Corel\\PASMUtility\v1\PASMUTILITY.dll": + file.managed: + - source: "\\\\ucs\\Software\\PASMUTILITY.dll" diff --git a/packages.yaml b/packages.yaml new file mode 100644 index 0000000..59f3ab4 --- /dev/null +++ b/packages.yaml @@ -0,0 +1,31 @@ +# Browsers +- firefox +- googlechrome + +# Development Tools +- arduino +- git +- javaruntime +- notepadplusplus +- python +- vim +- vscode + +# Graphics +- gimp +- inkscape + +# 3D Modeling +- autodesk-fusion360 +- blender +- cura-lulzbot +- openscad +- sketchup + +- kicad + +# Office +- 7zip +- adobereader +- libreoffice-fresh +- vlc diff --git a/removeShortcuts.sls b/removeShortcuts.sls new file mode 100644 index 0000000..9cca09b --- /dev/null +++ b/removeShortcuts.sls @@ -0,0 +1,6 @@ +{% import_yaml "bad_shortcuts.yaml" as bad_shortcuts %} +{% for shortcut in bad_shortcuts %} +Remove {{ shortcut }}: + file.absent: + - name: "C:\\Users\\Public\\Desktop\\{{ shortcut }}" +{% endfor %} diff --git a/rsat.sls b/rsat.sls new file mode 100644 index 0000000..a7d2500 --- /dev/null +++ b/rsat.sls @@ -0,0 +1,18 @@ +rsat: + chocolatey.upgraded: + - name: rsat + +RemoteServerAdministrationTools: + dism.feature_installed: + - require: + - rsat + +RemoteServerAdministrationTools-Features: + dism.feature_installed: + - require: + - RemoteServerAdministrationTools + +RemoteServerAdministrationTools-Features-GP: + dism.feature_installed: + - require: + - RemoteServerAdministrationTools-Features diff --git a/top.sls b/top.sls new file mode 100644 index 0000000..5dbdb76 --- /dev/null +++ b/top.sls @@ -0,0 +1,8 @@ +base: + '*': + - windowsWorkstation + - removeShortcuts + # 'TSMS-TWO-DTPC': + # - winHiDPI + 'TSMS-FABLAB1-PC*': + - corelDRAW diff --git a/winHiDPI.sls b/winHiDPI.sls new file mode 100644 index 0000000..128d8b8 --- /dev/null +++ b/winHiDPI.sls @@ -0,0 +1,6 @@ +HKEY_USERS\.DEFAULT\Control Panel\Desktop: + reg.present: + - vname: LogPixels + - vdata: 144 + - vtype: REG_DWORD + diff --git a/windowsWorkstation.sls b/windowsWorkstation.sls new file mode 100644 index 0000000..399d236 --- /dev/null +++ b/windowsWorkstation.sls @@ -0,0 +1,30 @@ +chocolateyBootstrap: + module.run: + - name: chocolatey.bootstrap + +{% import_yaml "packages.yaml" as packages %} +{% for pkg in packages %} +{{ pkg }}: + chocolatey.upgraded: + - name: {{ pkg }} + - require: + - chocolateyBootstrap +{% endfor %} + +autodesk-meshmixer: + chocolatey.installed: + - name: autodesk-meshmixer + - source: \\ucs\software\nupkg + - require: + - chocolateyBootstrap + +# windowsUpdates: +# wua.uptodate: +# - drivers: true + +# 'gpupdate /force': +# cmd.run + +setTimezone: + timezone.system: + - name: America/New_York