Skip to content

Instantly share code, notes, and snippets.

View pgasiorowski's full-sized avatar

Piotr Gąsiorowski pgasiorowski

View GitHub Profile
#!/bin/sh
#
# General-purpose docker entrypoint that will execute
# source .envsh files from /docker-entrypoint.d/ and then
# invoke .sh files from the same place.
# And then will execute commands specified as parameters
set -e
entrypoint_log() {
@pgasiorowski
pgasiorowski / git-squash.sh
Created July 1, 2019 12:13
Git - squash commits in feature branch for review
# Checkout master
git checkout master
# Create new brach from master
git checkout -b 51172-order-details-v4
# Merge the branch you worked (ie 51172-order-details-v3) as single commit into new branch (ie 51172-order-details-v4)
git merge --squash 51172-order-details-v3
@pgasiorowski
pgasiorowski / dns-migration-test.sh
Created January 22, 2019 13:42
Compares DNS records across two nameservers. List of subdomains is taken from zone file
#!/bin/bash
# Compares DNS records across two nameservers. List of subdomains is taken from zone file
#
# Based on https://stackoverflow.com/questzions/11024797/compare-dns-on-two-different-nameservers
DOMAIN=example.com
OLD=ns1.nameserver.com
NEW=ns2.nameserver.com
ZONEFILE=example.com.zone
import Adapter from "ember-data/adapters/json-api";
export default Adapter.extend();
@pgasiorowski
pgasiorowski / run.py
Created November 15, 2016 08:24
Run ansible in AWS Lambda
#!/usr/bin/env python2
# Based on: https://serversforhackers.com/running-ansible-2-programmatically
import os
import sys
from ansible.executor import playbook_executor
from ansible.inventory import Inventory
from ansible.parsing.dataloader import DataLoader
console.log('Creating kurentoClient');
kurento(ws_uri, function(error, kurentoClient) {
if (error) return wsError(ws, "ERROR 1: Could not find media server at address" + ws_uri + ". Exiting with error " + error);
// Create pipline
console.log('Creating MediaPipline');
kurentoClient.create('MediaPipeline', function(error, pipeline) {
if (error) return wsError(ws, "ERROR 2: " + error);
@pgasiorowski
pgasiorowski / app.js
Last active March 5, 2018 13:54
Kurento Player to WebRTC pipeline
var kurento = require('kurento-client');
var express = require('express');
var app = express();
var path = require('path');
var wsm = require('ws');
app.set('port', process.env.PORT || 8080);
/*
* Definition of constants
root@server [/backup/mysql]# sudo -u ${XB_USER} innobackupex --user=${MYSQL_BACKUP_USER} --password=${MYSQL_BACKUP_PASS} --apply-log --use-memory 2G ${XB_BACKUP}
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p
my $innodb_data_file_path =
get_option(\%config, $option_defaults_group, 'innodb_data_file_path');
# run ibbackup as a child process
$cmdline = "$option_ibbackup_binary $options";
# Only use --rebuild-indexes in the first xtrabackup call
$cmdline_copy = $cmdline;
if ($option_rebuild_indexes) {
$cmdline = $cmdline . " --rebuild-indexes"
@pgasiorowski
pgasiorowski / Settings.php
Last active August 29, 2015 14:01
PhalconeEye - Core\Model\Settings proposal
<?php
/*
+------------------------------------------------------------------------+
| PhalconEye CMS |
+------------------------------------------------------------------------+
| Copyright (c) 2013-2014 PhalconEye Team (http://phalconeye.com/) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file LICENSE.txt. |
| |