Skip to content

Instantly share code, notes, and snippets.

Alexhha

Block or report user

Report or block Alexhha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
View serverfault-questions-888921
FROM centos:7
MAINTAINER Brian Ogden
# Not currently being used but may come in handy
ARG ENVIRONMENT
ENV NODE_VERSION 6.11.1
RUN yum -y update \
&& yum clean all \
&& yum -y install http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm \
View bash-function.sh
#!/bin/bash
http_code=0
function result_handling {
case "${http_code}" in
"401" | "403" | "404" )
echo "Error: httpd code ${http_code}"
;;
"200" | "301" )
You can’t perform that action at this time.