Skip to content

Instantly share code, notes, and snippets.

View ssi-anik's full-sized avatar
💻
Open to remote work!

Syed Sirajul Islam Anik ssi-anik

💻
Open to remote work!
View GitHub Profile
@ssi-anik
ssi-anik / curl.md
Created July 24, 2019 09:44 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@version:3.2
# ===============================================================================================
# Configuration file for syslog-ng, customized for remote logging
# ===============================================================================================
# Options
# Note about $HOST / HOST
# Description: The name of the source host where the message originates from.
# If the message traverses several hosts and the chain_hostnames() option is on, the first host in the chain is used.
# If the keep_hostname() option is disabled (keep_hostname(no)), the value of the $HOST macro will be the DNS hostname of the host that sent the message to syslog-ng OSE (that is, the DNS hostname of the last hop). In this case the $HOST and $HOST_FROM macros will have the same value.
@ssi-anik
ssi-anik / Dockerfile
Created October 10, 2018 18:05
php:7.2-rc-zts-alpine +pthreads +xdebug
FROM php:7.2-rc-zts-alpine
ARG APP_USER_USERNAME=app
RUN apk update && apk add --no-cache \
sudo bash \
g++ make autoconf \
libxml2-dev icu-dev curl-dev pcre-dev
RUN adduser -D -s /bin/bash $APP_USER_USERNAME \
@ssi-anik
ssi-anik / docker-rm-images.md
Last active July 24, 2023 08:33 — forked from alferov/docker-rm-images.md
Remove all (untagged) images and containers from Docker
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")
# Delete unused images
docker system prune --all
@ssi-anik
ssi-anik / php-docker-ext
Created August 28, 2018 19:21 — forked from hoandang/php-docker-ext
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@ssi-anik
ssi-anik / main.go
Created May 27, 2018 21:00 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@ssi-anik
ssi-anik / main.go
Created May 27, 2018 21:00 — forked from creack/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
@ssi-anik
ssi-anik / put-object-on-aws-s3.php
Created February 4, 2018 20:50 — forked from keithweaver/put-object-on-aws-s3.php
Upload an image/object to an AWS S3 Bucket using PHP
<?php
// Installed the need packages with Composer by running:
// $ composer require aws/aws-sdk-php
$filePath = "https://example.com/test.png";
require 'vendor/autoload.php';
$bucketName = 'YOUR_BUCKET_NAME';
$filePath = './YOUR_FILE_NAME.png';
@ssi-anik
ssi-anik / http-status-codes.md
Created November 30, 2017 12:07 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@ssi-anik
ssi-anik / docker-cleanup-resources.md
Created November 28, 2017 06:46 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm