Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:
sysctl -a | grep machdep.cpu.features | grep VMX
If there's output, you're good!
FROM php:7.2.11-fpm | |
WORKDIR /application | |
ENV ACCEPT_EULA=Y | |
# Fix debconf warnings upon build | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Install selected extensions and other stuff | |
RUN apt-get update \ |
/* | |
Before Septemper 15 2018, Vietnam has phone number start with 09*, 01(2|6|8|9). | |
After that, the phone number can start with 03, 05, 07 or 08. | |
So this function provide a way to validate the input number is a Vietnamese phone number | |
*/ | |
function isVietnamesePhoneNumber(number) { | |
return /(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number); | |
} |
// javascript jpeg decoder: https://github.com/eugeneware/jpeg-js/blob/79c4c7ea876d2e7b46981a563fcc4ae8f9e19849/lib/decoder.js | |
// Determine the JPEG compression quality from the quantization tables: https://github.com/ImageMagick/ImageMagick/blob/59f28acff016f6ae5e8b7e6300bcdf97e94affc9/coders/jpeg.c#L879 | |
// JPEG File Layout and Format: http://vip.sugovica.hu/Sardi/kepnezo/JPEG%20File%20Layout%20and%20Format.htm | |
// jpeg constants: https://github.com/LuaDist/libjpeg/blob/6c0fcb8ddee365e7abc4d332662b06900612e923/jpeglib.h#L45 | |
function getQuantizationTables(data) { | |
var quantizationTables = [] | |
var dctZigZag = new Int32Array([ |
- name: Install Conda | |
block: | |
- name: Download Miniconda | |
get_url: | |
url: https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh | |
dest: /tmp/install-miniconda.sh | |
checksum: md5:a946ea1d0c4a642ddf0c3a26a18bb16d | |
mode: 0550 | |
- name: Create conda folder |
import boto3 | |
import base64 | |
if __name__ == '__main__': | |
session = boto3.session.Session() | |
kms = session.client('kms') | |
encrypted_password = 'AQECAHjgTiiE7TYRGp5Irf8jQ3HzlaQaHGYgsUJDaavnHcFm0gAAAGswaQYJKoZIhvcNAQcGoFwwWgIBADBVBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDwxVQuG0oVwpkU7nQIBEIAoVGk1/wpserb+GVUOzE7PiL/Nr9fTDFKZfpKpF0ip2ct4B2q0Wn6ZZw==' | |
binary_data = base64.b64decode(encrypted_password) |
# This is free and unencumbered software released into the public domain. | |
# | |
# Anyone is free to copy, modify, publish, use, compile, sell, or | |
# distribute this software, either in source code form or as a compiled | |
# binary, for any purpose, commercial or non-commercial, and by any | |
# means. | |
# | |
# In jurisdictions that recognize copyright laws, the author or authors | |
# of this software dedicate any and all copyright interest in the | |
# software to the public domain. We make this dedication for the benefit |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
{ | |
"require": { | |
"mfacenet/hello-world": "v1.*" | |
} | |
} |
Sometimes you want to retrieve EC2 insntances' region information.
You can query that information through instance metadata(169.254.169.254).
$ curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document
{
"privateIp" : "172.31.2.15",
"instanceId" : "i-12341ee8",
"billingProducts" : null,
"instanceType" : "t2.small",