Skip to content

Instantly share code, notes, and snippets.

@aabed
aabed / test
Created April 4, 2012 15:56
test
test
Nov 11 16:12:19 localhost docker: time="2015-11-11T16:12:19.206810112Z" level=info msg="GET /v1.20/containers/ubuntu:latest/json"
Nov 11 16:12:19 localhost docker: time="2015-11-11T16:12:19.206950720Z" level=error msg="Handler for GET /containers/{name:.*}/json returned error: no such id: ubuntu:latest"
Nov 11 16:12:19 localhost docker: time="2015-11-11T16:12:19.206969206Z" level=error msg="HTTP Error" err="no such id: ubuntu:latest" statusCode=404
Nov 11 16:12:19 localhost docker: time="2015-11-11T16:12:19.207164087Z" level=info msg="GET /v1.20/images/ubuntu:latest/json"
Nov 11 16:12:19 localhost docker: time="2015-11-11T16:12:19.207198585Z" level=error msg="Handler for GET /images/{name:.*}/json returned error: No such image: ubuntu:latest"
Nov 11 16:12:19 localhost docker: time="2015-11-11T16:12:19.207212218Z" level=error msg="HTTP Error" err="No such image: ubuntu:latest" statusCode=404
Nov 11 16:12:19 localhost docker: time="2015-11-11T16:12:19.333841339Z" level=info msg="POST /v1.20/images/create?fromIm
FROM python:2.7-alpine
RUN wget https://releases.hashicorp.com/envconsul/0.6.1/envconsul_0.6.1_linux_amd64.zip&&unzip envconsul_0.6.1_linux_amd64.zip\
&& ln -sf $PWD/envconsul /usr/local/bin
ADD app.py /app.py
ADD requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
ENTRYPOINT envconsul -consul 172.17.0.2:8500 -prefix $PREFIX python /app.py
FROM python:2.7-alpine
RUN wget https://releases.hashicorp.com/envconsul/0.6.1/envconsul_0.6.1_linux_amd64.zip&&unzip envconsul_0.6.1_linux_amd64.zip\
&& ln -sf $PWD/envconsul /usr/local/bin
ADD app.py /app.py
ADD requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
ENTRYPOINT envconsul -consul 172.17.0.2:8500 -prefix $PREFIX python /app.py
FROM python:2.7-alpine
RUN wget https://releases.hashicorp.com/envconsul/0.6.1/envconsul_0.6.1_linux_amd64.zip&&unzip envconsul_0.6.1_linux_amd64.zip\
&& ln -sf $PWD/envconsul /usr/local/bin
ADD app.py /app.py
ADD requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
ENTRYPOINT ["envconsul","-consul", "myconsulserver.example.com","-prefix","/"]
CMD ["python","/app.py"]
FROM python:2.7-alpine
ADD envconsul /usr/bin
ADD app.py /app.py
ADD requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
ENTRYPOINT ["envconsul","-consul", "myconsulserver.example.com","-prefix","/"]
CMD ["python","/app.py"]
@aabed
aabed / ipassign
Created November 8, 2017 11:34 — forked from jsianes/ipassign
Script to assign Public IP from Elastic IP pool for instances hosted in AWS. 'ec2-utils' and AWS CLI packages required. Instance role or access keys need to allow at least next EC2 actions: describe-addresses, associate-address and disassociate-address. Shell script is designed to be integrated with instance start-up
#!/bin/bash
# chkconfig: 2345 99 10
# description: Set Public IP from ElasticIP pool during instance startup
# processname: ipassign
# Provides: ipassign
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Set Public IP from ElasticIP pool during instance startup
@aabed
aabed / emoji-unicode-ranges
Created March 18, 2020 18:22
emoji unicode ranges
unicode_ranges=[('0x23', '0x24'), ('0x2a', '0x2b'), ('0x30', '0x3a'), ('0xa9', '0xaa'), ('0xae', '0xaf'), ('0x200d', '0x200e'), ('0x203c', '0x203d'), ('0x2049', '0x204a'), ('0x20e3', '0x20e4'), ('0x2122', '0x2123'), ('0x2139', '0x213a'), ('0x2194', '0x219a'), ('0x21a9', '0x21ab'), ('0x231a', '0x231c'), ('0x2328', '0x2329'), ('0x2388', '0x2389'), ('0x23cf', '0x23d0'), ('0x23e9', '0x23f4'), ('0x23f8', '0x23fb'), ('0x24c2', '0x24c3'), ('0x25aa', '0x25ac'), ('0x25b6', '0x25b7'), ('0x25c0', '0x25c1'), ('0x25fb', '0x25ff'), ('0x2600', '0x2605'), ('0x260e', '0x260f'), ('0x2611', '0x2612'), ('0x2614', '0x2616'), ('0x2618', '0x2619'), ('0x261d', '0x261e'), ('0x2620', '0x2621'), ('0x2622', '0x2624'), ('0x2626', '0x2627'), ('0x262a', '0x262b'), ('0x262e', '0x2630'), ('0x2638', '0x263b'), ('0x2640', '0x2641'), ('0x2642', '0x2643'), ('0x2648', '0x2654'), ('0x265f', '0x2661'), ('0x2663', '0x2664'), ('0x2665', '0x2667'), ('0x2668', '0x2669'), ('0x267b', '0x267c'), ('0x267e', '0x2680'), ('0x2692', '0x2698'), ('0x2699', '0x26
@aabed
aabed / dirty_sg_scanner.py
Last active August 23, 2020 13:56
dirty_sg_scanner
import boto3
response = ec2.describe_security_groups()
groups=set()
for sg in response.get('SecurityGroups'):
for rule in sg.get('IpPermissions'):
for cidr in rule.get('IpRanges'):
if cidr.get('CidrIp') == '0.0.0.0/0':
groups.add(sg.get('GroupId'))
print(groups)
@aabed
aabed / replay.sh
Created May 14, 2021 13:38
Test Github Actions With Force Push
function replay() {
git add .;git commit --amend -m "testing pipeline";git push origin $(git branch --show-current) -f;sleep 5;gh run list | grep $(git branch --show-current)| head -n1 |awk '{print $NF}' |xargs -I {} gh run view {} | tail -1
}