Skip to content

Instantly share code, notes, and snippets.

View mehmetg's full-sized avatar
😀
I may be slow to respond.

Mehmet mehmetg

😀
I may be slow to respond.
  • San Francisco, CA
View GitHub Profile
@mehmetg
mehmetg / rolling_restart.sh
Last active June 7, 2016 23:22
Demonstrates how to do rolling restarts... log, ready, pid, port files need to be cleaned up in the shutdown part.
#!/usr/bin/env bash
#This script is intended to be run from the root of the sauce connect package.
SCBIN="bin/sc"
LOGPREFIX="./tmp"
##Uncomment the lines below and set your credentials
#UNAME=""
#AKEY=""
function start_sauce_connect() {
tunnelId=$1
bah = '''SauceOnDemandSessionID=1d5073926956481086d9ed554a54354c job-name=verifyEmailInputTest
SauceOnDemandSessionID=3313a3618ef94cdc903c521245b8e8db job-name=verifyEmailInputTest
SauceOnDemandSessionID=750f845dd0a84553948842910e0d25f5 job-name=verifyEmailInputTest
SauceOnDemandSessionID=2c0b874d4ff040b18dc0c1834721058e job-name=verifyEmailInputTest
SauceOnDemandSessionID=49d2413dfab04cfb9033abef33251d15 job-name=verifyEmailInputTest'''
print(bah)
@mehmetg
mehmetg / jenkins_saucelabs_password_credentials.rb
Last active December 12, 2016 23:32
Chef library to set credentials for Sauce OnDemand plugin.
#
# Cookbook Name:: nw_jenkins
# HWRP:: jenkins_saucelabs_password_credentials
#
# Author:: Mehmet Gerceker <[email protected]>
class Chef
class Resource::JenkinsSauceLabsPasswordCredentials < Resource::JenkinsPasswordCredentials
resource_name :jenkins_saucelabs_password_credentials
@mehmetg
mehmetg / opencv_tensor.cc
Created October 26, 2017 00:44 — forked from kyrs/opencv_tensor.cc
File Takes an Image Mat file as an input and convert it to tensor.
/*
Following file take opencv mat file as an input and run inception model on it
Created by : Kumar Shubham
Date : 27-03-2016
*/
//Loading Opencv fIles for processing
#include <opencv2/opencv.hpp>
@mehmetg
mehmetg / git-mv-with-history
Created March 6, 2019 00:52 — forked from emiller/git-mv-with-history
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@mehmetg
mehmetg / DashGunicornWrapper.py
Created May 19, 2019 22:43
Wraps a dash application into a gunicorn app.
import gunicorn.app.base
from gunicorn.six import iteritems
class DashGunicornWrapper(gunicorn.app.base.BaseApplication):
def __init__(self, app, options=None):
self.options = options or {}
self.application = app.server
super(DashGunicornWrapper, self).__init__()
" Fisa-vim-config
" http://fisadev.github.io/fisa-vim-config/
" version: 8.3.1
" ============================================================================
" Vim-plug initialization
" Avoid modify this section, unless you are very sure of what you are doing
let vim_plug_just_installed = 0
let vim_plug_path = expand('~/.vim/autoload/plug.vim')
import subprocess
import os
def get_user_shell():
USR_BIN_BASH = "/usr/bin/bash"
BIN_BASH = "/bin/bash"
default_shell = USR_BIN_BASH if os.path.exists(USR_BIN_BASH) else BIN_BASH if os.path.exists(BIN_BASH) else None
shell = os.environ.get("DEFAULT_SHELL", os.environ.get("SHELL", default_shell))
if shell is None: