Skip to content

Instantly share code, notes, and snippets.

View meramsey's full-sized avatar

Michael Ramsey meramsey

View GitHub Profile
@meramsey
meramsey / build-installer.py
Created July 24, 2021 14:37 — forked from mnesarco/build-installer.py
AppImage Auto Installer Builder
#!/usr/bin/python3
#
# Copyright 2020 Frank David Martinez M. (mnesarco at github)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@meramsey
meramsey / .xonshrc
Created July 24, 2021 16:17
Xonsh Shell Customizations
# Save to ~/.xonshrc
# XONSH WIZARD START
# source-bash "echo loading xonsh foreign shell"
# XONSH WIZARD END
# Uncomment the below if running from appimage and need python/pip on your path from AppImage
# $PATH = [f'{$APPDIR}/usr/bin'] + $PATH
# Setup vox autovox to auto activate for .venv folders
# https://xon.sh/python_virtual_environments.html#automatically-switching-environments
@meramsey
meramsey / .php-cs-fixer.php
Last active September 30, 2021 13:33
CS-Fixer setup
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('libs')
->exclude('utils')
->name('*.phtml')
->in(__DIR__)
//->append([
//__DIR__.'/dev-tools/doc.php',
// __DIR__.'/php-cs-fixer', disabled, as we want to be able to run bootstrap file even on lower PHP version, to show nice message
@meramsey
meramsey / create-cloud-template.sh
Last active February 21, 2024 22:19 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@meramsey
meramsey / git-auto-sign-commits.sh
Created August 10, 2021 14:36 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@meramsey
meramsey / README.md
Last active August 13, 2021 12:55
Aync Lookup a list of domains IP and ASN Description from a csv
@meramsey
meramsey / access_log_attack_mitigator.py
Last active September 1, 2021 12:41
Automated Accesslog Alerts with optional Cloudflare API Firewall rules enabling
#!/usr/bin/python3
import sys
import time
import os
import platform
import re
import urllib.request
from datetime import date, timedelta
from datetime import datetime
import collections
@meramsey
meramsey / slackbot.py
Created August 26, 2021 15:28
Slackbot or webhook posting from Python with requests
import os
import re
import configparser
import requests
import json
import urllib.request
# https://keestalkstech.com/2019/10/simple-python-code-to-send-message-to-slack-channel-without-packages/
@meramsey
meramsey / tailslack.py
Created September 1, 2021 02:22
Python log file tailer with slack alerting capabilities.
#!/usr/bin/python3
import sys
import time
from datetime import date, timedelta
from datetime import datetime
import os
import re
import urllib.request
import requests
import json