Skip to content

Instantly share code, notes, and snippets.

@myh-st
myh-st / who-is-in-play.yml
Created March 15, 2021 02:38 — forked from evrardjp/who-is-in-play.yml
block/rescue removes host from ansible_play_hosts when block fails, even when rescued!
---
- hosts: all
connection: local
gather_facts: no
tasks:
- debug:
var: ansible_play_hosts
- block:
- fail:
@myh-st
myh-st / curl.md
Created November 22, 2021 03:20 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@myh-st
myh-st / snat_dnat_advantech.md
Created June 21, 2022 06:45 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

@myh-st
myh-st / regex.md
Created October 18, 2022 05:26 — forked from debkanchan/regex.md
RegEx for Latitude and Longitude

Regular Expression(RegExp) for Latitude and Longitude

Just Latitude:

^-?([0-8]?[0-9]|90)(\.[0-9]{1,10})$

matches:

  • 56.3847
  • -56.387

unmatches:

@myh-st
myh-st / README.md
Created October 20, 2022 04:02 — forked from citizenrich/README.md
How to setup HAPI FHIR and Postgres in Docker

Start with a fresh folder and copy a hapi.properties into it. It will be mounted into the container.

Carefully make sure your hapi.properties looks like this:

# add postgres
datasource.driver=org.postgresql.Driver
datasource.url=jdbc:postgresql://db:5432/hapi
hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
datasource.username=admin
datasource.password=admin
@myh-st
myh-st / latitude_longitude.txt
Created October 21, 2022 02:54 — forked from pjobson/latitude_longitude.txt
Latitude / Longitude DMS, DDM, DD Regular Expressions
Degrees Minutes Seconds (DMS)
40° 26′ 46″ N 79° 58′ 56″ W
40° 26′ 46″ S 79° 58′ 56″ E
90° 0′ 0″ S 180° 0′ 0″ E
40° 26′ 45.9996″ N 79° 58′ 55.2″ E
Latitudes range from 0 to 90.
Longitudes range from 0 to 180.
Minutes & Seconds range from 0-60
Use N, S, E or W as either the last character,
which represents a compass direction North, South, East or West.
const SECRET_KEY = ENTER YOUR SECRET KEY HERE;
const MAX_TOKENS = 200;
// For more cool AI snippets and demos, follow me on Twitter: https://twitter.com/_abi_
/**
* Completes your prompt with GPT-3
*
* @param {string} prompt Prompt
* @param {number} temperature (Optional) Temperature. 1 is super creative while 0 is very exact and precise. Defaults to 0.4.