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 / 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 / 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 / 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 / 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 / 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 / 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 / bug.php
Last active August 29, 2015 14:14
Image rotation bug
<?php
$img = imagecreatetruecolor(640, 480);
$rot = imagerotate($img, -90, 0);
var_dump(imagesy($rot));
@kovagoz
kovagoz / c64
Created December 12, 2014 09:57
If the secondary address isn't specified or is specified as 0 (e.g. LOAD "FILE",8), the file is saved/loaded from the BASIC memory area (which, on the C64, starts by default at $0801). If the secondary address is specified as a non-zero value (e.g. LOAD "FILE",8,1), the program is loaded starting from the address specified by the file itself (the PRG header, which is the first two bytes of the file)—this form of command is more common when loading machine code programs.
@kovagoz
kovagoz / vim_tig
Created September 5, 2014 14:56
Call "tig status" from Vim
function! TigStatus()
silent !tig status
redraw!
endfunction
nnoremap <silent> gs :call TigStatus()<CR>