Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Ramsey meramsey

View GitHub Profile
View GitHub spoiler markdown.md

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@meramsey
meramsey / README.md
Last active Oct 11, 2021
Add Copy Path to nautilus
View README.md

Add Copy Path to nautilus

Download the file then move it and make executable and restart nautilus to see the Copy Path icon

wget https://gist.githubusercontent.com/meramsey/f1d20da371de82e801df19c92a673e63/raw/2bb9cb9007f21e85b00aade70d5db21c41b44f44/nautilus-copy-paths.py
sudo mv nautilus-copy-paths.py /usr/share/nautilus-python/extensions/nautilus-copy-paths.py
sudo chmod +x /usr/share/nautilus-python/extensions/nautilus-copy-paths.py
nautilus -q
@meramsey
meramsey / fix-webcams.sh
Created Sep 28, 2021 — forked from shimon/fix-webcams.sh
Linux shell script to disable an internal webcam if an external one is attached, or enable the internal one if not.
View fix-webcams.sh
#!/bin/bash
# Quick script to disable an internal webcam if an external one is attached, or
# enable the internal one if the external one's not attached.
# by Shimon Rura, 25 Jan 2018. In the public domain.
# To use, run `lsusb` and identify the lines for your internal and external camera devices.
# For example, mine are:
# internal:
@meramsey
meramsey / tailslack.py
Created Sep 1, 2021
Python log file tailer with slack alerting capabilities.
View tailslack.py
#!/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
@meramsey
meramsey / slackbot.py
Created Aug 26, 2021
Slackbot or webhook posting from Python with requests
View slackbot.py
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 / access_log_attack_mitigator.py
Last active Sep 1, 2021
Automated Accesslog Alerts with optional Cloudflare API Firewall rules enabling
View access_log_attack_mitigator.py
#!/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 / README.md
Last active Aug 13, 2021
Aync Lookup a list of domains IP and ASN Description from a csv
View README.md
View git-auto-sign-commits.sh
# 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 / create-cloud-template.sh
Last active Sep 18, 2022 — 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.
View create-cloud-template.sh
#!/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
View Ubuntu_Debian_Cloud_images_in_Proxmox.md