Skip to content

Instantly share code, notes, and snippets.

@ivansostarko
ivansostarko / curl_rest_api_testing.txt
Last active May 29, 2017 13:44
Testing Rest API using cURL
#!/bin/bash
# API description
echo "Started TIME:"
dt=$(date '+%d/%m/%Y %H:%M:%S');
echo "$dt"
for i in {1..1000000}
do
echo "Executed times: $i"
curl -H "X-Authorization: api-key" --data "param_1=one&param_2=2" https://api.com/v1
@kyleferguson
kyleferguson / Dockerfile
Last active December 19, 2023 06:10
Example Laravel deployment for Kubernetes
FROM php:7.1-apache
ADD . /var/www
ADD ./site.conf /etc/apache2/sites-enabled/000-default.conf
RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && \
docker-php-ext-install mcrypt pdo_mysql opcache && \
pecl install redis-3.1.2 && docker-php-ext-enable redis && \
a2enmod rewrite
@buonzz
buonzz / docker-compose-cheatsheet.sh
Last active April 16, 2020 14:05
docker-compose cheatsheet
$ docker-compose up -d # start containers in background
$ docker-compose kill # stop containers
$ docker-compose up -d --build # force rebuild of Dockerfiles
$ docker-compose rm # remove stopped containers
$ docker ps # see list of running containers
$ docker exec -ti [NAME] bash # ssh to the container
# list all images
docker images
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
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

@vluzrmos
vluzrmos / .htaccess
Last active September 21, 2017 22:45 — forked from dr-dimitru/.htaccess
Laravel 4.2 HTACCESS
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
@dimitrikennedy
dimitrikennedy / gist:2006881
Created March 9, 2012 15:03
JavaScript: Save JSON to Local Storage
$('#submit').click(function() {
var info = {
"name": $('#name').val(),
"age": $('#age').val(),
"bio": {
"short": $('#bio').val(),
"long": $('#bioLong').val()
}
}