Skip to content

Instantly share code, notes, and snippets.

View daurrutia's full-sized avatar

David daurrutia

  • these United States
View GitHub Profile

Azure CLI Commands

Set table output as default

az configure --defaults output=table

Flexible Server

Get resources/servers

Linux Storage Commands

Disk space usage with human-readable format

df -h

Size of specific directory

du -sh /path/to/dir

Basic PostgreSQL Tests

  1. Connect to PostgreSQL and list databases using psql

     # Connect to a cluster
     psql -h <service-name> -U postgres
    
     # Inside psql:
     \conninfo            # Current connection details
    

\l # List all databases

@daurrutia
daurrutia / openssl-commands.md
Last active June 25, 2025 15:48
OpenSSL Commands
@daurrutia
daurrutia / import-pem.sh
Created February 15, 2023 03:24
Import certificates previously converted from a bundle in PKCS7 format to PEM format into a Java keystore
#!/bin/bash
# author:
# cmcginty https://stackoverflow.com/a/29997111/7742737
# example:
# ./import-pem.sh TrustedCAs.PEM changeit truststore.jks
PEM_FILE=$1
PASSWORD=$2
KEYSTORE=$3
@daurrutia
daurrutia / Install-Git-LFS-on-Fedora-Remix-for-WSL.md
Last active August 13, 2020 19:54
Install Git LFS on Fedora Remix for WSL
@daurrutia
daurrutia / disable-inprivate.ps1
Created December 7, 2018 21:51
Disable Microsoft Edge's InPrivate Browsing
# https://docs.microsoft.com/en-us/windows/client-management/mdm/policy-csp-browser#browser-allowinprivate
# https://github.com/MicrosoftDocs/windows-itpro-docs/blob/master/browsers/edge/includes/allow-inprivate-browsing-include.md
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main'
if (Test-Path $path) {
New-ItemProperty -Path $path -Name AllowInPrivate -PropertyType DWORD -Value 0 -Force
}else{
New-Item -Path $path -Force |
New-ItemProperty -Name AllowInPrivate -PropertyType DWORD -Value 0 -Force
@daurrutia
daurrutia / send-mailmessage.ps1
Created July 6, 2018 12:42
Send an email using PowerShell
##############################################################################
$From = "my_email@gmail.com"
$To = "your_email@yahoo.com.com"
$Cc = "friend_email@outlook.com"
#$Attachment = "C:\temp\Some file.txt"
$Subject = "Email Subject"
$Body = "Insert body text here"
$SMTPServer = "smtp.gmail.com"
$SMTPPort = "587"
@daurrutia
daurrutia / disable-incognitomode.ps1
Created June 25, 2018 15:12
Disables Google Chrome Incognito Mode on Microsoft Windows
# http://dev.chromium.org/administrators/policy-list-3#IncognitoModeAvailability
$path = 'HKLM:\SOFTWARE\Policies\Google\Chrome'
if (Test-Path $path) {
New-ItemProperty -Path $path -Name IncognitoModeAvailability -PropertyType DWORD -Value 1 -Force
}else{
New-Item -Path HKLM:\SOFTWARE\Policies\Google\Chrome\ -Force |
New-ItemProperty -Name IncognitoModeAvailability -PropertyType DWORD -Value 1 -Force
}