Skip to content

Instantly share code, notes, and snippets.

View arisnew's full-sized avatar

Aris Priyanto arisnew

View GitHub Profile
@arisnew
arisnew / update-unsupported-os-image-docker.md
Created December 27, 2025 15:17
Cara agar bisa update (apt update) OS (yang sudah tidak disupport) di container docker

Jika docker image yang kita pakai sudah bertahun-tahun mungkin OS yang dipakai image tersebut sudah tidak disupport, sehingga saat kita mau update (misal perlu install lib / package tambahan, namun harus update dulu) akan mengalami kendala sbb:

root@myawesomeimagedocker:/# apt update
Ign:1 http://security.debian.org/debian-security buster/updates InRelease
Ign:2 http://deb.debian.org/debian buster InRelease
Err:3 http://security.debian.org/debian-security buster/updates Release
  404  Not Found [IP: 151.101.130.132 80]
Ign:4 http://deb.debian.org/debian buster-updates InRelease
@arisnew
arisnew / localhost-ssl-certificate.md
Created December 4, 2025 07:14 — forked from ethicka/localhost-ssl-certificate.md
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@arisnew
arisnew / sample_api_proxy.md
Created November 27, 2025 12:06
API Proxy untuk meneruskan request dari docker ke external server jika dari docker terkendala VPN (Mac)

Biasanya aplikasi kita yang di dalam docker (Mac) tidak bisa hit ke API server eksternal yang koneksinya menggunakan VPN (dari host/laptop kita bisa, namun dari dalam docker tidak bisa).

Selain ubah konfigurasi network (yg mungkin masih gagal), solusi alternatifnya kita bisa lewatkan semacam API Proxy.

Berikut sample-nya:

# api_proxy.py
import http.server
import socketserver
@arisnew
arisnew / check-mysql-column-rel.md
Created August 13, 2025 02:28
Check column relation to another table MYSQL
SELECT
    TABLE_NAME,
    COLUMN_NAME,
    CONSTRAINT_NAME,
    REFERENCED_TABLE_NAME,
    REFERENCED_COLUMN_NAME
FROM
    INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE
@arisnew
arisnew / upgrade-modul-cli-docker-compose.txt
Created February 10, 2025 02:18 — forked from jidokaaris/upgrade-modul-cli-docker-compose.txt
Upgrade modul odoo via cli (docker compose)
docker compose exec NAMA_SERVICE_ODOO odoo \
-d NAMA_DB \
--db_password PASSWORD_DB \
--db_host NAMA_SERVICE_DB \
--no-xmlrpc \
--stop-after-init \
--update NAMA_ADDON
@arisnew
arisnew / debug-access-rule-odoo.md
Created July 3, 2024 06:41
Debug detail access rule odoo

Jika kita mendapatkan error access right odoo yg mungkin tidak tahu detail kesalahan itu dibaris kode yg mana, kita bisa traceback lebih detail. Kita perlu edit model core nya odoo.

Ref https://www.odoo.com/forum/help-1/how-to-debug-access-permissions-121603

Berikut contoh pesan errornya:

Due to security restrictions, you are not allowed to access 'Sale Order' (sale.order) records.
@arisnew
arisnew / drop-postgresql-db-active-connection.md
Created June 20, 2024 04:53
Cara drop / delete database postgresql yg sedang ada koneksi aktif

example in postgresql old version:

-- login psql
-- makesure db exist
-- Disallow new connections
UPDATE pg_database SET datallowconn = false WHERE datname = "NAMA_DB";
-- ALTER DATABASE "NAMA_DB" CONNECTION LIMIT 1; -- (jika perlu)

-- teriminate existing connection
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = "NAMA_DB";
@arisnew
arisnew / row-to-column-mysql.md
Created June 19, 2024 04:01
Example : Row to Column in MySQL
SELECT tmp_tbl.asset_id,
    MAX(CASE WHEN tmp_tbl.custom_sequence=1 THEN tmp_tbl.software_name ELSE NULL END) other_software_1,
    MAX(CASE WHEN tmp_tbl.custom_sequence=2 THEN tmp_tbl.software_name ELSE NULL END) other_software_2,
    MAX(CASE WHEN tmp_tbl.custom_sequence=3 THEN tmp_tbl.software_name ELSE NULL END) other_software_3,
    MAX(CASE WHEN tmp_tbl.custom_sequence=4 THEN tmp_tbl.software_name ELSE NULL END) other_software_4,
    MAX(CASE WHEN tmp_tbl.custom_sequence=5 THEN tmp_tbl.software_name ELSE NULL END) other_software_5,
    MAX(CASE WHEN tmp_tbl.custom_sequence=6 THEN tmp_tbl.software_name ELSE NULL END) other_software_6,
    MAX(CASE WHEN tmp_tbl.custom_sequence=7 THEN tmp_tbl.software_name ELSE NULL END) other_software_7,
    MAX(CASE WHEN tmp_tbl.custom_sequence=8 THEN tmp_tbl.software_name ELSE NULL END) other_software_8
@arisnew
arisnew / psql-in-mac.md
Created June 5, 2024 09:00
`psql` di mac
@arisnew
arisnew / docker-compose-mysql-phpmyadmin.md
Created April 23, 2024 12:06
contoh docker compose mysql + phpmyadmin
version: '3.1'
services:
  db:
    image: mysql:latest
    container_name: db
    # restart: unless-stopped
    environment:
      MYSQL_ROOT_USERNAME: root
 MYSQL_ROOT_PASSWORD: root