Skip to content

Instantly share code, notes, and snippets.

@Alexhha
Alexhha / main.tf
Created Jul 13, 2019
terraform-aws-ha-ansible-inventory
View main.tf
provider "aws" {
version = "~> 2.0"
profile = "personal"
region = "${var.region}"
}
data "aws_availability_zones" "healthy_zones" {
state = "available"
}
View install-openjdk.ps1
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
$url = "https://github.com/ojdkbuild/ojdkbuild/releases/download/11.0.3-1/java-11-openjdk-11.0.3.7-1.windows.ojdkbuild.x86_64.msi"
$file = "C:\Users\alex\Downloads\java-11-openjdk-11.0.3.7-1.windows.ojdkbuild.x86_64.msi"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
$installJava = (Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:\Users\alex\Downloads\java-11-openjdk-11.0.3.7-1.windows.ojdkbuild.x86_64.msi /quiet" -Wait -Passthru).ExitCode
Write-VerboseLog "Install Java code $installJava."
@Alexhha
Alexhha / main.tf
Created Apr 22, 2019
terraform-aws-dynamic-ami-id.tf
View main.tf
data "aws_ami" "linux_ami" {
most_recent = true
owners = ["${element(split(";", var.ami_id_filter[var.linux_distro]), 1)}"]
filter {
name = "name"
values = ["${element(split(";", var.ami_id_filter[var.linux_distro]), 0)}"]
}
filter {
View etcd-v2.json
{
"action": "get",
"node": {
"dir": true,
"nodes": [{
"key": "/eplus-etcd-test",
"dir": true,
"nodes": [{
"key": "/eplus-etcd-test/edge",
"dir": true,
View gist:896e312b8999406e3f32b63bb2be2b47
FROM base/archlinux:latest
MAINTAINER Tiago de Paula Peixoto <tiago@skewed.de>
RUN echo 'Server=https://archive.archlinux.org/repos/2017/11/23/$repo/os/$arch' > /etc/pacman.d/mirrorlist
#RUN pacman-key --refresh-keys
RUN pacman -Syu --noconfirm
RUN pacman -S binutils make gcc patch fakeroot --noconfirm --needed
RUN pacman -S expac yajl git --noconfirm --needed
RUN pacman -S sudo grep file --noconfirm --needed
View nginx-ssl.conf
server {
listen 443 ssl;
server_name staging.example.com;
charset utf-8;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
View grap-pypi-packages-download-url.sh
#!/bin/bash
for package_name in {a..z}
do
for page in {1..25}
do
curl -s "https://pypi.org/search/?q=${package_name}&page=${page}" \
| grep -o -E 'href="/project/.*' | cut -d '>' -f1 | cut -d '"' -f2 \
| sed -r 's|(.*)|https://pypi.org/\1#files|' \
| while read curr_line
View jenkins-pipeline-exit-from-job
try {
node('master'){
stage('STAGE1'){
echo 'EXECUTE STAGE1'
}
stage('STAGE2'){
echo 'EXECUTE STAGE2'
}
View extract-n-files-from-zip.sh
#!/bin/bash
PATH_PREFIX=/opt/upload/10k
zipinfo -1 100k.zip | grep -v /$ | head -10000 | while read curr_file
do
curr_dir=$(dirname ${curr_file})
if [[ ! -d ${PATH_PREFIX}/${curr_dir} ]]; then
mkdir -p ${PATH_PREFIX}/${curr_dir}
View mozLz4.py
import sys
from lz4.block import compress as lz4_compress
from lz4.block import decompress as lz4_decompress
from argparse import ArgumentParser
class MozLz4aError(Exception):
pass
You can’t perform that action at this time.