Skip to content

Instantly share code, notes, and snippets.

View bsod90's full-sized avatar

Maxim bsod90

  • cube.dev
  • California
View GitHub Profile
---
- hosts: newnode
remote_user: root
become: yes
become_method: sudo
tasks:
- command: bash -c "uname -r | grep ^4."
register: kernelversion
ignore_errors: yes
@bsod90
bsod90 / Dockerfile
Created January 17, 2018 21:35
Centos 7 with Systemd Dockerfile
FROM centos:7
MAINTAINER "orion" <orion@thoughtspot.com>
# Steps needed to use systemd enabled docker containers.
# Reference: https://hub.docker.com/_/centos/
ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
@bsod90
bsod90 / Dockerfile
Last active September 10, 2017 17:44
Dockerfile after multi-stage
# First, build the Ember-js project inside nodejs container
FROM node:6
RUN mkdir -p /onebar/ui
RUN npm install -g ember-cli
RUN npm install -g bower
RUN echo ‘{ “allow_root”: true }’ > /root/.bowerrc
ADD ui/package.json /onebar/ui/package.json
WORKDIR /onebar/ui
RUN npm install
ADD ui/ /onebar/ui
@bsod90
bsod90 / Dockerfile
Created September 9, 2017 22:24
Dockerfile before multi-stage
FROM nginx
# Install nodejs and try to cleanup some space in a single command
RUN apt-get update \
&& apt-get install -y curl python build-essential \
&& curl -sL https://deb.nodesource.com/setup_6.x | bash — \
&& apt-get install -y nodejs \
&& apt-get purge -y python build-essential \
&& apt autoremove -y \
&& apt-get clean -y
RUN mkdir -p /onebar/ui
@bsod90
bsod90 / invitation.py
Created December 22, 2013 13:03
Helpers for generating invitation email tokens.
"""
This module contains methods for generation and validation invitation tokens.
You should use it for implementing invitation process as following:
1.
# Create new inactive user
user = User.objects.create(first_name='John', last_name='Doe', email='email@example.com', is_active=False)
# Generate expiration token valid for two days
token = generate_invitation_token(user.id, 60*60*24*2)
# Send invitation email