Skip to content

Instantly share code, notes, and snippets.

View mustafauysal's full-sized avatar
💭
addressing some issues... 🧑🏻‍💻

Mustafa Uysal mustafauysal

💭
addressing some issues... 🧑🏻‍💻
View GitHub Profile
@mustafauysal
mustafauysal / wp-update.sh
Created December 22, 2018 10:08 — forked from pacoorozco/wp-update.sh
Backup and update a Wordpress Site using wp-cli
#!/usr/bin/env bash
##########################################################################
# Shellscript: Backup and update WordPress using wp-cli
# Author : Paco Orozco <paco@pacoorozco.info>
# Requires : wp-cli
##########################################################################
# Changelog
# 20170125: 1.0
# Adds a default option to upgrade only when it's needed.
# 20161220: 0.1
@mustafauysal
mustafauysal / 4-vCPUs-8G-compare.md
Created December 17, 2018 20:38
DO vs Vultr Disk Benchmark

DO

sysbench --test=fileio --file-total-size=50G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run

Operations performed:  284700 Read, 189800 Write, 607354 Other = 1081854 Total
Read 4.3442Gb  Written 2.8961Gb  Total transferred 7.2403Gb  (24.713Mb/sec)
 1581.66 Requests/sec executed

Test execution summary:
    total time:                          300.0011s
    total number of events:              474500
@mustafauysal
mustafauysal / docker-compose.yml
Created September 1, 2018 17:45
Graylog docker compose file
version: '2'
services:
# MongoDB: https://hub.docker.com/_/mongo/
mongodb:
image: mongo:3
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
environment:
- http.host=0.0.0.0
@mustafauysal
mustafauysal / powered-cache-purge-all.php
Last active September 27, 2023 15:40
Purge all page cache when a post update happen.
<?php
add_action( 'powered_cache_advanced_cache_purge_post', function ( $post_id ) {
\PoweredCache\Utils\clean_page_cache_dir();
} );
@mustafauysal
mustafauysal / DO-1G-Old.md
Last active December 17, 2018 20:27
CPU benchmarks

sysbench --test=cpu --cpu-max-prime=20000 run

sysbench 0.4.12:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1

Doing CPU performance benchmark
@mustafauysal
mustafauysal / commands.sh
Created January 24, 2018 10:27 — forked from hassansin/commands.sh
Web Server Performance Comparison #sysbench #benchmark
# Ref: http://wiki.mikejung.biz/Sysbench
# CPU
sysbench --test=cpu --cpu-max-prime=20000 run
sysbench --test=cpu --cpu-max-prime=20000 run --num-threads=4
#FILE IO
sysbench --test=fileio --file-total-size=4G prepare
sysbench --test=fileio --file-total-size=4G --file-test-mode=rndrw --max-time=300 --max-requests=0 --file-extra-flags=direct run
sysbench --test=fileio --file-total-size=4G cleanup
@mustafauysal
mustafauysal / gist:035b2d509186bb16df7500279d0b492a
Created January 23, 2018 23:14 — forked from chilic/gist:5803582
Debian memcached socket start script
#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# config: /etc/memcached.conf
# pidfile: /var/run/memcached/memcached.pid
# Standard LSB functions
. /lib/lsb/init-functions
@mustafauysal
mustafauysal / s3sync.sh
Created November 20, 2017 20:22
sync WordPress uploads dir to s3
/usr/bin/s3cmd sync --delete-removed /wp-content/uploads/ s3://bucket-name/uploads/
@mustafauysal
mustafauysal / yoast-primary-category-compat.php
Created November 6, 2017 20:05
Fix the popular newspaper theme's primary category shit!
<?php
/**
* This crappy function fixes primary category feature of Newspaper theme.
*
* I'm lazy to add caching stuff, normally I don't do that.
* Please don't use crappy "Premium" themes under the high traffic.
*
*/
add_filter( "get_post_metadata", "newspaper_theme_fix_yoast_primary_category_compat", 10, 4 );
@mustafauysal
mustafauysal / redirection_export.php
Created November 5, 2017 16:50
Export Yoast SEO Redirection rules
<?php
/**
* Generate redirection plugin (https://wordpress.org/plugins/redirection/) compatible csv files from Yoast SEO Premium's redirection.
*
* Usage: download and put this file to root directory of your WordPress installation.
* then visit the url, you will see the csv file :)
* after then WP Adming > Tools > Redirection > import (section)
*
*
* Don't use this file on production