Skip to content

Instantly share code, notes, and snippets.

View repodevs's full-sized avatar

Edi Santoso repodevs

View GitHub Profile
@asaah18
asaah18 / python guide.md
Last active November 5, 2022 16:20
a python guide/cheat-sheet intended to those who already know python and want a mind refresh or looking for a specific syntax

Python Guide

This python guide is intended to those who already know python and want a mind refresh or looking for a specific syntax.
-as this guide doesn't elaborate in explaining thing that a programmer would already know -like: variable, function, csv, json-

additionally, this guide is not intended to be a replacement for reading official Python documentation.

guide version: 2.1.0 | python version: 3.10

| Part of Version | Explanation |

func main() {
s := time.Now()
args := os.Args[1:]
if len(args) != 6 { // for format LogExtractor.exe -f "From Time" -t "To Time" -i "Log file directory location"
fmt.Println("Please give proper command line arguments")
return
}
startTimeArg := args[1]
finishTimeArg := args[3]
@jgould22
jgould22 / Dockerfile
Last active March 18, 2024 16:06
Postgres 15 - Alpine - pg_partman with pg_jobmon
FROM postgres:15-alpine
LABEL maintainer="Jordan Gould <jordangould@gmail.com>"
# Based on https://github.com/andreaswachowski/docker-postgres/blob/master/initdb.sh
ENV PG_JOBMON_VERSION v1.4.1
ENV PG_PARTMAN_VERSION v4.7.1
# Install pg_jobmon
RUN set -ex \
\
@mlaitinen
mlaitinen / main.py
Created July 30, 2019 15:12
Odoo 12 Prometheus instrumentation
##############################################################################
#
# Author: Miku Laitinen / Avoin.Systems
# Copyright 2019 Avoin.Systems
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
@saurabhnanda
saurabhnanda / tuning-postgres-zfs.md
Last active August 2, 2023 06:06
Tuning Postgres + ZFS

Tuning ZFS + Postgres to outperform EXT4 + Postgres

Please refer to ZFS 2-3x slower than EXT4 to see how ZFS defaults + Postgres defaults severely underperform EXT4 defaults + Postgres defaults (and also to know more about the system on which these benchmarks were performed). This page documents how to tune ZFS + Postgres to give better performance for the tpcb-like benchmark.

BIG FAT WARNING

Please do not copy these settings blindly because I am myself not clear on why/how these settings had the impact they did. For example, I cannot explain why full_page_writes=off independently did not give that much boost, nor did an optimized PG configuration. However, putting both of them together gave a 2-4x boost compared to baseline numbers.

Benchmark results

package main
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"github.com/satori/go.uuid"
"fmt"
)
type Email struct {
@serithemage
serithemage / aws-study-resource.md
Last active March 6, 2024 01:52
AWS 학습 자료집

AWS 학습 링크집 시리즈

@shr00mie
shr00mie / jupyterlab_install.sh
Last active July 20, 2019 10:41
Jupyterlab Install + Service on Ubuntu Server 16.04LTS
#!/bin/bash
# variables
# listening address for jupyter. set to localhost if only accessing locally.
read -p $'\n\e[32mServer static IP address\e[m: ' ipAddress
# Set this either as parent or direct working directory of the project you want to work on.
read -p $'\n\e[32mProject Parent Directory\e[m: ' WorkingDirectory
echo -e "\n...\e[32mGenerating random token\e[m...\n"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kenvac
kenvac / pgbouncer.ini
Created November 7, 2017 09:50
basic pgbouncer configuration with odoo
;; database name = connect string
;;
;; connect string params:
;; dbname= host= port= user= password=
;; client_encoding= datestyle= timezone=
;; pool_size= connect_query=
[databases]
odoo1 = host=127.0.0.1 auth_user=odoo dbname=odoo1 port=5432
odoo2 = host=127.0.0.1 auth_user=odoo dbname=odoo2 port=5432
odoo3 = host=127.0.0.1 auth_user=odoo port=5432 dbname=odoo3