24
Band of Brothers
Breaking Bad
Dexter
Golaith
Friends
HIMYM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################### | |
# WARNING: Don't use this on production environments | |
#################################################### | |
# Login to psql terminal with postgres user | |
psql -U postgres | |
DROP ROLE root; # Run this if role root already exists | |
CREATE ROLE root WITH SUPERUSER LOGIN PASSWORD NULL; | |
createdb root; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NullStorage provider for CarrierWave for use in tests. Doesn't actually | |
# upload or store files but allows test to pass as if files were stored and | |
# the use of fixtures. | |
class NullStorage | |
attr_reader :uploader | |
def initialize(uploader) | |
@uploader = uploader | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone <git-url> <dest-dir> | |
cd <dest-dir> | |
git checkout tags/$(git tag -l | tail -1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Building rails-base image for the rubyapp | |
FROM phusion/passenger-ruby22 | |
MAINTAINER Pradeep "[email protected]" | |
# Set correct environment variables. | |
ENV HOME /root | |
# Use baseimage-docker's init process. | |
CMD ["/sbin/my_init"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Init project settings | |
$ gcloud config set project PROJECT_ID | |
$ gcloud config set compute/zone us-east1-b | |
$ export PROJECT_ID=your-project-id-here | |
# Build docker image and push it to gcr.io | |
$ docker build -t gcr.io/${PROJECT_ID}/<project-name> . | |
Then push this image to the Google Container Registry: | |
$ gcloud docker push gcr.io/${PROJECT_ID}/<project-name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Serve the MySQL database (destination db) | |
taps server mysql://<user>:<pass>@localhost/<database> user1 pass123 | |
# Push the schema and the records of the database to destination db | |
taps push postgres://<user>:<pass>@localhost/<database> http://user1:pass123@localhost:5000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dockerfile | |
# Using phusion passenger as base image. | |
# Refer - https://github.com/phusion/passenger-docker | |
FROM phusion/passenger-ruby22:latest | |
MAINTAINER Pradeep <[email protected]> | |
# Set ENV variables | |
ENV HOME /rubyapp/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Encode .env file values to base64 and create json key values | |
require 'base64' | |
require 'yaml' | |
if ARGV[0] | |
env = {} | |
file = File.new(ARGV[0], "r") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: readonly-pod | |
spec: | |
containers: | |
- name: readonly-pod | |
image: nginx | |
volumeMounts: | |
- mountPath: /etc/secrets |