让CentOS服务器支持https(安全http协议)

1、安装mod_ssl

通过yum来在线安装mod_ssl
[root@Crayfish home]# yum -y install mod_ssl ? ???← 在线安装mod_ssl
Loaded plugins: security
base? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? | 3.7 kB? ???00:00
epel? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? | 4.4 kB? ???00:00
extras? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???| 3.4 kB? ???00:00
updates? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? | 3.4 kB? ???00:00
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package mod_ssl.x86_64 1:2.2.15-31.el6.centos will be installed
–> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
Package? ?? ?? ?? ?Arch? ?? ?? ?? ???Version? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?Repository? ?? ?? ? Size
====================================================================================================
Installing:
mod_ssl? ?? ?? ?? ?x86_64? ?? ?? ?? ?1:2.2.15-31.el6.centos? ?? ?? ?? ?? ?updates? ?? ?? ?? ? 91 k

Transaction Summary
====================================================================================================
Install? ?? ? 1 Package(s)[……]

继续阅读

如何修改Linux主机名

1、临时方式
[root@Crayfish ~]# hostname yourName
这种方式修改,重启后会复原

2、永久修改
2.1、进入目录/etc/sysconfig
[root@Crayfish ~]# cd /etc/sysconfig/
[root@Crayfish sysconfig]#

2.2、打开network文件
[root@Crayfish sysconfig]# vi network

1
2
3
4
NETWORKING=yes
NOZEROCONF=yes
NETWORKING_IPV6=no
HOSTNAME=Crayfish

保存退出
2.3、重启
[root@Crayfi[……]

继续阅读

UILabel详解

1.创建UIlabel

1
UILabel *label1 = [[UILabelalloc] initWithFrame:CGRectMake(20, 40, 280, 80)];

2.设置背景色

1
label1.backgroundColor = [UIColor grayColor];

3.设置tag

1
label1.tag = 91;

4.设置标签文本

1
label1.text = @"Hello world!";

5.设置标签文本字体和字体大小

1
label1.font = [UIFont fontWithName:@"Arial" size:30];

6.设置文本对其方式

1
label1.textAlignment = UITextAlignmentCenter;

文本对齐方式有以下三种

1
2
3
4
5
6
7
8
typedef enum {
              UITextAlignmentLeft = 0,左对齐
 
              UITextAlignmentCenter,居中对齐 
 
              UITextAlignmentRight, 右对齐 
 
} UITextAlignment;

[……]

继续阅读

AFNetworking、MKNetworkKit和ASIHTTPRequest对比

AFNetworking
MKNetworkKit
ASIHTTPRequest
更新情况
维护和使用者相对多
维护和使用者相对少
停止更新
支持iOS和OSX
ARC
断点续传
否,可通过AFDownloadRequestOperation
同步异步请求
只支持异步
图片缓存到本地
否,通过SDURLCache或AFCache
图片缓存到内存
[……]

继续阅读

富文本(NSMutableAttributedString)的使用

1、创建对象

1
2
3
  NSString *original = @"今天你还好吗?";
 
  NSMutableAttributedString *attrTitle = [[NSMutableAttributedStringalloc] initWithString:original];

2、设置属性(NSForegroundColorAttributeName代表要设置颜色, value代表值, range 代表范围)

1
  [attrTitle addAttribute:NSForegroundColorAttributeName value:[UIColorblueColor] range[......]<p class="read-more"><a href="https://www.yusian.com/blog/project/2014/07/14/093649596.html">继续阅读</a></p>