Skip to content

Instantly share code, notes, and snippets.

@bcooksey
bcooksey / dshell
Last active August 20, 2020 15:35
dshell: A little wrapper around the docker-compose run command that intelligently gets you a shell inside a container
#!/bin/bash
if [ ! -z $1 ]; then
MATCHER=$1
else
# Try to guess the project based on directory name
MATCHER=`pwd | sed 's/\/.*\///'`
fi
echo "Looking for web container named '$MATCHER'..."
@CrazyMath
CrazyMath / models.py
Last active June 27, 2020 21:06
Singleton Model
from django.db import models
from django.core.cache import cache
class SingletonModel(models.Model):
class Meta:
abstract = True
def delete(self, *args, **kwargs):
pass
@kosyfrances
kosyfrances / self_signed_ssl.md
Last active August 26, 2024 16:30
How to create self signed SSL certificate on Nginx for Ubuntu 14.04

Create the SSL certificate -
Let us make a directory to store all our ssl configuration.

sudo mkdir /etc/nginx/ssl

Next, create the key -

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt

These options will create both a key file and a certificate.

@kosyfrances
kosyfrances / nginx_virtual_host.md
Last active August 19, 2017 19:39
How To SetUp NGINX VirtualHosts on Ubuntu 14.04

#Set up nginx virtual host on Ubuntu 14.04

In this example, we will create a website called devops.com and create site to publish "Hello World!"
We are assuming you have nginx installed. If not, follow the steps here to install nginx .   We want to make the necessary directories in /var/www folder.

sudo mkdir -p /var/www/devops.com/httpdocs

And we want to write Hello world! in Index.html file.

@kosyfrances
kosyfrances / ubuntu_mac_file_share.md
Last active March 16, 2016 10:02
Access shared folder on mac from ubuntu Linux

Share the folder on your mac as usual.

On ubuntu, set up Samba client.
sudo apt-get install cifs-utils samba-common samba winbind

To mount up partner
First, let’s create a directory to attach our Mac share to:
sudo mkdir -p /mnt/tmpshare
…and now connect our share to that new directory:

@sr75
sr75 / wget-jdk-oracle-install-example.txt
Last active March 16, 2023 11:28
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu