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 / 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 / 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
@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 / 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
Last active July 20, 2021 21:13 — forked from eugenesvk/starship_left.toml
Starship prompt Left+Right and config for xonsh shell
# Save to ~/.xonshrc
# https://github.com/anki-code/xontrib-prompt-starship
# Below is example to put in xonsh config ~/.xonshrc for xontrib-prompt-starship
#$STARSHIP_CONFIG = "~/.config/starship_xonsh.toml"
$XONTRIB_PROMPT_STARSHIP_LEFT_CONFIG = "~/.config/starship_xonsh_left.toml"
#$XONTRIB_PROMPT_STARSHIP_RIGHT_CONFIG = "~/.config/starship_xonsh_right.toml"
#$XONTRIB_PROMPT_STARSHIP_BOTTOM_CONFIG = "~/.config/starship_xonsh_bottom.toml"
xontrib load prompt_starship
@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