Skip to content

Instantly share code, notes, and snippets.

View wu0407's full-sized avatar

wowqing wu0407

View GitHub Profile
@kaizimmer
kaizimmer / fiddler_add_column_client_ip
Created January 2, 2012 16:11
Fiddler - add "client ip" column
static function Main()
{
var today: Date = new Date();
FiddlerObject.StatusText = " CustomRules.js was loaded at: " + today;
//*/
FiddlerObject.UI.lvSessions.AddBoundColumn("Client IP", 120, "x-clientIP");
//*/
}
@ck-on
ck-on / ocp.php
Last active March 14, 2025 08:34
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@denji
denji / nginx-tuning.md
Last active May 30, 2025 09:13
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.

@soarez
soarez / ca.md
Last active May 21, 2025 14:03
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@reorx
reorx / python_tutorials.rst
Last active May 10, 2022 03:39
Python 中英文教程及其他进阶资源

An Ansible summary

Patterns

  • all (or *)
  • hostname: foo.example.com
  • groupname: webservers
  • or: webservers:dbserver
  • exclude: webserver:!phoenix
  • intersection: webservers:&amp;staging
@JustinCarmony
JustinCarmony / example_output.txt
Created July 30, 2014 20:24
Summary Salt Highstate Outputter
root@deployServer:~# salt \* state.highstate --output=summary_highstate
web-server01.example.com ------------------ Success: 20 Changed: 0 Errors: 0
web-server02.example.com ------------------ Success: 71 Changed: 1 Errors: 0
db-server03.example.com ------------------- Success: 73 Changed: 1 Errors: 0
mongo-server04.example.com ---------------- Success: 74 Changed: 1 Errors: 0
mongo-server05.example.com ---------------- Success: 74 Changed: 1 Errors: 0
memcache-server06.example.com ------------- Success: 74 Changed: 1 Errors: 0
mysql-server07.example.com ---------------- Success: 74 Changed: 1 Errors: 0
logs-server08.example.com ----------------- Success: 20 Changed: 0 Errors: 0
redis-server09.example.com ---------------- Success: 27 Changed: 0 Errors: 0
@goldyfruit
goldyfruit / pkg.yml
Last active December 16, 2020 09:40
[ansible] Check via the yum module and a registered value if a package is installed or not
---
- name: Ansible tests playbook
hosts: all
remote_user: root
tasks:
- name: Check if mariadb-libs-5.5.44-2.el7.centos.x86_64 package is installed
yum:
list=mariadb-libs-5.5*x86_64
register: pkg
@cognitiaclaeves
cognitiaclaeves / gist:5ac8698c6bfb57a86d12a7458dc569ea
Created April 4, 2016 21:55
How to get contents of generator do_map in ansible?
Would like to be able to check contents of json.items.*.labels[*] and json.items.*.labels[*].value from json below:
I'm unsure how to get the contents of the generator from ansible / jinja2.
- name: Test json
debug: "msg={{ json.items|map(attribute='metadata.labels') }}"
$ ansible-playbook -i inv/dev k8s-redis.yml --extra-vars "@test-var.json"
Gives me:
@simonw
simonw / how-to.md
Last active April 16, 2025 15:21
How to create a tarball of a git repository using "git archive"