Skip to content

Instantly share code, notes, and snippets.

View gdm's full-sized avatar

Dmytro Gorbunov gdm

View GitHub Profile
@gdm
gdm / fetch-ses-email.sh
Created April 8, 2024 20:51 — forked from danmaas/fetch-ses-email.sh
Fetch emails from Amazon S3 and feed to procmail
#!/bin/bash
# Fetch emails from Amazon S3 (deposited by the Amazon SES receiver's S3 action)
# and feed to procmail. In the spirit of fetchmail, but using S3 instead of SMTP.
BUCKET=my-bucket-name
export AWS_PROFILE=my-aws-profile
PROCMAIL="/usr/bin/procmail"
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
@gdm
gdm / gitlab-backup.md
Created July 3, 2023 10:41 — forked from nikvdp/gitlab-backup.md
Back up GitLab to GitHub

Backup your GitLab repos to GitHub

GitLab recently decided to silently delete any repositories that hadn't been accessed in the last year. The announcement didn't go over well and they soon caved to public pressure and decided to instead back up inactive repos to object storage instead of unilaterally deleting them. I'm glad they reconsidered, but the experience left me with a bad taste in my mouth, so I decided to look into (relatively) low

@gdm
gdm / email-raw-decode.py
Created May 6, 2022 16:13
Decode email format (MIME quoted printable)
from email.parser import Parser
import quopri
def decode_email(msg_str):
p = Parser()
message = p.parsestr(msg_str)
decoded_message = ''
for part in message.walk():
charset = part.get_content_charset()
if part.get_content_type() == 'text/plain':
@gdm
gdm / gist:a093872fda5348ccb66de254f2ec4047
Created June 10, 2021 21:05 — forked from moneytoo/gist:8c95cc39fd4fd9a18858eb15e379d2f5
ImageMagick 6.7.8 with WebP (libwebp) support on CentOS 7
yum -y install bzip2-devel libtiff-devel giflib-devel ghostscript-devel libwmf-devel jasper-devel libtool-ltdl-devel libXext-devel libXt-devel librsvg2-devel OpenEXR-devel libwebp-devel
rpm -ivh http://vault.centos.org/centos/7/updates/Source/SPackages/ImageMagick-6.7.8.9-15.el7_2.src.rpm
sed -i '/BuildRequires:\tghostscript-devel/a BuildRequires:\tlibwebp-devel' /root/rpmbuild/SPECS/ImageMagick.spec
sed -i '/Requires: pkgconfig/a Requires: libwebp' /root/rpmbuild/SPECS/ImageMagick.spec
rpmbuild -ba /root/rpmbuild/SPECS/ImageMagick.spec
# actual install
rpm -Uvh --force /root/rpmbuild/RPMS/x86_64/ImageMagick-6.7.8.9-15.el7.centos.x86_64.rpm
@gdm
gdm / AsciidocCheatsheet.adoc
Created May 27, 2021 05:36 — forked from powerman/AsciidocCheatsheet.adoc
Asciidoc cheatsheet for GitHub

Asciidoc cheatsheet for GitHub

@gdm
gdm / running-minio-in-minikube.md
Created November 11, 2020 19:21 — forked from balamurugana/running-minio-in-minikube.md
Running minio in minikube

Prerequisites:

  • Run minikube with kvm driver by $ minikube start --vm-driver kvm

Minio FS mode:

  1. Deploy minio in fs mode with below yaml in a file like $ kubectl create -f my-minio-fs.yaml
## Create persistent volume claim for minio to store data.
apiVersion: v1
kind: PersistentVolumeClaim
@gdm
gdm / jenkins-is-dead.md
Created October 11, 2020 11:39 — forked from michaellihs/jenkins-is-dead.md
Jenkins is dead - long live Jenkins!

Jenkins is dead - long live Jenkins!

Brainstorming

  • Basic Concepts
    • Continuous Delivery

      Delivering Software with confidence, small increments, frequent releases, requires automated tested, automated deployment, automated infrastructure

  • Pipelines
@gdm
gdm / get-jenkins-plugins.sh
Created October 9, 2020 10:49
Get jenkins plugins
# Generates list of jenkins plugins compatible with /usr/local/bin/install-plugins.sh (distributed in jenkins Docker)
# The output of this command (colon-separated list of items like 'htmlpublisher:1.23') should be
# passed as an input for /usr/local/bin/install-plugins.sh script
curl -u $JENKINS_USER:$JENKINS_PASSWORD \
"http://localhost:8080/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | \
perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)(<\/\w+>)+/\1 \2\n/g' | \
sed 's/ /:/' | sort
@gdm
gdm / LFS158x.md
Last active June 27, 2019 22:21
K8s EDX course outcome