Skip to content

Instantly share code, notes, and snippets.

View aduzsardi's full-sized avatar
🛠️
d(0_0)b

Alexandru Duzsardi aduzsardi

🛠️
d(0_0)b
View GitHub Profile
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active April 18, 2024 01:45
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@paparaka
paparaka / cloudbuild.tf
Last active November 13, 2022 18:39
K8.Jinja.Templating
############################################################################################
# A sample Terraform file that creates the cloud build trigger.
############################################################################################
resource "google_cloudbuild_trigger" "develop_trigger" {
description = "[DEVELOP] Build develop branch"
filename = "cloudbuild.yaml"
trigger_template {
branch_name = "^develop$"
repo_name = "houston"
}
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@RichardBronosky
RichardBronosky / mask2cdr
Last active December 7, 2020 21:03
Convert netmask to CIDR
#!/bin/bash
# Based on https://stackoverflow.com/questions/20762575/explanation-of-convertor-of-cidr-to-netmask-in-linux-shell-netmask2cdir-and-cdir
mask2cdr ()
{
local mask=$1
# In RFC 4632 netmasks there's no "255." after a non-255 byte in the mask
local left_stripped_mask=${mask##*255.}
local len_mask=${#mask}
@asvignesh
asvignesh / Build_seed_iso
Created January 6, 2018 07:42
Samples to create a cloud-init configuration ISO.
$ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data
@magnetikonline
magnetikonline / README.md
Last active April 7, 2024 23:38
Bash internal field separator (IFS) usage.

Bash internal field separator (IFS) usage

The IFS internal variable is used to determine what characters Bash defines as word/item boundaries when processing character strings. By default set to whitespace characters of space, tab, and newline.

Running the example ifs.sh, comparing the difference between the default and setting only newline as a boundary we get the following output:

/path/to/first
file
/path/to/second
@njh
njh / auto_select_certificate.json
Created December 22, 2015 11:06
Policy file to configure Chrome/Chromium to automatically select a client certificate (useful for Kiosk mode)
{
"AutoSelectCertificateForUrls": ["{\"pattern\":\"*\",\"filter\":{}}"]
}
@jinnko
jinnko / pem-split
Last active April 5, 2024 15:13
Take a PEM format file as input and split out certs and keys into separate files.
#!/usr/bin/awk -f
#
# Take a PEM format file as input and split out certs and keys into separate files
#
BEGIN { n=0; cert=0; key=0; if ( ARGC < 2 ) { print "Usage: pem-split FILENAME"; exit 1 } }
/-----BEGIN PRIVATE KEY-----/ { key=1; cert=0 }
/-----BEGIN CERTIFICATE-----/ { cert=1; key=0 }
split_after == 1 { n++; split_after=0 }
/-----END CERTIFICATE-----/ { split_after=1 }
@scottious
scottious / gist:0d99ea77daa041b28929
Created November 10, 2014 00:39
__git_ps1 command not found issue.

I've been having an issue with the following error appear in the prompt after upgrading to Yosemite. The solution was to source the git bash completion and prompt files from a local copy.

    curl -o ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
    curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh

Then in:

    vi ~/bash_profile

Add:

@jirutka
jirutka / -README.md
Last active October 31, 2023 09:07
How to use terminal on Windows and don’t go crazy…

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings