Skip to content

Instantly share code, notes, and snippets.

@DeveloperMos
DeveloperMos / Readme.md
Created June 17, 2024 09:09 — forked from paskal/Readme.md
How to set up the Percona Monitoring and Management (PMM) v2 with docker-compose

Set up PMM Server v2

Let's start by creating entry for server in docker-compose.yaml:

version: '2'
# version 2 of docker-compose is not "old" version, it's the actual version,
# see below for explanation:
# https://stackoverflow.com/a/53636006/961092
services:
@DeveloperMos
DeveloperMos / install-docker.md
Created April 19, 2024 12:35 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@DeveloperMos
DeveloperMos / README.md
Created April 19, 2024 12:01 — forked from abelcallejo/README.md
Create bootable Linux USB using Mac

Creating bootable Linux USB using Mac

mac

CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.

1. Prepare the .iso file

Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file

2. Convert the .iso file into a .img.dmg

@DeveloperMos
DeveloperMos / rules.yaml
Created March 28, 2024 11:52 — forked from juan-rosero/rules.yaml
Awesome Prometheus Alerts
groups:
- name: Prometheus self-monitoring
rules:
# A Prometheus job has disappeared
- alert: PrometheusJobMissing
expr: absent(up{job="my-job"})
for: 5m
labels:
severity: warning
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
#!/bin/bash
# create mongodb_exporter.service
cat > /etc/systemd/system/mongodb_exporter.service <<END
[Unit]
Description=Prometheus MongoDB Exporter
Documentation=https://github.com/percona/mongodb_exporter
After=network.target
[Service]
@DeveloperMos
DeveloperMos / gpg-import-and-export-instructions.md
Created March 13, 2021 22:56 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

atl*CLI> core show help
! -- Execute a shell command
acl show -- Show a named ACL or list all named ACLs
ael reload -- Reload AEL configuration
ael set debug {read|tokens|macros|contexts|off} -- Enable AEL debugging flags
agi dump html -- Dumps a list of AGI commands in HTML format
agi exec -- Add AGI command to a channel in Async AGI
agi set debug [on|off] -- Enable/Disable AGI debugging
agi show commands [topic] -- List AGI commands or specific help
aoc set debug -- enable cli debugging of AOC messages
@DeveloperMos
DeveloperMos / form.html
Created April 23, 2020 14:41 — forked from stekhn/form.html
Change URL location and parameters with a simple a HTML form. The query strings gets constructed on form submit. No JavaScript required.
<form action="search">
<fieldset>
<legend>Search string</legend>
<input type="search" name="query" value="" placeholder="Enter text">
</fieldset>
<fieldset>
<legend>Search for</legend>
<input type="radio" name="type" value="name" checked="checked">
@DeveloperMos
DeveloperMos / post-to-slack.js
Created April 23, 2020 14:40 — forked from stekhn/post-to-slack.js
Use webhooks for posting to Slack. Works great with Google Cloud Functions and Google Cloud Scheduler. The incoming webhook for your Slack team needs to be created beforehand.
const https = require('https');
exports.postToSlack = () => {
// Read more about Slack webhooks here: https://api.slack.com/messaging/webhooks
const webhookPath = '/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
const payload = {
'channel': '#mychannel',
'username': 'slackbot',