Skip to content

Instantly share code, notes, and snippets.

View david2331's full-sized avatar

David Cheong david2331

View GitHub Profile
@styblope
styblope / docker-api-port.md
Last active June 7, 2024 15:21
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@marktopper
marktopper / install.md
Last active March 24, 2023 14:49
Install Kong + Cassandra + Java [Ubuntu 14.04]

Installing Java

We need Java in order to have Cassandra running since Cassandra 2.0 and later require Java 7 or later. And we need Cassandra in order to run Kong.

So lets start installing Java 8 (the newest one)

First we add a repository to our build in order to manage the Java 8 package, since that is not normally supported by Ubuntu.

sudo add-apt-repository ppa:webupd8team/java
@Iman
Iman / clean.sh
Last active June 16, 2024 07:27
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@mortn
mortn / geoblocker
Last active April 24, 2024 16:55
nginx geoip blocking with network exceptions.
# /etc/nginx/geoblocker
# This will block anything but the defined countries and the networks defined in the $localnet variable
set $geoblock 0;
if ($geoip_country_code !~ (DK|NO|SE)) { set $geoblock 1; }
if ($localnet = 1){ set $geoblock 0; }
if ($geoblock = 1){ return 403; }
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert