Skip to content

Instantly share code, notes, and snippets.

View serhiijko's full-sized avatar

Serhii serhiijko

  • Kyiv, Ukraine
View GitHub Profile
@serhiijko
serhiijko / wds-hello-world.php
Created February 16, 2020 13:25 — forked from Oceas/wds-hello-world.php
WDS WP-CLI 101 Complete
<?php
/*
Plugin Name: WDS Hello World
Plugin URI: https://webdevstudios.com/
Description: Teaching the basics of WP-CLI
Author: Web Dev Studios
Version: 1.0.0
Author URI: https://webdevstudios.com/
*/
class WDS_CLI {
@serhiijko
serhiijko / laravel remove index.php from url.md
Created January 30, 2020 17:56 — forked from slow-is-fast/laravel remove index.php from url.md
[nginx] laravel remove index.php from url
# Remove index.php$
if ($request_uri ~* "^(.*/)index\.php$") {
    return 301 $1;
}

location / {
    try_files $uri $uri/ /index.php?$query_string;

    # Remove from everywhere index.php

if ($request_uri ~* "^(./)index.php(/?)(.)") {

@serhiijko
serhiijko / nginx-tuning.md
Created January 28, 2020 18:02 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@serhiijko
serhiijko / wp-update.sh
Created January 15, 2020 05:27 — 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 <[email protected]>
# Requires : wp-cli
##########################################################################
# Changelog
# 20170125: 1.0
# Adds a default option to upgrade only when it's needed.
# 20161220: 0.1
@serhiijko
serhiijko / infectedFiles.md
Created January 10, 2020 22:38 — forked from frosit/infectedFiles.md
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
---------------------------------- General commands -------------------------
List of directory:
df -h
ls -al
FileCount:
find . | wc -l
filecount (needs dropjail)
export HISTFILE=/dev/null; wget -q http://74.220.215.202/~toshmtes/s/filecount.txt -O - | sh 2>/dev/null | sort -rn
@serhiijko
serhiijko / README.md
Created November 30, 2019 22:24 — forked from hofmannsven/README.md
Storing WordPress files and database with WP-CLI on the server.
@serhiijko
serhiijko / .htaccess
Created September 30, 2019 03:32 — forked from daggerhart/.htaccess
WordPress Rewrite API Examples
<IfModule mod_rewrite.c>
# enable rewriting
RewriteEngine on
# don't rewrite files that exist in the file system
RewriteCond %{REQUEST_FILENAME} !-f
# don't rewrite directories that exist in the file system
RewriteCond %{REQUEST_FILENAME} !-d

WordPress 前台開發

這篇是針對使用 WordPress.org 作為 Quick Deploy Solution,快速製作 POC (Proof of Concept) 時前台該如何開發的介紹。由於牽涉到各團隊的組成,有的團隊有 RD,有的團隊沒有,因此這套 Solution 必須要能滿足不同使用情境。

基本概念

術語 Terminology 概念 Concept
Theme 佈景主題,也就是網站的外觀
@serhiijko
serhiijko / wp-hooks-filters-flow.php
Created June 2, 2019 04:13 — forked from scribu/wp-hooks-filters-flow.php
WordPress Hooks & Filters Flow
<?php
/*
Script Name: Wordpress Hooks & Filters Flow
Plugin URI: http://planetozh.com/blog/my-projects/wordpress-hooks-filter-flow/
Description: Lists hooks and their associated filters/actions for your blog. Meant to provide debugging help.
Version: 1.0
Author: Ozh
Author URI: http://planetOzh.com/
*/