Skip to content

Instantly share code, notes, and snippets.

View shubhamoy's full-sized avatar
🎯
Focusing

Shubhamoy shubhamoy

🎯
Focusing
View GitHub Profile
@shubhamoy
shubhamoy / cloudflare_only.sh
Created March 19, 2018 12:34 — forked from ninjatrench/cloudflare_only.sh
Script (For Linux Servers) to Prevent Real IP address Leak Protected Behind CloudFlare
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "[-] This script must be run as root [-]"
exit 1
fi
echo "[+] Reseting Initiated [+]"
ufw disable
echo "[?] Current Status [?]"
ufw status numbered verbose
@shubhamoy
shubhamoy / docker-compose-dev.yml
Created January 21, 2018 10:09
docker-compose file for photolia development
version: '3'
services:
dbdev:
image: mysql:latest
networks:
- devnet
environment:
- MYSQL_ROOT_PASSWORD=toor
restart: always
volumes:
@shubhamoy
shubhamoy / Dockerfile
Created January 21, 2018 10:01
Dockerfile for PHP Production
From alpine:3.4
MAINTAINER Shubhamoy - https://github.com/shubhamoy
# Timezone
ENV TIMEZONE Asia/Kolkata
ENV PHP_MEMORY_LIMIT 512M
ENV MAX_UPLOAD 50M
ENV PHP_MAX_FILE_UPLOAD 200
ENV PHP_MAX_POST 100M
ENV DUMB_INIT_VERSION 1.2.1
@shubhamoy
shubhamoy / docker-ps-vertical
Last active January 9, 2018 10:33 — forked from wzulfikar/docker-ps-vertical
vertical format for docker ps
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"
Usage: docker ps --format=$FORMAT
For persistence, we need to add this the shell configuration file. Like for OhMyZSH, we will do as follows:
echo 'export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"' >> ~/.zshrc
source ~/.zshrc

Keybase proof

I hereby claim:

  • I am shubhamoy on github.
  • I am shubhamoy (https://keybase.io/shubhamoy) on keybase.
  • I have a public key whose fingerprint is 6808 9710 24EF E260 4CA4 9151 28FA EB92 E318 BAFA

To claim this, I am signing this object:

@shubhamoy
shubhamoy / gist:a49e51340407ac78dd1a
Last active August 29, 2015 14:11
PHP Group: Code Correction
public function check($username)
{
static $rule=null;
if(is_null($rule))
{
$rule = [$username => 'unique:login'];
}
//$validation=Validator::make(array([$username=>$username]),$rule);
$validation=Validator::make(array(['username'=>$username]), $rule);
if($validation->passes())
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Enable/Disable Migrations
|--------------------------------------------------------------------------
|
| Migrations are disabled by default but should be enabled
| whenever you intend to do a schema migration.
|
*/
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|