Skip to content

Instantly share code, notes, and snippets.

Mustafa Kırımlı mustafakirimli

Block or report user

Report or block mustafakirimli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git_alias_for_access.sh
#!/bin/bash
declare -a CF_ACCESS_HOSTS=(
"https://gitlab.mywebsite.com"
"https://gitlab.mycompany.com"
)
is_cf_git_host() {
host_name=$(echo "$1" | awk -F/ '{print $3}')
printf '%s\n' "${CF_ACCESS_HOSTS[@]}" | grep --quiet "$host_name";
@mustafakirimli
mustafakirimli / k8s-shortcuts.sh
Created Mar 3, 2019
Some small shortcuts on Kubernetes for daily tasks. Be careful and test before using on production
View k8s-shortcuts.sh
function kpod {
# $1 pod name
# $2 namespace
# $3 extra args for command
podName=$1
envName=$2
eArgs=$3
kubectl get pod -n $envName -o yaml $podName $eArgs
}
@mustafakirimli
mustafakirimli / recursive-zip-file-creation.sh
Created Jan 13, 2019
Create recursive zip file to test email security solutions whether blocking recursively zipped files
View recursive-zip-file-creation.sh
#!/bin/bash
REC_COUNT=40
echo "This script gonna create a zip file and make it ${REC_COUNT} times zipped resursively"
sleep 2
echo "test content" > test0.txt
zip -r test0.zip test0.txt
@mustafakirimli
mustafakirimli / migrate-redis.py
Last active Feb 18, 2018 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
View migrate-redis.py
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
View CoinStats.js
var CoinStats = (function () {
var coin_data;
var debug_mode = false;
function clog(message){
if( debug_mode == true ){
console.log(message);
}
}
View replace_dict_recursive.py
def replace_dict(obj, cbv, key=lambda x: True, value=lambda x: True):
"""
Replaces dict values recursively.
>>> cats = {
"name": "Telefon",
"desc": "Telefon modelleri",
"id": 1,
"is_active": "True",
View solr-cloud-setup.sh
############ kurulum icin basit ayarlar, istedigimiz sekilde degistirebiliriz ###########
export SOLR_DIR='solr4' # tum uygulama, konfigurasyon ve datalarin olacagi klasor
export SOLR_PORT='8082' # solr'i kullanmak istedigimiz port
export TOMCAT_MPORT='8006' # tomcat yonetim portu
export SOLR_VER='4.7.0' # kullanmak istedigimiz solr versionu
export TOMCAT_VER='8.0.3' # kullanmak istedigimiz tomcat versionu
export ZOO_VER='3.4.5' # zookeeper version
export SOLR_HOME='solr_home' # solr'a ait data ve konfigurasyonlarin bulunacagi klasor
if [ -d "/Applications/" ]
then
@mustafakirimli
mustafakirimli / solr-setup-rp.sh
Created Mar 8, 2014
Solr Setup with relative path configuration
View solr-setup-rp.sh
############ kurulum icin basit ayarlar, istedigimiz sekilde degistirebiliriz ###########
export SOLR_DIR='solr4' # tum uygulama, konfigurasyon ve datalarin olacagi klasor
export SOLR_PORT='8082' # solr'i kullanmak istedigimiz port
export TOMCAT_MPORT='8006' # tomcat yonetim portu
export SOLR_VER='4.7.0' # kullanmak istedigimiz solr versionu
export TOMCAT_VER='8.0.3' # kullanmak istedigimiz tomcat versionu
export SOLR_HOME='solr_home' # solr'a ait data ve konfigurasyonlarin bulunacagi klasor
if [ -d "/Applications/" ]
then
export JRE_URL='http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-macosx-x64.tar.gz' # MacOS x64
@mustafakirimli
mustafakirimli / solr-setup.sh
Last active Aug 29, 2015
Apache Solr setup script with Tomcat and JRE
View solr-setup.sh
############ kurulum icin basit ayarlar, istedigimiz sekilde degistirebiliriz ###########
export SOLR_DIR='solr4' # tum uygulama, konfigurasyon ve datalarin olacagi klasor
export SOLR_PORT='8082' # solr'i kullanmak istedigimiz port
export TOMCAT_MPORT='8006' # tomcat yonetim portu
export SOLR_VER='4.7.0' # kullanmak istedigimiz solr versionu
export TOMCAT_VER='8.0.3' # kullanmak istedigimiz tomcat versionu
export SOLR_HOME='solr_home' # solr'a ait data ve konfigurasyonlarin bulunacagi klasor
if [ -d "/Applications/" ]
then
export JRE_URL='http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-macosx-x64.tar.gz' # MacOS x64
You can’t perform that action at this time.