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
#!/usr/bin/env python | |
# | |
import dns.resolver | |
import time | |
import sys | |
from collections import defaultdict | |
services = { | |
#'local': ['192.168.1.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
#!/bin/sh | |
#put in /etc/cron.daily | |
ping -c4 8.8.8.8 > /dev/null | |
if [ $? != 0 ] | |
then | |
sudo /sbin/shutdown -r now | |
fi |
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 | |
# Collect information | |
echo "Enter first name" | |
read firstname | |
echo "Enter last name" | |
read lastname | |
echo "Enter username" | |
read username | |
gidnumber="" | |
domain="dc=my,dc=domain,dc=com" |
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 | |
# | |
# Converts LDIF data to CSV. | |
# Doesn't handle comments very well. Use -LLL with ldapsearch to remove them. | |
# | |
# 2010-03-07 | |
# dsimmons@squiz.co.uk | |
# | |
# Show usage if we don't have the right params |
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
@echo off | |
echo Enter the computer name or IP you want to connect to | |
set /P name="Hostname: " | |
rem Making a backup | |
copy C:\ProgramData\CrashPlan\.identity C:\ProgramData\CrashPlan\.identity-CPProxy | |
copy C:\ProgramData\CrashPlan\.ui_info C:\ProgramData\CrashPlan\.ui_info-CPProxy | |
copy C:\ProgramData\CrashPlan\service.pem C:\ProgramData\CrashPlan\service.pem-CPProxy | |
rem Copying the necessary files |
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: Setup Windows machine with Ansible | |
hosts: all | |
gather_facts: false | |
pre_tasks: | |
- name: Setup WinRM, PSRP | |
community.windows.psexec: | |
hostname: '{{ hostvars[inventory_hostname]["ansible_host"] | default(inventory_hostname) }}' | |
connection_username: '{{ ansible_user }}' | |
connection_password: '{{ ansible_password }}' |
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
#!/usr/bin/env python3 | |
import os | |
import re | |
import sys | |
def get_available_gpu(vgpu_type): | |
# In /sys/bus/pci/devices/ directory find the next NVIDIA vGPU device | |
# and return the path to it | |
for device in os.listdir('/sys/bus/pci/devices/'): |