Skip to content

Instantly share code, notes, and snippets.

View meramsey's full-sized avatar

Michael Ramsey meramsey

View GitHub Profile
@meramsey
meramsey / gist:b9c98032a34612a1a29f9fd2059156a5
Created February 4, 2023 01:07 — forked from lavalake/gist:d83a5bc14284161433019475013996d1
Android activity manager "am" command help
adb shell am
Activity manager (activity) commands:
help
Print this help text.
start-activity [-D] [-N] [-W] [-P <FILE>] [--start-profiler <FILE>]
[--sampling INTERVAL] [--streaming] [-R COUNT] [-S]
[--track-allocation] [--user <USER_ID> | current] <INTENT>
Start an Activity. Options are:
-D: enable debugging
-N: enable native debugging
@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

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 January 22, 2022 22:18 — forked from benediktg/readme.md
Send mails from systemd services

Usage

based on https://wiki.archlinux.org/index.php/Systemd/Timers#MAILTO

  • Move systemd-email.sh to /usr/local/bin/systemd-email
  • Move status-email-alerts@.service to /etc/systemd/system/
  • Put OnFailure=OnFailure=status-email-alerts@%n.service into the [Unit] section of a service

Create file /usr/local/bin/systemd-email

@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
@meramsey
meramsey / README.md
Last active October 11, 2021 20:31
Add Copy Path to nautilus

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 / .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 / fix-webcams.sh
Created September 28, 2021 13:25 — 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.
#!/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 / download_monero_binaries.sh
Created June 26, 2021 16:20 — forked from sethforprivacy/download_monero_binaries.sh
Bash script that downloads and verifies the latest Linux x64/x86 binaries.
#!/bin/bash
# Download binaryfate's GPG key
wget -q -O binaryfate.asc https://raw.githubusercontent.com/monero-project/monero/master/utils/gpg_keys/binaryfate.asc
# Verify binaryfate's GPG key
echo "1. Verify binaryfate's GPG key: "
gpg --keyid-format long --with-fingerprint binaryfate.asc
# Prompt user to confirm the key matches that posted on https://src.getmonero.org/resources/user-guides/verification-allos-advanced.html
echo
@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