Skip to content

Instantly share code, notes, and snippets.

@sahapasci
sahapasci / forticlient_debian_13_install.sh
Created October 5, 2025 09:25
Forticlient Debian 13 (Trixie) Installation
# Forticlient Debian 13 (Trixie) Installation
# This script adds the Forticlient repository, imports the GPG key, updates package lists, and installs Forticlient 7.4.
# Note: The repository URL references Ubuntu, but it works on Debian 13 (Trixie) as well.
# Download Fortinet GPG key
wget https://repo.fortinet.com/repo/forticlient/7.4/ubuntu22/DEB-GPG-KEY --output-document=/etc/apt/keyrings/repo.fortinet.com.asc
# Add Forticlient repository
echo "deb [signed-by=/etc/apt/keyrings/repo.fortinet.com.asc] https://repo.fortinet.com/repo/forticlient/7.4/ubuntu22/ stable non-free" > /etc/apt/sources.list.d/repo.fortinet.com.list
@sahapasci
sahapasci / etcdctl.completion.bash
Created May 1, 2025 16:58
etcdctl bash autocomplete
# bash completion for etcdctl -*- shell-script -*-
__etcdctl_debug()
{
if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
fi
}
# Homebrew on Macs have version 1.3 of bash-completion which doesn't include
@sahapasci
sahapasci / etcdutl.completion.bash
Last active May 1, 2025 16:48
etcdutl bash autocomplete
# bash completion for etcdutl -*- shell-script -*-
__etcdutl_debug()
{
if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
fi
}
# Homebrew on Macs have version 1.3 of bash-completion which doesn't include
@sahapasci
sahapasci / create-partitioned-table.sql
Created May 20, 2020 15:20 — forked from edib/create-partitioned-table.sql
Migrate non-partioned table to a partitioned table.
-- base table
-- drop table users cascade;
CREATE TABLE users (
id serial PRIMARY KEY,
username text NOT NULL UNIQUE,
password text,
created_on timestamptz NOT NULL,
last_logged_on timestamptz NOT NULL
@sahapasci
sahapasci / gist:e766d2c2a0c2521ebb73e89ede971e84
Created April 18, 2019 14:50
postgresql 9.6 alter column type which used in function
create table my_table (id integer primary key, data text);
create function my_func(id integer, data text)
returns void
language plpgsql
as
$$
begin
insert into my_table values (id, data);
end;
$$;
@sahapasci
sahapasci / create_dms_selection_rules.sql
Created November 13, 2018 14:49
AWS DMS Selection Rules JSON
/*
* This query creates JSON input for AWS DMS (Data Migration Service) selection rules.
* It incluedes all schemas.
*/
WITH rules AS (
SELECT
format('{
"rule-type": "selection",
"rule-id": "%s",