Skip to content

Instantly share code, notes, and snippets.

##
# Example Ansible playbook that uses the PostgreSQL module.
#
# This installs PostgreSQL on an Ubuntu system, creates a database called
# "app" and a user called "app" with password "secret"
# with access to the "app" database.
#
---
- hosts: appBackend
become: yes
---
- name: install PHP 7, Nginx and PHP-FPM
hosts: appBackend
become: yes
vars:
- redis_bind: 127.0.0.1
roles:
- bas-ansible-roles-collection.nginx
- bas-ansible-roles-collection.php7
<?php
/**
* Example .phpcs file for Laravel app
*
* Usage:
* - install php-cs-fixer to your project using composer
* `composer require friendsofphp/php-cs-fixer --dev`
* - create file name `.phpcs` in ROOT directory of your project
* and copy contents of this file into it.
@tumainimosha
tumainimosha / postgres_create_readonly_user.sql
Created September 4, 2018 06:32
Create readonly user on postgres database
-- Before running below script make sure you
-- are connected to the correct database
-- you want to grant readonly access to
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
@tumainimosha
tumainimosha / ubuntu_create_user_and_add_ssh_key.md
Last active April 1, 2019 12:11
Creating a new user and add ssh public key

Create new user

ubuntu@ip-172-31-37-13:~$ sudo adduser foouser
Adding user `foouser' ...
Adding new group `foouser' (1006) ...
Adding new user `foouser' (1006) with group `foouser' ...
Creating home directory `/home/foouser' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
@tumainimosha
tumainimosha / page-info.ts
Last active September 18, 2024 08:18
NestJS Graphql Cursor Based pagination
import { ObjectType, Field } from "@nestjs/graphql";
@ObjectType()
export class PageInfo {
@Field({ nullable: true })
startCursor: string;
@Field({ nullable: true })
endCursor: string;
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
# We are using chybie/node-aws-cli image which contains npm and aws-cli tools
#
# Also you need to specify AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in
# pipeline environment variables for push to s3 to work
#
# Pipeline is configured to run only on master branch, but you can configure
# additional branches if required
# This is the stages / task to perfom in jobs
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
# We are using chybie/node-aws-cli image which contains npm and aws-cli tools
#
# Also you need to specify AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in
# pipeline environment variables for push to s3 to work
#
# Pipeline is configured to run only on master branch, but you can configure
# additional branches if required
# Node Image for docker on which code will execute
@tumainimosha
tumainimosha / .env
Created May 8, 2024 10:59
Docker config files for running python project on server using docker
# App port. Specifies port for appserver
PORT=8000