Skip to content

Instantly share code, notes, and snippets.

View blanklin030's full-sized avatar
💭
I may be slow to respond.

BlankLin blanklin030

💭
I may be slow to respond.
  • baidu
  • china
View GitHub Profile
@blanklin030
blanklin030 / yum_jdk_and_config.md
Last active May 21, 2018 06:54
在linux上通过yum安装配置jdk
  • 1.查看当前的jdk版本,并卸载
rpm -qa|grep java 
  • 2.查找java相关得列表
yum -y list java*
或
yum search jdk
@blanklin030
blanklin030 / install_docker.md
Last active January 24, 2019 07:04
在centos7上安装docker

1、通过yum安装

  • 1.1、通过 uname -r 命令查看你当前的内核版本
  • 1.2、通过yum安装docker服务
yum -y install docker
yum -y install docker-compose
  • 1.3、启动docker后台服务
service docker start
@blanklin030
blanklin030 / AesCipher.php
Last active May 31, 2018 12:17
use openssl to replace mcrypt in php7
class AesCipher {
/**
* 加密密钥
* @var string
*/
private $key = MemberCode::MOBILE_ENCRYPT_KEY;
/**
* 加密算法
* @var string
*/
@blanklin030
blanklin030 / install_shadowsock.md
Created July 24, 2018 04:17
免费申请aws的ec2,以及创建shadowsocks服务

要准备的材料

visa信用卡 or master信用卡 注册过程中需要绑定信用卡,会扣$1(预授权)。但需要注意的是,在没有用超的情况下,是免费的,作为SS服务器,只能是流量超额会导致(15GB/月) 开通国际长途业务的手机号 注册过程中,需要填写手机号,会有国际长途(手机号默认开通)打进来,告诉你验证码。 2.创建AWS实例 用刚才注册好的账号登录AWS控制台,点击EC2(云中的虚拟服务器)

3、定制服务器类型

@blanklin030
blanklin030 / ssh_no_password.md
Created August 3, 2018 10:08
centos系统多台机器免密码ssh

机器假设

  • 现在我们有Hadoop-A、Hadoop-B、Hadoop-C
  • 先配置Hadoop-A

安装ssh

yum install ssh

生成SSH密钥

ssh-keygen -t rsa 
@blanklin030
blanklin030 / source_homebrew.md
Created August 3, 2018 10:17
homebrew切换国内源

使用清华源、替换现有上游

cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

更新源

@blanklin030
blanklin030 / multi_dimension.py
Last active August 8, 2018 11:44
python递归调用,多维度变化为一个维度,一个维度变化为多个维度
# 多维度切为单维度
def go(params):
ret = {}
for(key,value) in params.items():
if type(value) == str:
ret[key] = value
elif type(value) == dict:
for (k1,v1) in value.items():
new_key = key + "." + k1
new_dict = {new_key: v1}
@blanklin030
blanklin030 / brew_install_nmp.md
Last active July 27, 2020 07:43
通过brew在mac上安装及配置php+mysql+nginx

清理旧安装

brew remove mysql nginx php
brew cleanup

安装php

  • 安装php
brew install php@7.1
@blanklin030
blanklin030 / fix_pip_install_mysql_python.md
Last active April 10, 2019 15:30
在mac下pip install MySQL-python提示 _mysql.c:44:10: fatal error: 'my_config.h' file not found的解决方法

在mac下使用pip安装mysql扩展包时出错

 _mysql.c:44:10: fatal error: 'my_config.h' file not found
    #include "my_config.h"
             ^~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1

解决方法

@blanklin030
blanklin030 / install_redis.sh
Created August 29, 2018 12:14
自动安装redis server
echo "=========install redis begin========"
if [ ! -d redis-3.0.0 ];then
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
tar xzf redis-3.0.0.tar.gz
sleep 3
fi
cd redis-3.0.0
make
if [ ! -d /usr/local/redis ];then
mkdir -p /usr/local/redis