Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / DellXPS15_9560_AHCI_RAID.md
Created March 8, 2021 12:05 — forked from chenxiaolong/DellXPS15_9560_AHCI_RAID.md
Switching between AHCI and RAID on the Dell XPS 15 (9560)

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
@myh-st
myh-st / tower-cli.txt
Created February 3, 2021 08:34
export/import awx inventory
pip install ansible-tower-cli
tower-cli config username admin
tower-cli config password <PASSWORD>
tower-cli config verify_ssl False
tower-cli config
tower-cli job list
tower-cli config host http://<IP>:80
## Backup AWX all objects ##
@myh-st
myh-st / a-pure-css-game-you-must-build-a-lighthouse.markdown
Created October 30, 2020 11:50
A Pure CSS Game - You Must Build a Lighthouse.
@myh-st
myh-st / sshPemKey.md
Last active October 30, 2020 04:30 — forked from rxm/sshPemKey.md
Create an SSH key in PEM format

Create an SSH key in PEM format

I have not been able to use ssh-keygen -e to reliably generate a private key for SSH in PEM format. This format is sometimes used by commercial products. Instead, I had to convert the key using openssl.

# generate an RSA key of size 2048 bits
ssh-keygen -t rsa -b 2048 -f azure -C 'azure-dev'

# copy key to x.x.x.x and add to authorized_keys
@myh-st
myh-st / wait-es.sh
Created October 6, 2020 08:58
wait for elasticseach service up
#!/bin/bash
# short code #
ESHOST="elastic" ; timeout 300 bash -c "until curl --silent --output /dev/null http://$ESHOST:9200/_cat/health?h=st; do printf '.' sleep 5; done; printf '\n'"
@myh-st
myh-st / get_macs.yml
Created September 16, 2020 09:43 — forked from tbondarchuk/get_macs.yml
Ansible: Get mac addresses of all interfaces except local
---
- hosts: all
tasks:
- name: Get mac addresses of all interfaces except local
debug:
msg: "{{ ansible_interfaces | difference(['lo']) | map('regex_replace', '^(.*)$', 'ansible_\\1' ) | map('extract', hostvars[inventory_hostname], 'macaddress') | list }}"
@myh-st
myh-st / gist:55995751003e056bac939b10952c774d
Created September 10, 2020 07:01 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@myh-st
myh-st / centos_install_ngrok.sh
Created September 3, 2020 03:06 — forked from davidneelin/centos_install_ngrok.sh
a script that auto install ngrok in centos
#!/bin/bash
if [[ $# -lt 1 ]]; then
echo "usage: $0 domain"
exit 0
else
domain=$1
echo "domain is ${domain}"
fi