This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
# $IG_URLS as env | |
# GET auth token to be used in curl/rest api | |
AUTH_TOKEN=$(gcloud auth print-access-token) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import sys | |
import datetime | |
def socket_server(): | |
bind_ip = '0.0.0.0' | |
bind_port = 8000 | |
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
server.bind((bind_ip, bind_port)) | |
server.listen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CoinStats = (function () { | |
var coin_data; | |
var debug_mode = false; | |
function clog(message){ | |
if( debug_mode == true ){ | |
console.log(message); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############ 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 |
NewerOlder