Skip to content

Instantly share code, notes, and snippets.

# Qt qmake integration with Google Protocol Buffers compiler protoc
#
# To compile protocol buffers with qt qmake, specify PROTOS variable and
# include this file
#
# Example:
# LIBS += /usr/lib/libprotobuf.so
# PROTOS = a.proto b.proto
# include(protobuf.pri)
#
package main
import (
"log"
"net"
"../gen/go"
"golang.org/x/net/context"
"google.golang.org/grpc"
)
syntax = "proto3";
package example;
service Greeter {
rpc Hello (GreetingRequest) returns (GreetingReply) {}
}
message GreetingRequest {
string name = 1;
#ifndef __CLIENT_CLI_H_
#define __CLIENT_CLI_H_
#include <iostream>
#include <string>
#include <grpc++/grpc++.h>
#include "../../gen/greeting.grpc.pb.h"
@pasdam
pasdam / main.c
Last active August 11, 2018 10:07
#include <iostream>
#include <memory>
#include <string>
#include <grpc++/grpc++.h>
#include "../core/GreeterClientCli.h"
#include "../../gen/greeting.grpc.pb.h"
@pasdam
pasdam / docker-bash-completion.md
Last active December 1, 2018 07:42 — forked from rkuzsma/docker-bash-completion.md
How to configure Bash Completion on Mac for Docker and Docker-Compose

How to configure Bash Completion on Mac for Docker and Docker-Compose

Run:

brew install bash-completion

Add the following lines to your ~/.bash_profile:

 if [ -f $(brew --prefix)/etc/bash_completion ]; then
@pasdam
pasdam / knife_boootstrap.md
Last active December 1, 2018 07:57
Knife bootstrap and undo

The following will bootstrap a new chef node:

knife bootstrap <ip> -i <key> --ssh-user <ssh_user> --sudo -E <environment> --run-list 'recipe[<recipe_name>]' -N <node_name>

where:

  • ip is the ip of the machine to bootstrap;
  • key is the ssh key used to connect to the machine;
  • environment is the environment type, i.e. staging;
  • recipe_name is the recipe name to use;
@pasdam
pasdam / buildDockerImage.sh
Last active January 3, 2019 18:05
This script allows to build a docker image generating the tag version from the git revision
#!/bin/sh
script_name="${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}"
script_folder=$(cd `dirname $script_name` && pwd)
print_usage() {
echo "Usage: $script_name <options>"
echo ""
echo "Options:"
echo "\t-a <arguments>\targuments to pass to the docker build command"
@pasdam
pasdam / clearTracks.sh
Created January 5, 2020 01:12
Bash script to remove all non-english audio/subtitle tracks from a group of MKV files
#! /bin/sh
MKVMERGE="<mkvmerge_path>"
INPUT_FOLDER="<input_folder>"
OUPUT_FOLDER="<output_folder>"
for entry in "$INPUT_FOLDER"/*.mkv; do
NAME=$(basename "$entry")
# remove all non-english autio/subtitles tracks
@pasdam
pasdam / replaceCommitEmail.sh
Created January 5, 2020 01:31
Bash script to replace email in git commit history
#!/bin/sh
git filter-branch -f --env-filter '
# Configuration values
OLD_EMAIL="<old_email_to_replace>"
CORRECT_NAME="pasdam"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]