Skip to content

Instantly share code, notes, and snippets.

@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active May 4, 2024 15:04
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@mrw34
mrw34 / gist:b12531d1a8df25f6c170
Last active April 14, 2024 17:39
Trello JSON to CSV conversion using jq
jq -r '["List", "Card"], ((reduce .lists[] as $list ({}; .[$list.id] = $list.name)) as $lists | .cards[] | select(.closed != true) | [$lists[.idList],.name]) | @csv' <nw3RUeLl.json
@ndemengel
ndemengel / whisper-calculator.py
Last active August 24, 2016 11:36 — forked from jjmaestro/whisper-calculator.py
Add weeks support to jjmaestro's script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def archive_to_bytes(archive):
def to_seconds(s):
SECONDS_IN_A = {
's': 1,
'm': 1 * 60,
'h': 1 * 60 * 60,
@tobert
tobert / 0000README.md
Last active January 31, 2022 15:22
G1GC / CMS

G1GC v.s. CMS for Cassandra 2.0

Many people have asked me about using the G1 garbage collector with Cassandra. Since most of my customers are running 2.0 in production the test is with 2.0 for now. Once I script it up I'll re-run the numbers with 2.1.

I also need to re-test with Java 7 and the Oracle JDKs.

TL;DR

@Gromph
Gromph / gist:5f4db73b0f38775bc2f0
Last active September 9, 2019 19:55
Install Cabot on CentOS7 using uwsgi, nginx, and mysql
The Cabot quick start instructions are for auto installing on ubuntu using fabric, gunicorn, postgres.
I wanted to install manually on CentOS 7 running with uwsgi, nginx, mysql, and use our own mail server for
alerts instead of Amazon SES
These are my notes on how I did that.
These notes aren't a complete walkthrough, and a few steps may be missing or wrong, but I thought they might
be helpful anyways.
Setup
1. adduser www
passwd www
@zmwangx
zmwangx / Postfix: sender-dependent SASL authentication.md
Last active April 15, 2024 06:34
Postfix: sender-dependent SASL authentication — relay to multiple SMTP hosts, or relay to the same host but authenticate as different users (e.g., two Gmail accounts)

This is a sequel to "Postfix: relay to authenticated SMTP".

I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.

As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):

/etc/postfix/main.cf:
    # sender-dependent sasl authentication
    smtp_sender_dependent_authentication = yes

sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

global
log logstash local0 #Change logstash to your naming
log-send-hostname
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
maxconn 4000
defaults
@jkreps
jkreps / benchmark-commands.txt
Last active January 21, 2024 11:02
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@sandys
sandys / default_varnish
Created March 8, 2014 08:41
Varnish file for chefatlarge
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s file,/www/varnish/$INSTANCE/varnish_storage.bin,1G"
@am
am / shell
Created January 26, 2014 11:35
Kaleidodcope "xcrun: error: cannot be used within an App Sandbox..."
cd /Applications/Kaleidoscope.app/Contents/Resources/Integration/scripts
./install_git-default