Skip to content

Instantly share code, notes, and snippets.

@sahapasci
sahapasci / forticlient_vpn_only_debian_13_install.sh
Created November 6, 2025 12:05
FortiClient VPN-only Debian 13 (Trixie) Installation
#!/bin/bash
# This script downloads and installs latest FortiClient VPN-only Debian 13 (Trixie).
# It resolves the redirected download URL, installs required dependencies.
set -e # Stop on error
generic_url='https://links.fortinet.com/forticlient/deb/vpnagent'
tmp_dir=/tmp/forticlient_vpn
# Create temporary directory
@sahapasci
sahapasci / forticlient_debian_13_install.sh
Last active November 6, 2025 11:45
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.
# Notes:
# The repository URL references Ubuntu, but it works on Debian 13 (Trixie) as well.
# FortiClient is a licensed product. If you do not have a valid license, install the "FortiClient VPN-only" package instead for VPN access only.
# 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
@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",