Skip to content

Instantly share code, notes, and snippets.

@guruevi
guruevi / dnstest.py
Last active August 29, 2015 14:14 — forked from 0x9900/dnstest.py
View dnstest.py
#!/usr/bin/env python
#
import dns.resolver
import time
import sys
from collections import defaultdict
services = {
#'local': ['192.168.1.1'],
@guruevi
guruevi / 99-checkwifi
Created September 22, 2016 17:27
Reboot if network connection is down
View 99-checkwifi
#!/bin/sh
#put in /etc/cron.daily
ping -c4 8.8.8.8 > /dev/null
if [ $? != 0 ]
then
sudo /sbin/shutdown -r now
fi
@guruevi
guruevi / create_user.sh
Created January 29, 2017 04:25
Create a User in UCS with RFC2307 (Unix Extensions in Samba) enabled
View create_user.sh
#!/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"
@guruevi
guruevi / ldif-to-csv.sh
Created February 6, 2020 15:30 — forked from dansimau/ldif-to-csv.sh
Shell script that reads LDIF data from STDIN and outputs as CSV.
View ldif-to-csv.sh
#!/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
@guruevi
guruevi / remoteCP.bat
Created March 6, 2020 06:11
A quick and dirty method of remotely admin-ing a Windows CrashPlan Pro instance.
View remoteCP.bat
@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
@guruevi
guruevi / setup_psrp.yml
Last active February 17, 2024 16:44
This is a quick Ansible script to setup a machine remotely for PSRP with Ansible using PsExec, then switching to PSRP native
View setup_psrp.yml
- 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 }}'