This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- PostgreSQL: Row Count for All Tables in a Schema | |
| DO $$ | |
| DECLARE | |
| r RECORD; | |
| cnt BIGINT; | |
| BEGIN | |
| FOR r IN | |
| SELECT tablename | |
| FROM pg_tables | |
| WHERE schemaname = 'table_name' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- PGSQL Script: Bulk Update Schema, Table & Sequence Owners | |
| DO $$ | |
| DECLARE | |
| sch RECORD; | |
| obj RECORD; | |
| owner_name TEXT := 'dolphin'; -- <-- declare your owner variable here | |
| BEGIN | |
| -- Loop over all your target schemas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| voyage_from_logabstract_final.py | |
| End-to-end pipeline: | |
| - Read LOG_ABSTRACT.csv and BUNKER_SUMMARY.csv | |
| - Segment voyages from event log | |
| - Compute energy (MJ), gCO2e, compliance balance vs FuelEU target | |
| - Determine EU scope from alpha-2 prefixes of from/to UNLOCODEs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| while getopts ":v:" opt; do | |
| case ${opt} in | |
| v ) | |
| vault_name=$OPTARG | |
| ;; | |
| \? ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo mkdir -p /mnt/data | |
| sudo mount /dev/disk/azure/scsi1/lun$1 /mnt/data | |
| echo "/dev/disk/azure/scsi1/lun$1 /mnt/data ext4 defaults 0 0" | sudo tee -a /etc/fstab | |
| sudo sed -i 's|path.data: /var/lib/elasticsearch|path.data: /mnt/data|g' /etc/elasticsearch/elasticsearch.yml | |
| sudo systemctl restart elasticsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo mkdir -p /mnt/data | |
| sudo mount /dev/disk/azure/scsi1/lun$1 /mnt/data | |
| echo "/dev/disk/azure/scsi1/lun$1 /mnt/data ext4 defaults 0 0" | sudo tee -a /etc/fstab | |
| sudo sed -i 's|/var/lib/postgresql/16/main|/mnt/data/main|g' /etc/postgresql/16/main/postgresql.conf | |
| sudo chown postgres.postgres /mnt/data -R | |
| sudo /etc/init.d/postgresql restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| POST `https://PROJECT_URL/admin/recovery/code` | |
| ``` | |
| --header 'Content-Type: application/json' | |
| --header 'Authorization: YOUR_ORI_ADMIN_ACCESS_TOKEN' | |
| body= | |
| { | |
| "expires_in": "5m", | |
| "identity_id": "SOME_USER_ID_GUID", | |
| "flow_type": "api" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ======================== Elasticsearch Configuration =========================imm | |
| # | |
| # NOTE: Elasticsearch comes with reasonable defaults for most settings. | |
| # Before you set out to tweak and tune the configuration, make sure you | |
| # understand what are you trying to accomplish and the consequences. | |
| # | |
| # The primary way of configuring a node is via this file. This template lists | |
| # the most important settings you may want to configure for a production cluster. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install -y rsync | |
| sudo mkfs.ext4 /dev/disk/azure/scsi1/lun$1 | |
| sudo mkdir -p /mnt/data | |
| sudo mount /dev/disk/azure/scsi1/lun$1 /mnt/data | |
| sudo rsync -av /var/lib/elasticsearch/ /mnt/data/ | |
| echo "/dev/disk/azure/scsi1/lun$1 /mnt/data ext4 defaults 0 0" | sudo tee -a /etc/fstab | |
| sudo sed -i 's|path.data: /var/lib/elasticsearch|path.data: /mnt/data|g' /etc/elasticsearch/elasticsearch.yml | |
| sudo systemctl restart elasticsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $TTL 604800 | |
| @ IN SOA ns1.postgres.database.azure.com. admin.postgres.database.azure.com. ( | |
| 2023101601 ; Serial | |
| 604800 ; Refresh | |
| 86400 ; Retry | |
| 2419200 ; Expire | |
| 604800 ) ; Negative Cache TTL | |
| ; | |
| @ IN NS ns1.postgres.database.azure.com. | |
| ns1 IN A 10.7.5.4 |
NewerOlder