Skip to content

Instantly share code, notes, and snippets.

@rmoorman
rmoorman / openssl_commands.md
Created April 8, 2024 18:29 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@rmoorman
rmoorman / .iex.exs
Created April 2, 2024 14:37 — forked from brainlid/.iex.exs
My .iex.exs file that lives in my Home directory. Gets loaded and used in every IEx session on my machines. I borrowed and stole all the great ideas from others an tweaked them over the years.
Application.put_env(:elixir, :ansi_enabled, true)
# IEx shell customization for color
# - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/
# - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/
# - Can add to a specific project or can put in the User home folder as a global config.
# Updates from:
# - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs
timestamp = fn ->
{_date, {hour, minute, _second}} = :calendar.local_time
@rmoorman
rmoorman / apache_self_signed.sh
Created April 2, 2024 09:34 — forked from saissemet/apache_self_signed.sh
Apache website with self signed certificates
sudo apt update && sudo apt upgrade -y
sudo apt install apache2 -y
sudo apt install easy-rsa -y
cd /usr/share/easy-rsa
sudo ./easyrsa init-pki
yes "" | sudo ./easyrsa build-ca nopass
@rmoorman
rmoorman / 2serv.py
Created November 16, 2023 22:22 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@rmoorman
rmoorman / fluent-filebeat-comparison.md
Created November 6, 2023 14:28 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
#!/usr/bin/env bash
DATABASE_URL="postgres://MyPostgresUser:MyPostgresPassword@192.168.0.1:5432/MyPostgresDB"
# `cut` is used to cut out the separators (:, @, /) that come matched with the groups.
DATABASE_USER=$(echo $DATABASE_URL | grep -oP "postgres://\K(.+?):" | cut -d: -f1)
DATABASE_PASSWORD=$(echo $DATABASE_URL | grep -oP "postgres://.*:\K(.+?)@" | cut -d@ -f1)
DATABASE_HOST=$(echo $DATABASE_URL | grep -oP "postgres://.*@\K(.+?):" | cut -d: -f1)
DATABASE_PORT=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:\K(\d+)/" | cut -d/ -f1)
@rmoorman
rmoorman / normcore-llm.md
Created September 4, 2023 12:25 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
@rmoorman
rmoorman / .pylintrc
Created October 26, 2022 21:03 — forked from joepreludian/.pylintrc
Pylint rc file template for django projects. Ignores migrations and test suites.
[MASTER]
profile=no
persistent=yes
ignore=tests.py, urls.py, migrations
cache-size=500
[MESSAGES CONTROL]
# C0111 Missing docstring
# I0011 Warning locally suppressed using disable-msg
# I0012 Warning locally suppressed using disable-msg
@rmoorman
rmoorman / sqlite.abnf
Created October 7, 2022 22:57 — forked from hoehrmann/sqlite.abnf
ABNF for SQLite 3.28 SQL
; FIXME: The grammar has been transformed so that `w` appears after a
; token, but there is no way in ABNF to define it as token-separator
; that can optionally contain a mix of comments and white-space. Take
; `;;` as an example, for that to match `sql-stmt-list` `w` would
; have to match the empty string. But if `w` matches the empty string
; then `ISNOT` is the same as `IS NOT`.
sql-stmt-list = [ sql-stmt ] *( ";" w [ sql-stmt ] )
sql-stmt = [ "EXPLAIN" w [ "QUERY" w "PLAN" w ] ] ( alter-table-stmt / analyze-stmt / attach-stmt / begin-stmt / commit-stmt / create-index-stmt / create-table-stmt / create-trigger-stmt / create-view-stmt / create-virtual-table-stmt / delete-stmt / delete-stmt-limited / detach-stmt / drop-index-stmt / drop-table-stmt / drop-trigger-stmt / drop-view-stmt / insert-stmt / pragma-stmt / reindex-stmt / release-stmt / rollback-stmt / savepoint-stmt / select-stmt / update-stmt / update-stmt-limited / vacuum-stmt )
alter-table-stmt = "ALTER" w "TABLE" w [ schema-name w "." w ] table-na
@rmoorman
rmoorman / sshrc
Created September 18, 2022 20:28 — forked from adzhurinskij/sshrc
/etc/ssh/sshrc example
#!/bin/bash
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
hostname=`hostname`
fqdn=`hostname -f`
logger -t ssh-wrapper $USER login from $ip
sendmail -t <<EOF
To: Alex <adzhurinskij@gmail.com>