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

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 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 / 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 / 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 / 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 / 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 / README.md
Last active August 13, 2021 12:55
Aync Lookup a list of domains IP and ASN Description from a csv
@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 / 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