Skip to content

Instantly share code, notes, and snippets.

View meramsey's full-sized avatar

Michael Ramsey meramsey

View GitHub Profile
@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
@daddycocoaman
daddycocoaman / cnameenum.py
Last active August 10, 2021 17:17
Async CNAME Enumeration (WIP)
import asyncio
import aiodns
import aiofiles
import aiohttp
from colorama import Fore
from dataclasses import field, dataclass
from pycares import ares_query_cname_result
from concurrent.futures import ThreadPoolExecutor
import sys
import re
@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
@shimon
shimon / fix-webcams.sh
Created January 25, 2018 22:54
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 / .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 / 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
@sumeetpareek
sumeetpareek / python_apache_logs.py
Created March 19, 2014 15:33
A very simple Apache access log parser in Python
#!/usr/bin/env python2
"""A very simple Apache access log parser in Python
usage help = http://i.imgur.com/XBiX2kX.png
when required arguments are missing = http://i.imgur.com/P5L0GZV.png
when incorrect file path is passed = http://i.imgur.com/sJDc0om.png
successful sample output = http://i.imgur.com/iH89mwI.png
@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 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