This file contains hidden or 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
class Cleaner(object): | |
def clean_name(self): | |
pass | |
cleaner = Cleaner() | |
for method_name in methods: | |
getattr(cleaner, method_name)() | |
### More Objective way |
This file contains hidden or 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
# Reference: https://unicode-table.com/en/blocks/ | |
# https://docs.oracle.com/cd/E29584_01/webhelp/mdex_basicDev/src/rbdv_chars_mapping.html | |
import re | |
def has_cyrillic(word): | |
# https://unicode-table.com/en/blocks/cyrillic/ | |
# Languages: russian, ukrainian, bulgarian | |
return bool(re.search('[\u0400-\u04ff]', word)) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from locust import HttpLocust, TaskSet, task | |
class FirstTestClass(TaskSet): | |
# @task attribute' methodumuzun task olduğunu belirtmek için kullanıyoruz. | |
@task | |
def index(self): | |
self.client.get("/locustio/locust") |
This file contains hidden or 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
Komut | Açıklama | |
---|---|---|
\q | Çıkış yapmanızı sağlar. | |
\x | Çıktıları genişletir. | |
\H | Çıktıları html olarak verir. | |
\a | Çıktıları hizalar. | |
\s | Komut geçmişinizi listeler. | |
\g | Bir önceki komutunuzu çalıştırır. | |
\c yada \connect [ VERITABANI_ADI [ KULLANICI_ADI ] [ HOST ] [ PORT ] ] | Başka bir veritabanına bağlanmak için kullanılır. | |
\l | Veritabanlarını listeler. | |
\l+ | Veritabanlarını detaylı listeler. (veritabanı boyutunu da verir) |
This file contains hidden or 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
vcl 4.0; | |
# Based on: https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl | |
import std; | |
import directors; | |
backend server1 { # Define one backend | |
.host = "127.0.0.1"; # IP or Hostname of backend | |
.port = "80"; # Port Apache or whatever is listening | |
.max_connections = 300; # That's it |
This file contains hidden or 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
vcl 4.0; | |
import directors; | |
backend app2 { | |
.host = "10.135.19.167"; | |
.port = "8080"; | |
} | |
backend app3 { | |
.host = "10.135.40.246"; |
This file contains hidden or 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 | |
echo "Starting the backup script..." | |
ROOTDIR="/backup/mysql/" | |
YEAR=`date +%Y` | |
MONTH=`date +%m` | |
DAY=`date +%d` | |
HOUR=`date +%H` | |
SERVER="444.333.222.111" | |
BLACKLIST="information_schema performance_schema" | |
ADDITIONAL_MYSQLDUMP_PARAMS="--skip-lock-tables --skip-add-locks --quick --single-transaction" |
This file contains hidden or 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
# Local | |
CREATE USER 'ryan'@'localhost' IDENTIFIED BY 'babel'; | |
GRANT ALL PRIVILEGES ON *.* TO 'ryan'@'localhost' WITH GRANT OPTION; | |
# Anywhere | |
CREATE USER 'ryan'@'%' IDENTIFIED BY 'babel'; | |
GRANT ALL PRIVILEGES ON *.* TO 'ryan'@'%' WITH GRANT OPTION; |
This file contains hidden or 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/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /srv/www | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
This file contains hidden or 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
# checks to see if running | |
launchctl list | grep kibana | |
# remove autostarts | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.kibana.plist | |
launchctl remove homebrew.mxcl.kibana | |
# remove all process | |
pkill -f kibana |