Skip to content

Instantly share code, notes, and snippets.

View kovagoz's full-sized avatar

Zoltan Kovago kovagoz

  • IBM Budapest Lab
  • Budapest
View GitHub Profile
@kovagoz
kovagoz / Dockerfile
Created September 2, 2016 05:03
Alpine Linux with PHP 5.6 FPM and Mongo module
FROM php:5.6-fpm-alpine
RUN apk update && apk add autoconf openssl-dev g++ make && \
pecl install mongo && \
docker-php-ext-enable mongo && \
apk del --purge autoconf openssl-dev g++ make
@kovagoz
kovagoz / platforms.txt
Created March 27, 2018 11:16
youtube-dl --list-extractors
1tv
1up.com
20min
220.ro
23video
24video
3qsdn
3sat
4tube
56.com
@kovagoz
kovagoz / setup_vm.sh
Created May 3, 2021 08:55
Setup docker-machine for the Go Board
#!/bin/bash
set -e
# Create the virtual machine (VM)
docker-machine create -d virtualbox default
# VM must be stopped before USB configuration
docker-machine stop
@kovagoz
kovagoz / etc_xdg_openbox_autostart
Created March 18, 2019 13:55
Raspberry PI config
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms
# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp
# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
@kovagoz
kovagoz / docker-compose.yml
Created August 29, 2016 06:57
Laravel Docker Compose Nginx PHP-FPM
version: '2'
services:
nginx:
image: nginx:alpine
ports:
- "8000:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
links:
- fpm
@kovagoz
kovagoz / serverless.yml
Last active June 21, 2018 21:38
Static HTML endpoint for the AWS APIG with Serverless Framework
functions:
HelloWorld:
handler: dummy.handler # reference to a nonexistent handler
events:
- http:
path: /hello
method: get
integration: mock
request:
passThrough: NEVER
@kovagoz
kovagoz / count_calendars.php
Created August 9, 2016 15:09
Count Google Calendars
<?php
require __DIR__ . '/vendor/autoload.php';
$credentials_path = __DIR__ . '/credentials.json';
putenv("GOOGLE_APPLICATION_CREDENTIALS=$credentials_path");
$client = new Google_Client;
$client->useApplicationDefaultCredentials();
@kovagoz
kovagoz / doctrine-geojson.php
Created January 10, 2014 14:55
Doctrine geospatial query with GeoJson
<?php
use GeoJson\Geometry\Point;
$city = new City;
$city->name = 'Budapest';
$city->coordinates = new Coordinates(47.51, 19.03);
$city->save();
$city = DB::createQueryBuilder('City')
@kovagoz
kovagoz / doctrine-geo.php
Created January 9, 2014 22:57
Doctrine MongoDB geospatial query example
<?php
$city = DB::createQueryBuilder('Ni\City')
->field('coordinates')->geoNear(46.1643154116, 18.9664363861)
->spherical(true)
->distanceMultiplier(6378.137) // rad => km
->limit(1)
->getQuery()
->getSingleResult();
alias codecept='() { vagrant ssh -c "cd /vagrant/www && vendor/bin/codecept $*" }'
alias composer='() { vagrant ssh -c "cd /vagrant/www && composer $*" }'