Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

abdennour abdennour

🌴
On vacation
View GitHub Profile
View docker-compose.yml
version: "3"
networks:
chat:
services:
# Launch the Redis used for syncing messages between copies of the client app
redis:
image: redis
networks:
- chat
@SWBSanjeewa
SWBSanjeewa / jenkins-docker-compose
Created Aug 22, 2017
Run jenkins master and slave using docker compose
View jenkins-docker-compose
Master - jenkins-master-docker-compose.yml
jenkins_app:
image: jenkins:2.60.1
container_name: jenkins_master
restart: always
ports:
- "80:8080"
@7rin0
7rin0 / gist:ea890d2d4bf25a890b86aff01290e7d0
Created Mar 3, 2017
Docker exec root or default user
View gist:ea890d2d4bf25a890b86aff01290e7d0
# Root.
$ docker exec -u 0 i -t {container_id/image_name} bash
or
# Default container's user.
$ docker exec i -t {container_id/image_name} bash
View kubeadm-ubuntu-1604
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y docker.io kubelet kubeadm kubectl kubernetes-cni
@chusiang
chusiang / cloudfront_create_invalidation_policy.json
Last active Oct 9, 2020
AWS IAM policy of CloudFront Create Invalidation
View cloudfront_create_invalidation_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::MyBucketName"
},
{
"Action": [
@stvvt
stvvt / manage-etc-hosts.sh
Last active Sep 26, 2018 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
View manage-etc-hosts.sh
#!/usr/bin/env bash
set -eu
# PATH TO YOUR HOSTS FILE
: ${ETC_HOSTS="/etc/hosts"}
# DEFAULT IP FOR HOSTNAME
DEFAULT_IP="127.0.0.1"
@lenaten
lenaten / gist:96f7102c92b3a7d59a50
Last active Dec 6, 2017
Hosting React app in s3 with CloudFront
View gist:96f7102c92b3a7d59a50
- create s3 bucket, for example: react.
- create cloudfront distributions with these settings:
- Default Root Object: index.html
- Origin Domain Name: s3 bucket url, for example: react.s3.amazonaws.com
- add custom error page with these settings:
- HTTP Error Code: 403: Forbidden
- Customize Error Response: Yes
- Response Page Path: /index.html
- HTTP Response Code: 200: OK
@PurpleBooth
PurpleBooth / README-Template.md
Last active Jan 28, 2021
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@melvincabatuan
melvincabatuan / kill 7591
Created May 19, 2015
[SOLVED] Annoying 'Another app is currently holding the yum lock'
View kill 7591
# yum localinstall redhat*
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 7591.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
Memory : 39 M RSS (348 MB VSZ)
Started: Tue May 19 17:04:57 2015 - 06:29 ago
State : Sleeping, pid: 7591
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: PackageKit
@vgeshel
vgeshel / function.js
Last active Nov 10, 2020
AWS Lambda function for forwarding SNS notifications to Slack
View function.js
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};