Skip to content

Instantly share code, notes, and snippets.

View dasgoll's full-sized avatar

dasgoll

  • Amman, Jordan
View GitHub Profile
@dasgoll
dasgoll / INSTALL.md
Last active March 4, 2019 21:28 — forked from johnmccabe/INSTALL.md
Installing Docker 1.12 on CentOS 6 / CentOS 7
yum -y update
yum -y install yum-utils
yum-config-manager --add-repo https://yum.dockerproject.org/repo/main/centos/7
yum -y update
# yum search --showduplicates docker-engine
yum -y --nogpgcheck install docker-engine-1.12.6-1.el7.centos.x86_64
service docker start
@dasgoll
dasgoll / BREW_OLD_FILES.md
Created February 25, 2019 07:13 — forked from johnmccabe/BREW_OLD_FILES.md
Installing/Using old releases with brew

Install Old Releases with Brew

If you need to install an old software release with brew you can do so as follows.

  1. Install the latest version of kubernetes-cli
brew install kubernetes-cli

This will install the latest release (currently 1.12.2) 2. Unlink the installed release so you can install an old version:

@dasgoll
dasgoll / install_source_command_line_tools.sh
Created March 1, 2019 23:26 — forked from guanting112/install_source_command_line_tools.sh
[macOS] SourceTree command line tools install script ( support 10.11, 10.12 )
#!/usr/bin/env bash
function link_stree {
ln -s /Applications/SourceTree.app/Contents/Resources/stree /usr/local/bin/
}
function install {
link_stree
}
@dasgoll
dasgoll / ctrr.md
Last active March 3, 2019 20:10 — forked from esmooov/ctrr.md
Carats and Tildes, Resets and Reverts

http://www.paulboxley.com/blog/2011/06/git-caret-and-tilde

Oh cool but what's 'HEAD^'

Carats and tildes are relative commit markers in Git. They both mean "parent" but in a different way.

Most commonly used, they are the same. HEAD^1 (or HEAD^ for short) is the same as HEAD1 (HEAD). Always.

The difference comes when they stack. So HEAD^2 means "The second parent of HEAD". This only means anything if there's been a merge. In a merge, the main branch is parent #1; the merged in branch is parent 2. So, HEAD^2 will be the merged parent, whereas HEAD^1 will be the parent merged into.

@dasgoll
dasgoll / USING-DIFFMERGE.md
Last active March 3, 2019 13:44 — forked from smoll/USING-DIFFMERGE.md
Using DiffMerge as your git mergetool (for Mac OS X / macOS)

Using DiffMerge as your git mergetool (for Mac OS X / macOS)

brew cask install diffmerge

Step 2: configure it

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd 'diffmerge "$LOCAL" "$REMOTE"'
git config --global merge.tool diffmerge
@dasgoll
dasgoll / django_deploy.md
Created April 24, 2019 20:09 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

#!/bin/sh
yum install -y curl ca-certificates
cat << EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
@dasgoll
dasgoll / greengrass.service
Created July 29, 2019 23:56 — forked from matthewberryman/greengrass.service
greengrass systemd
[Unit]
Description=greengrass daemon
After=network.target
[Service]
ExecStart=/greengrass/ggc/core/greengrassd start
Type=simple
RestartSec=2
Restart=always
User=root
@dasgoll
dasgoll / gist:97ff786f3b13b3afeb2fde74e6a63ca2
Last active August 19, 2019 22:15 — forked from lakshmantgld/General Description
Lambda-Proxy vs Lambda Integration in AWS API Gateway
╔═════════════════════════════════════════════════════╦════════════════════════════════════════════════════════════╗
║ Lambda-Proxy ║ Lambda ║
╠═════════════════════════════════════════════════════╬════════════════════════════════════════════════════════════╣
║ This is a simple, but powerful integration. All the ║ This is complex, but offers more control over transmission ║
║ request to the APIGateway URL is forwarded ║ data. The request can be modified before it is ║
║ straight to the Lambda and the response is sent ║ sent to lambda and the response can be modified ║
║ from Lambda. i.e No modifications to the ║ after it is sent from lambda. This can be done by ║
║ request(query params, body, variables) and ║ mapping templates which transforms the payload, as per ║
║ response(status code, message) are done ║ the user customisations. API Gat
@dasgoll
dasgoll / k3s-multipass.sh
Created February 24, 2020 06:12 — forked from lucj/k3s-multipass.sh
Setup a k3s kubernetes cluster using Multipass VMs
for node in node1 node2 node3;do
multipass launch -n $node
done
# Init cluster on node1
multipass exec node1 -- bash -c "curl -sfL https://get.k3s.io | sh -"
# Get node1's IP
IP=$(multipass info node1 | grep IPv4 | awk '{print $2}')