Skip to content

Instantly share code, notes, and snippets.

View Dzmuh's full-sized avatar
🙃
get crazy

Ilya Fralkou Dzmuh

🙃
get crazy
View GitHub Profile
@Dzmuh
Dzmuh / Resolve-KnownFolderGUID
Created October 27, 2024 04:02 — forked from davehull/Resolve-KnownFolderGUID
Need to resolve a Windows "known folder guid" to it's human-readable value?
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$GUID
)
function Resolve-KnownFolderGuid {
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$GUID
@Dzmuh
Dzmuh / mkicon
Created October 22, 2024 00:10 — forked from brunocastello/mkicon
Bash Shell Script to generate ICNS files for macOS
#!/bin/bash
rm -R $2.iconset
mkdir $2.iconset
sips -z 16 16 "$1" --out $2.iconset/icon_16x16.png
sips -z 32 32 "$1" --out $2.iconset/[email protected]
sips -z 32 32 "$1" --out $2.iconset/icon_32x32.png
sips -z 64 64 "$1" --out $2.iconset/[email protected]
sips -z 128 128 "$1" --out $2.iconset/icon_128x128.png
sips -z 256 256 "$1" --out $2.iconset/[email protected]
sips -z 256 256 "$1" --out $2.iconset/icon_256x256.png
// ==UserScript==
// @name Zerkalo Cleaner
// @description Clear the zerkalo.io layout for easy print and save.
// @description:ru Очищает макет zerkalo.io для простой печати или сохранения.
// @namespace zerkalo.io
// @match https://news.zerkalo.io/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @version 0.0.3
// @author Dzmuh
// @license MIT
// ==UserScript==
// @name habr-cleaner
// @description Clear the Habr.com layout for easy save.
// @description:ru Очищает макет Habr.com для простого компактного сохранения.
// @namespace habr
// @match https://habr.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @version 1.2
// @author Nikolay Raspopov
// @license MIT
@Dzmuh
Dzmuh / poland-consult-cleaner.user.js
Last active July 27, 2024 01:09
poland-consult.com cleaner
// ==UserScript==
// @name poland-consult-cleaner
// @namespace poland-consult.com
// @version 0.0.2
// @description Clear the poland-consult.com layout for easy print. WIP.
// @description:ru Очищает макет poland-consult.com для простой печати или сохранения.
// @updateURL https://gist.github.com/Dzmuh/505958e87fe51a1b0774da06e1f71007/raw/poland-consult-cleaner.user.js
// @downloadURL https://gist.github.com/Dzmuh/505958e87fe51a1b0774da06e1f71007/raw/poland-consult-cleaner.user.js
// @author Dzmuh
// @match https://poland-consult.com/*
@Dzmuh
Dzmuh / youtube-vanced-alternatives.md
Created March 20, 2022 19:05 — forked from SkyyySi/youtube-vanced-alternatives.md
A list of alternatives after the shutdown of Vanced

NONE OF THESE CLIENTS ARE VERIFIED BY ME FOR SECURITY OR ANYTHING ELSE! USE AT YOUR OWN RISK!

These are the current alternatives (with links when possible):

@Dzmuh
Dzmuh / .. MediaCreationTool.bat .md
Created December 27, 2020 03:53 — forked from AveYo/.. MediaCreationTool.bat ..md
Universal MediaCreationTool wrapper for all MCT Windows 10 versions from 1507 to 20H2 with business (Enterprise) edition support

Preview1 Preview2

2018.10.10: reinstated 1809 [RS5]! using native xml patching for products.xml; fixed syntax bug with exit/b
2018.10.12: added data loss warning for RS5
2018.11.13: RS5 is officially back! + greatly improved choices dialog - feel free to use the small snippet in your own scripts
2019.05.22: 1903 [19H1]
2019.07.11: 1903 __release_svc_refresh__ and enable DynamicUpdate by default to grab latest CU
2019.09.29: UPDATED 19H1 build 18362.356 ; RS5 build 17763.379 and show build number
@Dzmuh
Dzmuh / ansible-do-create-dns.yaml
Created September 14, 2020 00:08
Создаю DNS запись для домена в DO используя Ansible
---
- hosts: localhost
vars:
do_oauth_token: "{{ lookup('env','DO_OAUTH_TOKEN') }}"
do_oauth_rw_token: "{{ lookup('env','DO_OAUTH_RW_TOKEN') }}"
tasks:
- name: Create a DNS domain
# Регистрирую домен
digital_ocean_domain:
state: present
################################################################
# Global configuration
################################################################
global:
checkNewVersion: true
sendAnonymousUsage: true
################################################################
# Entrypoints configuration

Loading variables from .env files in Ansible

Ansible has various ways of looking up data from outside sources, including plain text password files, CSV files and INI files. But it doesn't seem to have a lookup for .env files, as used in Laravel projects, also available for PHP, Ruby, Node.js, Python and others.

One option is to launch Ansible with the Ruby dotenv command line script... But that requires Ruby, which seems like overkill to me.

So here is a simpler solution that I use. It consists of:

  1. The .env file itself
  2. A small shell script that loads the .env file into environment variables - ansible-playbook.sh