Skip to content

Instantly share code, notes, and snippets.

@liziwl
liziwl / git 设置和取消代理
Last active January 4, 2019 03:01 — forked from myfreeer/git 设置和取消代理
git proxy 设置
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
@liziwl
liziwl / mysql2sqlite.sh
Created September 27, 2017 02:59 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite

Python Socket 编程详细介绍

Python 提供了两个基本的 socket 模块:

  • Socket 它提供了标准的BSD Socket API。
  • SocketServer 它提供了服务器重心,可以简化网络服务器的开发。

下面讲解下 Socket模块功能。

Socket 类型

@liziwl
liziwl / git分支操作
Last active January 4, 2019 02:59
git 技巧
【git 删除本地分支】
git branch -D br
【git 删除远程分支】
git push origin :br (origin 后面有空格)
git代码库回滚: 指的是将代码库某分支退回到以前的某个commit id
【本地代码库回滚】:
git reset --hard commit-id :回滚到commit-id,讲commit-id之后提交的commit都去除
git reset --hard HEAD~3:将最近3次的提交回滚
@liziwl
liziwl / 代码注释
Last active January 4, 2019 03:02
高级代码注释
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
. ' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
@liziwl
liziwl / aliyun sources.list
Created March 6, 2018 04:51
阿里云Ubuntu 14 更新源
sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak
sudo gedit /etc/apt/sources.list
以下覆盖文件内容
#aliyun
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
@liziwl
liziwl / install sogou
Last active March 6, 2018 04:57
安装sogou输入法
# 首先更换为国内更新源,再到搜狗输入法官网下载搜狗输入法,下载deb文件。
https://pinyin.sogou.com/linux/?r=pinyin
# 安装deb文件
sudo dpkg -i <file your downloaded>
# 安装依赖
sudo apt-get install -f
# 将输入法系统改为fcitx
@liziwl
liziwl / fix_QCA6174.md
Last active March 19, 2018 09:06
修复 Qualcomm Atheros QCA6174 没有正确载入的问题

参考链接: https://bbs.archlinux.org/viewtopic.php?id=208874

目录不存在

If the firmware file directory doesn't exist, create it:

sudo mkdir -p /lib/firmware/ath10k/QCA6174/hw3.0/

目录存在,备份,删除原文件

If the directory already exists, backup everything important from it:

@liziwl
liziwl / install_hadoop.md
Last active March 18, 2018 18:32
Install Hadoop on Ubuntu 16.04

Copy line by line and paste to an interactive shell

Create a new user named hadoop

sudo useradd -m hadoop -s /bin/bash     # 创建hadoop用户
sudo passwd hadoop          # 修改密码
sudo adduser hadoop sudo    # 增加管理员权限

Log out current user, log in hadoop

@liziwl
liziwl / install-google-chrome.md
Created March 14, 2018 03:42 — forked from smmoosavi/install-google-chrome.md
Ubuntu 14.04 installing google chrome

When you got this error

$ sudo dpkg -i google-chrome-stable_current_amd64.deb 
sudo: unable to resolve host bayanca05
[sudo] password for bayan-ca-05: 
Selecting previously unselected package google-chrome-stable.
(Reading database ... 174654 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (43.0.2357.81-1) ...