Skip to content

Instantly share code, notes, and snippets.

View df-a's full-sized avatar
🎯
Focusing

df-a

🎯
Focusing
View GitHub Profile
@df-a
df-a / README.md
Created August 21, 2024 22:20 — forked from antonydevanchi/README.md
octodns + octodns-lexicon + dns-lexicon — automation tool for 91 DNS Provider

Yandex.PDD Setup

Install

mkdir workspace; cd workspace

pipenv install; pipenv shell
@df-a
df-a / PowerShell Customization.md
Last active July 19, 2024 20:52 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@df-a
df-a / pending-updates.ps1
Created March 26, 2024 01:44 — forked from Grimthorr/pending-updates.ps1
PowerShell script to list the pending/missing Windows updates.
$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateupdateSearcher()
$Updates = @($UpdateSearcher.Search("IsHidden=0 and IsInstalled=0").Updates)
$Updates | Select-Object Title
@df-a
df-a / security.conf
Created February 9, 2024 19:05 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
@df-a
df-a / Time Servers with NTS support.md
Created October 16, 2023 19:03 — forked from jauderho/Time Servers with NTS support.md
A curated list of NTP time servers that support NTS
@df-a
df-a / Top_Public_Time_Servers.md
Created August 23, 2023 13:18 — forked from mutin-sa/Top_Public_Time_Servers.md
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@df-a
df-a / git-submodules.md
Created May 8, 2023 02:43
Git submodule commands

To fetch Git modules, you can use the following command:

git submodule update --init --recursive

This command will initialize and update any submodules defined in the Git repository. It will clone the submodules if they have not already been cloned, or update them to the latest commit if they have already been cloned.

If the repository has nested submodules, you may need to use the --recursive option to ensure that all submodules are updated.

@df-a
df-a / nginx_libressl.sh
Created May 1, 2023 00:23 — forked from nshtg/nginx_libressl.sh
Build nginx statically against modern OpenSSL/LibreSSL
#!/usr/bin/env bash
set -e
# names of latest versions of each package
export NGINX_VERSION=1.13.5
export VERSION_ZLIB=zlib-1.2.11
export VERSION_PCRE=pcre-8.41
export VERSION_LIBRESSL=libressl-2.6.1
export VERSION_NGINX=nginx-$NGINX_VERSION

OpenSSL Directory Structure

/opt
    └── ssl
        ├── bin
        ├── include
        │   └── openssl
        ├── lib64
 │   ├── engines-3
@df-a
df-a / ansible-ssh-keepalive.md
Last active March 10, 2023 12:35
Keep Ansible connection alive

The SSH keepalive value determines how often an idle SSH connection will send a message to the remote host to keep the connection alive. If the connection is idle for longer than the keepalive value, the connection will be closed.

To prevent Ansible from hanging due to idle SSH connections, it is recommended to set an appropriate SSH keepalive value. A common value for this parameter is 60 seconds. This value can be set in the ssh_args parameter in your Ansible inventory file, like this:

ansible_ssh_common_args='-o ServerAliveInterval=60'

Alternatively, you can set this value in your SSH configuration file (~/.ssh/config) using the following syntax: