Skip to content

Instantly share code, notes, and snippets.

View aiwhj's full-sized avatar
🎯
Focusing

aiwhj aiwhj

🎯
Focusing
  • 云智慧北京科技有限公司
View GitHub Profile
@aiwhj
aiwhj / apt-get_use_proxy.md
Created December 20, 2018 05:53
apt-get 使用 代理

sudo apt-get -o Acquire::http::proxy="http://192.168.33.1:1087" install clickhouse-client clickhouse-server

@aiwhj
aiwhj / phpbrew.md
Created August 27, 2018 07:08
phpbrew

phpbrew install php-7.1.15 +default +fpm +sockets +json +iconv +fileinfo +cli +hash +mysql +dbs +mb +openssl=/usr/local/Cellar/openssl/1.0.2o_1

@aiwhj
aiwhj / jenv.md
Created August 3, 2018 11:17
jenv 多环境

jenv

jenv add /Library/Java/JavaVirtualMachines/jdk17011.jdk/Contents/Home

jenv versions

jenv global oracle64-1.6.0.39

jenv local oracle64-1.6.0.39

@aiwhj
aiwhj / bison_update.sh
Created July 31, 2018 13:12
更新 bison
```sh
brew search bison
brew install bison@2.7
echo 'export PATH="/usr/local/opt/bison@2.7/bin:$PATH"' >> ~/.bash_profile
export PATH="/usr/local/opt/bison@2.7/bin:$PATH"
```
@aiwhj
aiwhj / ini_format.md
Created July 23, 2018 13:13
ini文件格式

三要素

parameters,sections,comments

  1. parameters
key = value
  1. sections
@aiwhj
aiwhj / php5.3_compile.md
Created June 12, 2018 07:36
php5.3 编译问题

问题1

undefined reference to symbol 'CRYPTO_set_id_callback@@OPENSSL_1.0.0'
/lib/i386-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

把文件中的

EXTRA_LIBS = -lcrypt -lz -lresolv -lcrypt -lpq -lrt -lpq -lpng -lz -ljpeg -lcurl -lrt -lm -ldl -lnsl -lxml2 -lzlcurl -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt
@aiwhj
aiwhj / question.md
Created June 6, 2018 02:16
遇到的某些问题
  1. 为什么要分开设置
  unsigned char table[256];
  unsigned char *p = memset (table, 0, 64);
  memset (p + 64, 0, 64);
  memset (p + 128, 0, 64);
  memset (p + 192, 0, 64);
@aiwhj
aiwhj / c_study.md
Created June 4, 2018 12:56
高质量C/C++编程指南笔记

命名

  1. 变量命名: 名词 或 形容+名词
  2. 函数命名: 动词 或 动词+名词
  3. 正确的反义词组命名相斥的变量会函数: getValue setValue
  4. 避免出现数字序: value1 value2

某些

如果代码行中的运算符比较多,用括号确定表达式的操作顺序

if 比较

  1. 不可将布尔变量直接与 TRUEFALSE 或者 10 进行比较
@aiwhj
aiwhj / vagrant_resize_disk.md
Created May 24, 2018 06:24
调整 vagrant 的磁盘大小

如果默认是 vmdk 的话,先转换成 vdi

VBoxManage clonehd ubuntu.vmdk ubuntu.vdi -format VDI

然后 resize

VBoxManage modifyhd ubuntu.vdi --resize 40000

最后在virtualbox中该虚拟机的设置-存储页面将旧的vmdk的磁盘更换成新的 vdi 虚拟磁盘

@aiwhj
aiwhj / strlenAndsizeof.md
Last active May 23, 2018 02:02
字符串的 strlen 和 sizeof
#include <stdio.h>
#include <string.h>
int main()
{
    char * ptr = "123456789";
    printf("strlen_ptr: %lu\n", strlen(ptr));
    printf("sizeof_ptr: %lu\n", sizeof(ptr));
    
 char arr[20] = "123456789";