Skip to content

Instantly share code, notes, and snippets.

@mustafaileri
mustafaileri / serverless.py
Created April 24, 2020 20:30
sample serverless app with ffmpeg and python
import json
import os
import boto3
def lambda_handler(event, context):
try:
s3 = boto3.client('s3')
"""Downlod video from private S3"""
s3.download_file('serverless-test-2020', 'Big_Buck_Bunny_1080_10s_1MB.mp4', '/tmp/test-video.mp4')
@mustafaileri
mustafaileri / gist:a18f3c13477823b50a763e1ca00415ad
Created October 30, 2018 11:16
write sample data to cassandra with python.
docker-compose exec -T app python /app/write_to_cassandra.py
@mustafaileri
mustafaileri / gist:10d0aa7b7aa612437497c14ca155e4fa
Created October 30, 2018 11:01
Describing a keyspace on Cassandra.
DESCRIBE test_keyspace;
@mustafaileri
mustafaileri / gist:7d7cde136584cc8550037537f5948a28
Created October 30, 2018 10:58
Run sync command on docker.
docker-compose exec -T app python /app/sync_cassandra.py
cqlsh localhost 10042 -ucassandra -pcassandra
@mustafaileri
mustafaileri / gist:26ab2ae12641bca046ff3e7b659d475a
Created October 30, 2018 10:32
Run cqlsh on docker instance
docker-compose exec node_0 cqlsh localhost -ucassandra -pcassandra
@mustafaileri
mustafaileri / gist:c5af7fdb4c893be115ab147fad11ad9a
Created October 30, 2018 10:28
sample cassandra key space create command
CREATE KEYSPACE test_keyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '2'} AND durable_writes = true;
@mustafaileri
mustafaileri / docker-compose-dev.yml
Created June 30, 2017 15:16
Docker Sync Sample Configuration
version: '2'
services:
php:
build: php7-fpm
volumes:
- code:/var/www/zearch:nocopy
ports:
- 9001:9001
@mustafaileri
mustafaileri / saveScreenshotAndContent.php
Last active January 30, 2017 08:59
save screenshot and document on behat test fail
<?php
use Behat\MinkExtension\Context\MinkContext;
class BaseContext extends MinkContext
{
...
...
/*
* @AfterStep
*/
@mustafaileri
mustafaileri / spin.php
Last active January 30, 2017 08:17
Spin metodu
<?php
use Behat\MinkExtension\Context\MinkContext;
class BaseContext extends MinkContext
{
/**
* @param $closure
* @param int $tries
* @return mixed
* @throws Exception
*/