Skip to content

Instantly share code, notes, and snippets.

View alincalinciuc's full-sized avatar
🐧

Alin CALINCIUC alincalinciuc

🐧
View GitHub Profile
@sorny
sorny / x11_forwarding_macos_docker.md
Last active May 15, 2024 08:29
X11 forwarding with macOS and Docker

X11 forwarding on macOS and docker

A quick guide on how to setup X11 forwarding on macOS when using docker containers requiring a DISPLAY. Works on both Intel and M1 macs!

This guide was tested on:

  • macOS Catalina 10.15.4
  • docker desktop 2.2.0.5 (43884) - stable release
  • XQuartz 2.7.11 (xorg-server 1.18.4)
  • Macbook Pro (Intel)
@mcasperson
mcasperson / template.yml
Created April 9, 2020 00:27
Empty CloudFormation Template
AWSTemplateFormatVersion: '2010-09-09'
Description: 'CloudFormation exports'
Conditions:
HasNot: !Equals [ 'true', 'false' ]
# dummy (null) resource, never created
Resources:
NullResource:
Type: 'Custom::NullResource'
@shouptech
shouptech / del_empty_log_streams.py
Created January 21, 2019 16:26
Delete empty log streams from AWS CloudWatch Logs
#!/usr/bin/env python
"""
This script deletes empty log streams from cloudwatch log groups.
Your shell should be configured for connecting to the AWS API. This can be done
with the CLI command `aws configure`.
This script requires Python 3.6 or newer, and you must have boto3 installed.
"""
@soderlind
soderlind / Install.txt
Last active March 5, 2024 20:30
macOS DoH! (DNS over HTTPS) using cloudflared
1) Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
@mvanholsteijn
mvanholsteijn / copy-ssm-parameters
Created February 14, 2018 10:47
script to copy all SSM parameter store parameters to disk
#!/usr/bin/env python
#
# copy all SSM parameter store parameters to disk
#
import os, sys, argparse, boto3
parser = argparse.ArgumentParser(description='copy all parameter values to local')
parser.add_argument("--path", dest="path", required=True,
help="to copy the keys from", metavar="STRING")
parser.add_argument("--directory", dest="directory", required=True,
@AjeetK
AjeetK / jenkins_docker.md
Created November 11, 2017 17:05
Adding jenkins User To Docker Group
DOCKER_SOCKET=/var/run/docker.sock
DOCKER_GROUP=docker
JENKINS_USER=jenkins

if [ -S ${DOCKER_SOCKET} ]; then
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCKET})
sudo groupadd -for -g ${DOCKER_GID} ${DOCKER_GROUP}
sudo usermod -aG ${DOCKER_GROUP} ${JENKINS_USER}
fi
@colbywhite
colbywhite / _sls.sh
Created September 25, 2016 23:18
zsh completion for serverless v1.0
_sls_templates() {
_values \
'VALID TEMPLATES' \
'aws-nodejs' \
'aws-python' \
'aws-java-maven' \
'aws-java-gradle'
}
_sls_regions() {
@filippo
filippo / zimbra-backup-emails.sh
Created January 28, 2015 16:04
How to backup and restore emails of a specific account on zimbra
# The command below creates a tgz file with all emails for user@domain.com in .eml format:
# execute as root
/opt/zimbra/bin/zmmailbox -z -m user@domain.com getRestURL "//?fmt=tgz" > /tmp/account.tgz
# You can do the same via a REST URL:
wget http://ZIMBRA.SERVER/home/user@domain.com/?fmt=tgz
# to restore email:
/opt/zimbra/bin/zmmailbox -z -m user@domain.com postRestURL "//?fmt=tgz&resolve=reset" /tmp/account.tgz
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 14, 2024 11:33
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'