Skip to content

Instantly share code, notes, and snippets.

View keevitaja's full-sized avatar
💭
building jedmud

Tanel Tammik keevitaja

💭
building jedmud
View GitHub Profile
@keevitaja
keevitaja / gist:f4c387c9d7a7cb10b8cb8482f7e72f3a
Created April 19, 2024 11:27
Custom docker image based on official php:8.3-apache image which is based on debian.
FROM php:8.3-apache
ARG DOCKER_APP_UID
ARG DOCKER_APP_GID
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL C.UTF-8
RUN apt-get update && apt-get install -y \
const print = obj => {
for (const key in obj) {
console.log(obj[key])
}
}
const num = {}
num[5] = 5
num[2] = 2
const { app, component, controllers, system, options } = require('jedmud-component')
component(()=> {
const { alias, short, trigger, block, gag } = controllers
alias.set('^yolo$', ()=> system.send('say yolo'))
short.set('^y$', 'yolo')
short.set('^rl ', '#system reload ')
const id = trigger.set('\{say\}You say', ()=> {
@keevitaja
keevitaja / letsencrypt_2017.md
Created May 9, 2018 09:35 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@keevitaja
keevitaja / nginx.conf
Created May 9, 2018 09:17 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@keevitaja
keevitaja / default.vcl
Created April 30, 2018 05:55 — forked from kamigerami/default.vcl
haproxy + ssl -> varnish -> back to haproxy for loadbalancing to --> backend0/1/2 (webhost)
# This versions uses ELB loadbalancing
# The ELB points to these two HAProxy hosts
# The C-name of the Domain points to the ELB
# ELB -> HAPROXY 1 or 2 -> Varnish --> HIT or MISS --> HAPROXY 1 or 2 -> Backend 1/2/3
vcl 4.0;
import directors;
backend haproxy1 {
.host = "172.31.xx.235"; # back to HAPROXY-1 internal address
.port = "8080";
.probe = {
const blessed = require('blessed')
const colors = require('colors')
const screen = blessed.screen({
smartCSR: true
})
let index = 0
let page = []
const blessed = require('blessed')
const colors = require('colors')
const screen = blessed.screen({
smartCSR: true
})
let index = 0
const display = blessed.box({
@keevitaja
keevitaja / checksum.js
Created May 6, 2017 08:05
Cheap hash for javascript
export default (s)=> {
let hash = 0
let strlen = s.length
if ( strlen === 0 ) {
return hash;
}
for (let i = 0; i < strlen; i++) {
let c = s.charCodeAt(i)
@keevitaja
keevitaja / dropdown.scss
Last active March 20, 2018 17:48
Bulma nav dropdown
.has-dropdown {
display: relative;
.dropdown {
display: none;
position: absolute;
background-color: $white-bis;
padding: 14px;
border: 1px solid $grey-lighter;
border-radius: $radius;