Skip to content

Instantly share code, notes, and snippets.

View artyomliou's full-sized avatar
🇺🇦

Artyom Liou artyomliou

🇺🇦
View GitHub Profile
@yftzeng
yftzeng / demo-56.php
Created August 2, 2022 07:20
PHP development progress
<?php
/**
* PHP 5.6
*/
class State
{
const DRAFT = 'draft';
const PUBLISHED = 'published';
@chimit
chimit / bitbucket-pipelines.yml
Created August 7, 2020 02:35
Bitbucket Pipelines config for Laravel 7 with PHP 7.4, GD and EXIF
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.4-fpm
definitions:
services:
mysql:
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active July 16, 2024 18:43
Docker Container Logging using Promtail
@kohlerdominik
kohlerdominik / bitbucket-pipelines.yml
Created January 13, 2020 08:55
Simple PHPUnit Testing in Bitbucket Pipeline
pipelines:
pull-requests:
'**':
- step:
name: Build Testing
image: composer:latest
artifacts:
- "vendor/**"
script:
# Install php dependencies
@schwarzeni
schwarzeni / util.go
Last active July 3, 2024 21:50
[golang] get specific network interface's IPv4 address
package util
import (
"errors"
"fmt"
"net"
)
// useful links:
// https://stackoverflow.com/questions/27410764/dial-with-a-specific-address-interface-golang
@abhilash1in
abhilash1in / user-data.sh
Created April 24, 2018 17:06
Install nvm and NodeJS using AWS EC2 user data script
#!/bin/bash
apt-get -y update
cat > /tmp/subscript.sh << EOF
# START UBUNTU USERSPACE
echo "Setting up NodeJS Environment"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash
echo 'export NVM_DIR="/home/ubuntu/.nvm"' >> /home/ubuntu/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ubuntu/.bashrc
# Dot source the files to ensure that variables are available within the current shell
. /home/ubuntu/.nvm/nvm.sh
@DeRain
DeRain / example.sh
Created November 27, 2017 16:55
Generate .env file from AWS Parameters Store
#Add ENV strings into AWS Parameter Store (as one parameter). All strings will be separated by the newline
#We are getting ENV string separated by the newline and pub them in the dotenv
aws ssm get-parameter --name Param-with-env --region eu-west-1 --query Parameter.Value | sed -e 's/^"//' -e 's/"$//' | awk '{gsub(/\\n/,"\n")}1' >> .env
@mayorova
mayorova / README.md
Created August 10, 2017 14:44
Mutual SSL in NGINX

Securing traffic to upstream servers with client certificates

Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/

Creating and Signing Your Certs

Source: http://nategood.com/client-side-certificate-authentication-in-ngi

This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.

@wankormaru
wankormaru / sample_athena.php
Last active November 19, 2020 09:15
Athena SELECT Query Sample Program
<?php
/*-----------------------------
* Athena SELECT Query Sample Program
*
* - IAM でユーザ作成必要
* 必要な管理ポリシー : AmazonAthenaFullAccess
* - 作ったIAMユーザのクレデンシャル情報を aws configure で設定必要
* - AWS SDK for PHP version 3 のインストールが必要
*
* @date 2017/08/06
@JasonReading
JasonReading / firehose-example.php
Last active February 8, 2022 03:11
Firehose example
<?php
use Aws\Firehose\FirehoseClient;
// Install deps with `composer install`
require 'vendor/autoload.php';
$firehose = new FirehoseClient([
'version' => 'latest',
'region' => 'eu-west-1',