Skip to content

Instantly share code, notes, and snippets.

View tangingw's full-sized avatar

Mobieus Jay tangingw

View GitHub Profile
@tangingw
tangingw / github-action-ssh.md
Last active May 28, 2024 07:37 — forked from raviagheda/github-action-ssh.md
Github Action with EC2 using SSH
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@tangingw
tangingw / json2yaml.py
Created March 28, 2020 09:58 — forked from noahcoad/json2yaml.py
Python to convert json to yaml
#!/usr/bin/env python3
# convert json to yaml
# http://pyyaml.org/wiki/PyYAMLDocumentation
# python3 json2yaml.py < ~/code/manpow/moneybug/mbuploader/support/offices.json
# gist https://gist.github.com/noahcoad/46909253a5891af3699580b8f17baba8
import yaml, json, sys
sys.stdout.write(yaml.dump(json.load(sys.stdin)))
@tangingw
tangingw / install_ensurepip.py
Created November 15, 2017 07:46 — forked from uranusjr/install_ensurepip.py
Script to install ensurepip to Python. “Fix” the Ubuntu 14.04 / Debian Sid bug. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732703
import os
import sys
import io
import tarfile
import urllib.request
ARCHIVE_URL = 'http://d.pr/f/YqS5+'