Skip to content

Instantly share code, notes, and snippets.

@voice1
voice1 / switchvox-clear-blocked-ips.py
Last active November 23, 2021 18:19
Switchvox clear all blocked IP's
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Clear blocked IP addresses in switchvox.
Requires pyswitchvox
Feel free to adjust logger if desired.
"""
from pyswitchvox.client import Client
@voice1
voice1 / poetry-import-requirements
Created September 28, 2021 18:52
Import pip requirements.txt to poetry
cat requirements.txt | perl -pe 's/([<=>]+)/:$1/' | xargs -t -n 1 -I {} poetry add '{}'
@voice1
voice1 / 2020-DeCrapify.ps1
Created March 10, 2021 20:44
CraftComputing - Decrapify Windows script
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.4, 2016-01-16
#
# Modifications and video from CraftComputing : https://www.youtube.com/watch?v=PdKMiFKGQuc&ab_channel=CraftComputing
#
##########
# Ask for elevated permissions if required
@voice1
voice1 / genpass.py
Last active July 31, 2020 04:20
Generate random password types of different complexity using pure python.
#!/usr/bin/env python3
"""
Simple function to create random generated password types.
See examples at the end of gist.
"""
import os, string, random
def genpass(digits=False, length=13, special_char_set='!@#$%',
repeat_chars=True,
require_special_char=True,
@voice1
voice1 / sendEmail.sh
Created May 3, 2019 02:12 — forked from Rhernandez513/sendEmail.sh
Simple script to send emails with mailgun api
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -o allexport
source .env
set +o allexport
@voice1
voice1 / kerio-connect-ssl.sh
Created March 6, 2019 21:21
Automated script for applying Let Encrypt certificates to Kerio Connect
#!/bin/bash
# This script is intended to automate the addition of let-encrypt certificates for Kerio Connect mail server
# It uses the powerful acme.sh script to generate the SSL Certificate, and apply it to the Kerio Connect installation
# Currently this works with Debian, because thats what I use, the process is simiular on other Linux OS's
# This script is provided as-is, but if you have improvements I am happy to incorporate them.
MAIL_DOMAIN_NAME=mail.example.com
ACME=/root/.acme.sh/acme.sh
@voice1
voice1 / xe-linux-distribution
Last active February 28, 2019 00:03
Updated xe-linux-distribution script to support detecting FreePBX in XenServer/XCP-ng hypervisors
#! /bin/sh
#;
#; Replaces /usr/sbin/xe-linux-distribution
#;
# Copyright (c) 2015, Citrix Systems
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@voice1
voice1 / slack-cleaner.sh
Created December 6, 2018 18:44
slack-cleaner wrapper to automate slack message clean up.
#!/bin/bash
#
# Automated cleanup of slack messages.
# Must have slack-cleaner already installed.
# Simply replace your SLACK_TOKEN string with your legacy webapi token.
# Set the number of days you wish to retain, and add this to a cron job to run at
# the desired interval.
SLACK_TOKEN=My-Slack-Legacy-WebToken
@voice1
voice1 / vyos-edgeos-backup.sh
Last active October 12, 2018 20:34
VyOS EdgeOS Automated backup and Change Notificaiton
#!/bin/bash
#
# Description:
# Demo of how to download EdgeOS configuration and check if a change exists.
# If a change exists send a notification to a Zabbix server.
#
# ****************************************************************************************
# This script is provided as a demo to show how to backup configurations automatically
# You should not consider this a production script. If you are interested in a production
# script please contact me @ support[at]voice1[dot]me or feel free to modify this to your
@voice1
voice1 / freepbx_peewee_schema.py
Last active September 1, 2018 00:01
FreePBX database schema for Peewee ORM
from peewee import *
database = MySQLDatabase('asterisk', **{'charset': 'utf8', 'use_unicode': True})
class UnknownField(object):
def __init__(self, *_, **__): pass
class BaseModel(Model):
class Meta:
database = database