Skip to content

Instantly share code, notes, and snippets.

View meramsey's full-sized avatar

Michael Ramsey meramsey

View GitHub Profile
@meramsey
meramsey / vzdump-hook-script.pl
Last active June 22, 2021 00:06
Perl script that uploads backup files to cloud storage using rclone, removes backups older then 1 week.
#!/usr/bin/perl -w
# example hook script for vzdump (--script option)
use strict;
print "HOOK: " . join (' ', @ARGV) . "\n";
my $phase = shift;
#!/usr/bin/perl
# This file was written as an executable to be used in the auto report function
# of csf and lfd. By replacing $YOUR_API_KEY below with your abuseipdb api key,
# allows you to use this code to integrate your csf system with abuseipdb.com
use strict;
use warnings;
use HTTP::Tiny;
use JSON;
# Gather the information from the commandline passed by lfd
@meramsey
meramsey / abuseabuseipdb_report.php
Last active May 30, 2020 10:54 — forked from niraj-shah/lfd.php
Report LFD to abuseabuseipdb
#!/usr/bin/env php
<?php
// get command line arguments
$args = $argv;
// AbuseIPDB API Key
$api_key = 'YOUR_API_KEY';
// your AbuseIPDB User ID
import os
from cStringIO import StringIO
try:
import xml.etree.cElementTree as Xml
except ImportError:
import xml.etree.ElementTree as Xml
from PySide import QtGui # noqa
from PySide.QtCore import QFile
from PySide.QtUiTools import QUiLoader
@meramsey
meramsey / windowPositions.py
Last active June 12, 2020 22:20 — forked from dgovil/windowPositions.py
Saving Window Positions in PyQt or PySide
# First lets import the two modules we'll need from Qt
from Qt import QtWidgets, QtCore
# Then we create our Window class, in this case from a QDialog
class MyWindow(QtWidgets.QDialog):
def __init__(self):
# We use the __init__ method to initialize it
# The super function gets the class we are inheriting from (in this case QDialog) and calls its' __init__ as well
@meramsey
meramsey / dbus_demo.py
Created April 5, 2021 13:07 — forked from codito/dbus_demo.py
QtDBus demo with PyQt5
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5 import QtCore, QtDBus, QtWidgets
def notify(header, msg):
item = "org.freedesktop.Notifications"
path = "/org/freedesktop/Notifications"
interface = "org.freedesktop.Notifications"
@meramsey
meramsey / readme.md
Last active January 22, 2022 22:18 — forked from benediktg/readme.md
Send mails from systemd services
@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 / .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 / 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
#