Skip to content

Instantly share code, notes, and snippets.

View erdii's full-sized avatar
🪤

Josh Gwosdz erdii

🪤
View GitHub Profile
#!/bin/bash
# This script purges the local history older than 90 days in some rooms, that you can define in an array
#
# crontab -e
# 23 4 * * * bash /home/irc-bridge/.synapse/EIGENE_purge_history_daily > /dev/null 2>&1
cd /home/irc-bridge/.synapse/
DOMAIN="matrix.yourserver.org"
ADMIN="@some_adminuser:matrix.yourserver.org"
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@mapmeld
mapmeld / OverEncrypt.md
Last active July 25, 2023 18:55
OverEncrypt - paranoid HTTPS

OverEncrypt

This is a guide that I wrote to improve the default security of my website https://fortran.io , which has a certificate from LetsEncrypt. I'm choosing to improve HTTPS security and transparency without consideration for legacy browser support.

WARNING: if you mess up settings, lose your certificates, or decide to no longer maintain HTTPS certs, these steps can and will make your domain inaccessible.

I would recommend these steps only if you have a specific need for information security, privacy, and trust with your users, and/or maintain a separate secure.example.com domain which won't mess up your main site. If you've been thinking about hosting a site on Tor, then this might be a good option, too.

The best resources that I've found for explaining these steps are https://https.cio.gov , https://certificate-transparency.org , and https://twitter.com/konklone

@kristovatlas
kristovatlas / cssbanner-beautified2.js
Last active March 9, 2018 21:49
cleaned up version of cssbanner.js
//beautified at http://jsbeautifier.org/ with default options
//and then manually modified
/*jslint bitwise: true */
self.onmessage = function (msg) {
var thecode = msg.data;
/**
* Ostensibly unused function
@muhammadghazali
muhammadghazali / What is server_names_hash_bucket_size.md
Last active February 9, 2024 14:13
Nginx: What is server_names_hash_bucket_size?

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far:

@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)

Install certbot

sudo su
yum install wget -y
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto

Install certificate

@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@jatins
jatins / phineas-intro.md
Last active May 26, 2017 05:24
Building realtime application with DynamoDB (and potentially any database with an operation log)

Building realtime applications is hard.

A scalable solution to this problem involves many cumbersome steps:

  • Hooking into replication logs of the database servers, or writing custom data invalidating logic for realtime UI components.
  • Adding messaging infrastructure (e.g. RabbitMQ) to your project.
  • Writing sophisticated routing logic to avoid broadcasting every message to every web server.
  • Reimplementing database functionality in the backend if your app requires realtime computation (e.g. realtime leaderboards).

    All this requires enormous commitment of time and engineering resources.

- RethinkDB: Advancing the realtime web