This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在发送一个REST API请求时,根据应用的场景,针对相同的资源,可能会期待不同的返回形式。 | |
Rest API应具备完整的内容协商能力 | |
通过在header里面设置 Accept:告诉WEB服务器自己接收的内容类型,内容类型中的先后次序表示客户端接收的先后次序。 */* 表示任何类型,type/* 表示该text/html,application/json | |
请求不支持的格式:415 Unsupported Media Type | |
---> | |
(1). 返回内容格式指定 | |
http://gym.api.ruizhutech.com/activities/251/entrances/?format=json | |
(2). 通过在header里面指定 | |
http://gym.api.ruizhutech.com/activities/251/entrances/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to install mysql-client to connect django and MySQL: | |
(1). Make sure the MySQL is installed | |
(2). Use the following command to install the package: | |
Ubuntu: | |
$sudo apt-get install libmysqlclient-dev | |
CentOS: | |
$ sudo apt-get install mysql-devel | |
(3). inside the virtualenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tmux is a "terminal multiplexer", it enables a number of terminals to be accessed and controlled from a single terminal. | |
If you use Debian/Ubuntu, you can just run apt-get install tmux, and voila. | |
Since the title was about centos 7, then do the following step to install tmux. | |
(1). tmux has a library dependency on libevent which, of course, isn’t installed by default. | |
$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
$ tar xzvf libevent-2.0.21-stable.tar.gz | |
$ cd libevent-2.0.21-stable | |
$ ./configure && make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####This is a cheat sheet for mysql syntax, which is mostly about privilege management in mysql. | |
--------------------------------------------------------------------------------------------------------------------- | |
### List all the user in mysql(with access to the mysql database) | |
mysql> select user, host, password from mysql.user; | |
### Create a user with password | |
mysql> create user 'shady'@'localhost' identified by 'password'; | |
### Create a user without password | |
mysql> create user 'eric'@'localhost'; | |
----------------------------------------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mostly about the java.time package, about time and date format issue. | |
Nothing Special, just for reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |