Skip to content

Instantly share code, notes, and snippets.

View abdennour's full-sized avatar
🌴
On vacation

abdennour abdennour

🌴
On vacation
View GitHub Profile
@melvincabatuan
melvincabatuan / kill 7591
Created May 19, 2015 09:14
[SOLVED] Annoying 'Another app is currently holding the yum lock'
# 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
@lenaten
lenaten / gist:96f7102c92b3a7d59a50
Last active December 6, 2017 10:59
Hosting React app in s3 with CloudFront
- 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
@stvvt
stvvt / manage-etc-hosts.sh
Last active September 26, 2018 05:00 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/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"
version: "3"
networks:
chat:
services:
# Launch the Redis used for syncing messages between copies of the client app
redis:
image: redis
networks:
- chat
@7rin0
7rin0 / gist:ea890d2d4bf25a890b86aff01290e7d0
Created March 3, 2017 01:52
Docker exec root or default user
# 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
@vgeshel
vgeshel / function.js
Last active February 9, 2022 09:19
AWS Lambda function for forwarding SNS notifications to Slack
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'};
@SWBSanjeewa
SWBSanjeewa / jenkins-docker-compose
Created August 22, 2017 05:53
Run jenkins master and slave using docker compose
Master - jenkins-master-docker-compose.yml
jenkins_app:
image: jenkins:2.60.1
container_name: jenkins_master
restart: always
ports:
- "80:8080"
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
@bitmvr
bitmvr / example--parse-semver-with-bash.sh
Last active January 6, 2024 14:02
Parsing SemVer with Bash
#!/usr/bin/env bash
VERSION="$1"
VERSION="${VERSION#[vV]}"
VERSION_MAJOR="${VERSION%%\.*}"
VERSION_MINOR="${VERSION#*.}"
VERSION_MINOR="${VERSION_MINOR%.*}"
VERSION_PATCH="${VERSION##*.}"
echo "Version: ${VERSION}"
@chusiang
chusiang / cloudfront_create_invalidation_policy.json
Last active January 30, 2024 13:15
AWS IAM policy of CloudFront Create Invalidation
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::MyBucketName"
},
{
"Action": [