Skip to content

Instantly share code, notes, and snippets.

View abdennour's full-sized avatar
On vacation

abdennour abdennour

On vacation
View GitHub Profile
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
soarez /
Last active June 19, 2024 19:32
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

bradrydzewski /
Last active May 27, 2024 15:59
Generate trusted CA certificates for running Docker with HTTPS
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
# See
# To start the Docker Daemon:
# sudo docker -d \
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 = '';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
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/ 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
PurpleBooth /
Last active June 20, 2024 01:55
A template to make good

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.


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:
- 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 /
Last active September 26, 2018 05:00 — forked from irazasyed/
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/usr/bin/env bash
set -eu
: ${ETC_HOSTS="/etc/hosts"}
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": [
curl | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb kubernetes-xenial main
apt-get update
apt-get install -y kubelet kubeadm kubectl kubernetes-cni