Skip to content

Instantly share code, notes, and snippets.

@akhdaniel
akhdaniel / autopgsqlbackup
Created June 21, 2022 02:48 — forked from denishpatel/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@akhdaniel
akhdaniel / Ethereum docker-compose.yaml
Last active May 25, 2021 03:51 — forked from alinetskyi/docker-compose.yaml
Ethereum node deployment file
version: '3.6'
services:
geth:
image: ethereum/client-go:stable
restart: always
command: |
--rpc
--rpcaddr=0.0.0.0
--rpcport=8545
@akhdaniel
akhdaniel / README.md
Created April 27, 2021 02:48 — forked from tmilos/README.md
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

@akhdaniel
akhdaniel / pgbouncer.ini
Created January 13, 2021 05:38 — forked from kenvac/pgbouncer.ini
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
@akhdaniel
akhdaniel / Installing Gammu on Raspberry Pi, Huawei E220
Last active August 16, 2020 01:04 — forked from damonsk/gist:3955099
Installing Gammu on Raspberry Pi, Huawei E220
# Send SMS messages using Raspberry Pi.
# Using gammu and Huawei E220
# Prepare SD card with wheezy.
# Login / complete rasp-config / reboot / login
# Set vimrc to prevent annoying ADBC arrow keys
cp /etc/vim/vimrc ~/.vimrc
@akhdaniel
akhdaniel / 00_etc-hosts.md
Created May 2, 2020 23:45 — forked from mul14/00_etc-hosts.md
/etc/hosts for Vimeo, Reddit, and Imgur.

Unblock Vimeo, Reddit, Imgur, dan Netflix

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

@akhdaniel
akhdaniel / pos.diff
Created December 14, 2018 03:51 — forked from nim-odoo/pos.diff
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 9b222f1..4492457 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -1889,7 +1889,8 @@ exports.Order = Backbone.Model.extend({
}
return zero_pad(this.pos.pos_session.id,5) +'-'+
zero_pad(this.pos.pos_session.login_number,3) +'-'+
- zero_pad(this.sequence_number,4);
+ zero_pad(this.sequence_number, 4) +'-'+
@akhdaniel
akhdaniel / gist:32fbeaa3ea723ddff00b8a7baf9a533a
Created December 13, 2018 01:01 — forked from shadowmint/gist:7004832
Kivy example using sqlalchemy to build a layout.
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import sessionmaker
from sqlalchemy import ForeignKey
from sqlalchemy.orm import relationship, backref
from kivy.graphics import Rectangle
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.widget import Widget
@akhdaniel
akhdaniel / Python3 Virtualenv Setup.md
Created November 21, 2018 05:20 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
# Setup an appropriate nginx log_format in the `http` section of your nginx config:
log_format main '$remote_addr $time_iso8601 "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_host" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time ';
# Then save the following as a munin plugin to monitor the last 5 minutes of your nginx access.log file