Skip to content

Instantly share code, notes, and snippets.

zouyi php-cpm

Block or report user

Report or block php-cpm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@php-cpm
php-cpm / setup.md
Created Oct 15, 2015 — forked from xrstf/setup.md
Nutch 2.3 + ElasticSearch 1.4 + HBase 0.94 Setup
View setup.md

Info

This guide sets up a non-clustered Nutch crawler, which stores its data via HBase. We will not learn how to setup Hadoop et al., but just the bare minimum to crawl and index websites on a single machine.

Terms

  • Nutch - the crawler (fetches and parses websites)
  • HBase - filesystem storage for Nutch (Hadoop component, basically)
@php-cpm
php-cpm / kafka-php-read-offset.php
Last active Jul 25, 2017
PHP读取kafka的消费offset和生产的offset并计算队列积压情况
View kafka-php-read-offset.php
<?php
// composer require "nmred/kafka-php"
require_once __DIR__.'/vendor/autoload.php';
$server = 'zookeeperHost:2181';
$topic = 'topic_name';
$group = 'consumer_group';
$zookeeper = new \Kafka\ZooKeeper($server);
$listBroker = $zookeeper->listBrokers();
View zabbix-mysql-monitor-shell.sh
#!/bin/bash
# -------------------------------------------------------------------------------
# FileName: chk_mysql.sh
# Revision: 1.0
# Date: 2018/01/04
# Author: zouyi
# Description:
# License: MIT
View 技术面试小纸条.md

面向技术面试学习很蛋疼,所以我们写了个小纸条来打辅助

这个列表是一个速成指南,也可以作为具体专题深入研究的引用。本文其实就是你从来没去听过的或者已经健忘的计算机科学课程的总结,因此不可能写的很深入。原文已经在github gist 上公开,任何人都可以参与修改。

数据结构基础

数组 Array

定义:

View cache_benchmark.php
first benchmark is redis
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
for ($i = 0; $i < 100; $i++) {
$start = microtime(true);
for ($j = 0; $j < 10000; $j++) {
$key = sprintf("key:%05d", $j);
View mysql_benchmark.php
<?php
// refer & edit from https://odino.org/redis-slow-with-php-think-again/
$conn = mysqli_connect('127.0.0.1', 'root');
mysqli_select_db($conn, 'mysql_benchmark');
for ($i = 0; $i < 100; $i++) {
$start = microtime(true);
for ($j = 0; $j < 10000; $j++) {
$query = mysqli_query($conn, 'SELECT * FROM users WHERE id = 1');
$key = sprintf("key:%05d", $j);
View check-tcp-time-wait.sh
result=`/usr/sbin/ss -a |grep -v etlservicemgr|awk '{print $2":"$6}'|awk -F ":" '{print $1":"$3}'|sort|uniq -c|sort -nr|head -10`
date=`date "+%Y-%m-%d %H:%M:%S"`
count=0
for i in $result
do
count=$count+1
if((count%2==1))
then
v=$i
else
@php-cpm
php-cpm / GUI-shortcut.md
Last active Mar 1, 2019
日常快捷键
View GUI-shortcut.md

日常工作中少不了与快捷键打交道,这里简单整理了最常用的功能快捷键,好处是80%的软件都通用,而且通过记住单词首字母可以快速记忆,上手新软件的时间也能大大降低。

Windows、Linux 的快捷键都是以 ctrl 开始,macOS 的快捷键以 cmd(command) 开始,注意这个区别外, 其他都是出奇的一致。

这里有个网站可以快速查询快捷键在各个软件里的表现 https://defkey.com/what-means/ctrl-y

快捷键 单词速记 用途
ctrl+c copy 拷贝,复制
ctrl+v Viscidity、paste 粘贴
@php-cpm
php-cpm / bash-shortcut.md
Last active Mar 1, 2019
终端快捷键
View bash-shortcut.md

日常在图形化界面下操作,记住的快捷键并不能很好的与终端(shell、命令行,怎么叫都行)配合使用,需要额外记忆。

在终端下,你常常只有一行可以输入命令的空间,所以要记住的快捷键主要是用来处理光标在输入命令的位置和调整内容的。

快捷键 单词速记 用途
Ctrl+Shift+C 复制,进入复制模式,按 空格 开始选择,选择完毕后再按一次 Ctrl+Shift+C 退出
Ctrl+Shift+V 粘贴
Ctrl + A、Home A 是首字母 光标跳到行首
You can’t perform that action at this time.