Skip to content

Instantly share code, notes, and snippets.

View mertyildiran's full-sized avatar
:octocat:
Doing some octopus work

M. Mert Yildiran mertyildiran

:octocat:
Doing some octopus work
View GitHub Profile
@arnobroekhof
arnobroekhof / docker-compose-influxdb.yml
Created March 1, 2018 12:02
Docker compose file for influxdb and grafana
version: "3.2"
# run script
# docker swarm init
# docker stack deploy timeseries -c docker-compose.yml
services:
influxdb:
image: influxdb:latest
ports:
- 8086:8086
@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active May 25, 2024 03:15
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

def triplet_loss(y_true, y_pred, alpha = 0.2):
    """
    Implementation of the triplet loss function
    Arguments:
    y_true -- true labels, required when you define a loss in Keras, not used in this function.
    y_pred -- python list containing three objects:
            anchor:   the encodings for the anchor data
            positive: the encodings for the positive data (similar to anchor)
            negative: the encodings for the negative data (different from anchor)
@mertyildiran
mertyildiran / cairo-xshape-example.c
Created July 1, 2017 21:31
Transparent drawing using Xlib and Cairo
/* compile with:
* gcc $(pkg-config xext x11 cairo-xlib-xrender --cflags --libs) cairo-xshape-example.c
* https://github.com/jordansissel/experiments/blob/master/randomcode/cairo-xshape-example.c
*/
#include <cairo-xlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <X11/extensions/shape.h>
@mjdietzx
mjdietzx / waya-dl-setup.sh
Last active March 13, 2024 15:08
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@xentec
xentec / setup-cross-cc.sh
Last active October 21, 2023 12:20
Alpine Linux cross-compiler setup script
#!/bin/sh
CTARGET="$1"
if [ -z "$CTARGET" ]; then
program=$(basename $0)
echo "usage: $program TARGET_ARCH"
return 1
fi
# get abuild configurables
@Brainiarc7
Brainiarc7 / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Last active April 21, 2024 04:22
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown:

@irfaan008
irfaan008 / EnableGpsAutomaticallyInAndroid.java
Last active June 25, 2020 10:26
Enable Gps automatically if it is turned off. Similar to what OLA cab does. However to comply with policy it shows a popup to user with OK and CANCEL button. Still its better than showing location setting screen to user
package com.irinnovative.enablegps;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.google.android.gms.common.api.GoogleApiClient;
@dunkelstern
dunkelstern / nginx.conf
Created September 21, 2016 12:33
nginx RTMP config
user rtmp;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@midascodebreaker
midascodebreaker / setup-docker-laradock.md
Last active October 16, 2020 21:25
Guide: Set Up Laravel 5.3 with Docker + LaraDock + Let's Encrypt SSL in Digital Ocean within 5 Minutes.

Here is what i did to Set up a laravel Project in Digital Ocean

Install Docker

Login Digital Ocean
Add Droplet
1 Click Install docker
Choose Droplet
reset ROOT password
check email