Skip to content

Instantly share code, notes, and snippets.

View mustafakirimli's full-sized avatar
🏠
Working from home

Mustafa Kırımlı mustafakirimli

🏠
Working from home
View GitHub Profile
@mustafakirimli
mustafakirimli / solr-setup.sh
Last active August 29, 2015 13:57
Apache Solr setup script with Tomcat and JRE
############ 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-rp.sh
Created March 8, 2014 13:09
Solr Setup with relative path configuration
############ 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
############ 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
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",
var CoinStats = (function () {
var coin_data;
var debug_mode = false;
function clog(message){
if( debug_mode == true ){
console.log(message);
}
}
@mustafakirimli
mustafakirimli / migrate-redis.py
Last active February 18, 2018 13:56 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
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.
@mustafakirimli
mustafakirimli / recursive-zip-file-creation.sh
Created January 13, 2019 11:13
Create recursive zip file to test email security solutions whether blocking recursively zipped files
#!/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 / k8s-shortcuts.sh
Created March 3, 2019 16:51
Some small shortcuts on Kubernetes for daily tasks. Be careful and test before using on production
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
}
#!/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";
#!/bin/python
import sys
import time
import socket
HOST = '127.0.0.1'
PORT = 2001
while True:
try:
print(f"trying to connect {HOST}:{PORT}")
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: