rpm管理环境包和代码包
Author: Jin
Date: 20140610
System: CentOS release 6.5 (Final)
06-09-2014c零:问题
配置文件问题,不打包使用的配置文件参考配置文件后缀.default
有个不替换操作 %config(noreplace) %{etcdir}/%{configfile} 新的安装为 /usr/local/redis/etc/redis.conf.rpmnew
版本号更改: :%s/2.8.7/2.8.10/g 一般软件,游戏代码使用另外的
一、基本流程
1.环境
yum -y install gcc-c++ gperf ncurses-devel readline-devel time zlib-devel cmake libaio-devel autoconf make
yum -y install rpm-build
2.基本目录
会安装到每个用户的home目录下,指定到其他地方,build的时候也会到home
cd ~
mkdir rpmbuild/SOURCES
mkdir rpmbuild/RPMS
3.HttpServer提供yum源
# yum -y install nginx
# vim /etc/nginx/conf.d/default.conf
location /RPMS {
index index.htm index.html;
autoindex on;
autoindex_localtime on;
access_log /var/log/nginx/rpms-access.log;
}
# ln -s /usr/share/nginx/html/RPMS /root/rpmbuild/RPMS
# /etc/init.d/nginx start
# chkconfig nginx on
4.源码
[root@kdc ~]# ls -1 rpmbuild/SOURCES/
mysql-5.5.38.tar.gz
redis-2.8.10.tar.gz
redis-2.8.7.tar.g
5.SPEC文件
# ls -1 rpmbuild/SPECS/
mysql.spec
redis.spec
6.创建
rpmbuild -ba rpmbuild/SPECS/redis.spec
7.更新repo
createrepo rpmbuild/RPMS/x86_64/
# createrepo rpmbuild/RPMS 错误
创建的目录别弄错了
8.client配置repo
# cat /etc/yum.repos.d/jincom.repo
[jincom]
name=jincomgames
baseurl=http://192.168.201.254/RPMS/$basearch
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
9.client安装更新回滚
yum --enablerepo=jincom install redis-2.8.7
yum --enablerepo=jincom install redis-2.8.10
yum --enablerepo=jincom downgrade redis-2.8.7
yum --enablerepo=jincom clean metadata
yum --enablerepo=jincom cleanall
yum --enablerepo=jincom makecache
http://192.168.201.254/RPMS/x86_64/redis-2.8.7-1.x86_64.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=jincom clean metadata
Trying other mirror.
包装不符合预期下载
Error Downloading Packages:
redis-2.8.7-1.x86_64: failure: redis-2.8.7-1.x86_64.rpm from jincom: [Errno 256] No more mirrors to try.
原因
[root@kdc ~]# ll rpmbuild/RPMS/x86_64/
total 21096
-rw-r--r-- 1 root root 20028619 Jun 6 2014 mysql-5.5.38-0.x86_64.rpm
-rw-r--r-- 1 root root 795230 Jun 6 15:13 redis-2.8.10-1.x86_64.rpm
-rw-r--r-- 1 root root 769191 Jun 6 15:18 redis-2.8.7-1.x86_64.rpm
drwxr-xr-x 2 root root 4096 Jun 6 12:57 repodata
[root@kdc ~]# ll rpmbuild/RPMS/
total 8
drwxr-xr-x 2 root root 4096 Jun 6 15:19 repodata
drwxr-xr-x 3 root root 4096 Jun 6 15:18 x86_64
[root@kdc ~]# rm -rf rpmbuild/RPMS/repodata/
我的源指向http://192.168.201.254/RPMS/x86_64/
所以应该在RPMS/x86_64/创建依赖
# createrepo rpmbuild/RPMS/x86_64/
二、 SPEC文件
1.解释
###定期全局变量
%global pkgname redis
%define binfile redis-server redis-cli redis-check-aof redis-check-dump redis-sentinel redis-benchmark
###信息部分
Name: %{pkgname}
Version: 2.8.10
Release: 1
Summary: %{pkgname}-%{version} on centos6.5 for jincomgames
Group: Databases
License: GPL
URL: http://download.redis.io/releases/redis-2.8.10.tar.gz
Packager: diege@foxmail.com
BuildArch: x86_64
Source: redis-2.8.10.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: %{distro_buildreq} #构建包时候一起来的软件
Requires: %{distro_requires} # 该rpm包所依赖的软件包名称,可以用>=或<=表示大于或小于某一特定版本,例如:libpng-devel >= 1.0.20 zlib
###自己做好放在rpmbuild/SOURCES/目录下的文件,后面可以install -p -m 0644 %{Source0}%
Source1: redis.conf-jincomgames
%description
redis for jincomgames
#预先准备工作
%prep
# 把源码包解压并放好,从rpmbuild/SOURCES解压到rpmbuild/BUILD 注意源码包是否有Releas
#%setup -n %{name}-%{version}-%{release}
%setup -n %{name}-%{version} #将软件包解压%{name}-%{version}目录
###编译
%build
#cmake或者./configure #mysql5.5没有使用configue来配置了和make
#make MALLOC=libc
make -j 8
###安装到rpmbuild/BUILDROOT/目录,rpmbuild/BUILDROOT为模拟的根目录
%install
mkdir -p $RPM_BUILD_ROOT
#cd %{_builddir}/%{name}-%{version}-%{release}
cd %{_builddir}/%{name}-%{version}
make install
##build dir
install -p -d -m 0755 %{buildroot}%{bindir}
install -p -d -m 0755 %{buildroot}%{etcdir}
##build config file
install -p -m 0644 %{configfile} %{buildroot}%{etcdir}/%{configfile}.default
install -p -m 0644 %{Source1}% {buildroot}%{etcdir} #存放到SOURCE下面的文件
##build binary file
cd src
install -p -m 0750 %{binfile} %{buildroot}%{bindir} #多个文件
###安装前做的工作,创建用户,创建目录等
%pre
#getent group %{group} > /dev/null || groupadd -r %{group}
##getent group %{pkggroup} > /dev/null || groupadd -g %{gid} %{pkggroup}
##getent passwd %{user} > /dev/null || \
# useradd -r -d ${userhome} -g %{pkggroup} \
## useradd -u %{uid} -g %{pkggroup} -d %{userhome} \
## -s /sbin/nologin -c %{comment} %{user}
###安装之后创建datadir目录,启动脚本,创建用户等操作
%post
test ! -d %{datadir} && mkdir -p %{datadir}
#test -d %{datadir} && chown -R %{user}:%{pkggroup} %{datadir}
#cd %{installdir}
#cp share/mysql/mysql.server /etc/rc.d/init.d/%{servicename}
#chmod 755 /etc/rc.d/init.d/%{servicename}
#chkconfig --add %{servicename
###卸载前做的操作,比如服务还在开启的话关闭
%preun
#/etc/rc.d/init.d/%{servicename} stop
###卸载后做的操作,比如删除开启启动,删除启动脚本,删除用户
%postun
#chkconfig --del %{servicename}
#rm /etc/rc.d/init.d/%{servicename} -f
#userdel -rf %{user} && groupdel %{pkggroup}
###清理rpmbuild/BUILDROOT 和 rpmbuild/BUILD下的解压包
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
#[ -d %{_builddir}/%{name}-%{version}-%{release} ] && rm -rf %{_builddir}/%{name}-%{version}-%{release}
[ -d %{_builddir}/%{name}-%{version} ] && rm -rf %{_builddir}/%{name}-%{version}
#打包成rpm包,%file中用的是相对目录,$RPM_BUILD_ROOT为模拟的根目录,没有指定文件的话,默认全部打包
%files
%{installdir}/* #安装目录下全部打包
%config(noreplace) %{etcdir}/%{configfile} #不替换
#%dir %{nginx_confdir} #目录
%defattr(-, root, root)
#%attr(700,%{nginx_user},%{nginx_group}) %dir %{nginx_home} 修改文件属性,分别是(mode,owner,group),-表示默认值,对文本文件是0644,可执行文件是0755
%defattr(-, root, root) #默认权限
#列出不想打包到rpm中的文件小心,如果%exclude指定的文件不存在,也会出错的。
#%exclude
#文档
%doc
#变更日志
%changelog
三、python的包
(一)pyhon
[root@kdc ~]# rpm -ivh rpmbuild/RPMS/x86_64/Python-2.7.7-1.x86_64.rpm
^C[root@kdc ~]# rpm -ivh rpmbuild/RPMS/x86_64/Python-2.7.7-1.x86_64.rpm
error: Failed dependencies:
/usr/local/bin/python is needed by Python-2.7.7-1.x86_64
(二)pypy
用2.7
1.pypy
依赖包
yum install \
gcc make python-devel libffi-devel lib-sqlite3-devel pkgconfig \
zlib-devel bzip2-devel ncurses-devel expat-devel \
openssl-devel gc-devel python-sphinx python-greenlet
2.编译安装
bunzip -d pypy-2.2.1-src.tar.bz2 |tar -xvf -D
cd pypy/goal
python ../../rpython/bin/rpython --opt=jit targetpypystandalone.py
要用2.7.3
暂时不去研究,
使用原来的
[root@gs01 ~]# yum --enablerepo=jincom install pypy
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package pypy.x86_64 0:0.0.1-1 will be installed
--> Processing Dependency: /usr/local/bin/python for package: pypy-0.0.1-1.x86_64
--> Processing Dependency: /opt/pypy/bin/pypy for package: pypy-0.0.1-1.x86_64
--> Processing Dependency: /opt/pypy-2.2.1-linux_x86_64-portable/bin/pypy for package: pypy-0.0.1-1.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: pypy-0.0.1-1.x86_64
--> Processing Dependency: /opt/pypy/bin/pypy for package: pypy-0.0.1-1.x86_64
--> Processing Dependency: /opt/pypy-2.2.1-linux_x86_64-portable/bin/pypy for package: pypy-0.0.1-1.x86_64
--> Processing Dependency: /usr/local/bin/python for package: pypy-0.0.1-1.x86_64
--> Finished Dependency Resolution
Error: Package: pypy-0.0.1-1.x86_64 (jincom)
Requires: libX11.so.6()(64bit)
Error: Package: pypy-0.0.1-1.x86_64 (jincom)
Requires: /usr/local/bin/python
Error: Package: pypy-0.0.1-1.x86_64 (jincom)
Requires: /opt/pypy/bin/pypy
Error: Package: pypy-0.0.1-1.x86_64 (jincom)
Requires: /opt/pypy-2.2.1-linux_x86_64-portable/bin/pypy
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@gs01 ~]#
在用的版本
[root@localhost omg_serverpackage_201404]# ./pypy/bin/pypy
Python 2.7.6 (394146e9bb673514c61f0150ab2013ccf78e8de7, May 13 2014, 05:56:41)
[PyPy 2.3.0 with GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information
# cp -a pypy pypy-2.3.0
# tar -zcvf pypy-2.3.0.tgz pypy-2.3.0
[root@gs01 ~]# yum --enablerepo=jincom install pypy
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package pypy.x86_64 0:2.3.0-1 will be installed
--> Processing Dependency: /opt/omg_serverpackage_201404/pypy/bin/pypy for package: pypy-2.3.0-1.x86_64
--> Processing Dependency: /opt/omg_serverpackage_201404/pypy/bin/pypy for package: pypy-2.3.0-1.x86_64
--> Finished Dependency Resolution
Error: Package: pypy-2.3.0-1.x86_64 (jincom)
Requires: /opt/omg_serverpackage_201404/pypy/bin/pypy
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@gs01 ~]#
[root@kdc pypy]# pwd
/root/rpmbuild/BUILDROOT/pypy-2.3.0-1.x86_64/usr/local/pypy
# grep -r -n 'opt/omg_serverpackage_201404' *
包含了路径
还是得另外编译啊
注意,Linux二进制程序都是动态链接的,像往常一样,因此可能不会使用Linux二进制兼容性的悲惨的故事。这意味着Linux二进制程序只适用在发行版写旁边,除非你准备攻击你的系统库添加符号链接,它试图打开。一般来说,我们建议通过源代码构建或下载你PyPy从你的供应商。家酿,Ubuntu(PPA),Debian MacPorts,Fedora,Gentoo和拱包PyPy,不同程度的是最新的。你可能有更多的运气在吱吱作响的便携式Linux二进制程序
pypy-2.3-linux_x86_64-portable.tar.bz2
https://bbuseruploads.s3.amazonaws.com/squeaky/portable-pypy/downloads/pypy-2.3-linux_x86_64-portable.tar.bz2?Signature=RKD4KYAN4B6M0OGppFstNsQDzg8%3D&Expires=1402114176&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82
这个版本是移动版
根据提示
[root@kdc ~]# ./pypy-2.3-linux_x86_64-portable/bin/pypy
Python 2.7.6 (394146e9bb673514c61f0150ab2013ccf78e8de7, May 09 2014, 08:05:14)
[PyPy 2.3.0 with GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>>
[root@localhost omg_serverpackage_201404]# ./pypy/bin/pypy
Python 2.7.6 (394146e9bb673514c61f0150ab2013ccf78e8de7, May 13 2014, 05:56:41)
[PyPy 2.3.0 with GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>>
[PyPy 2.3.0 with GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
[PyPy 2.3.0 with GCC 4.8.2] on linux2
不同之处
在1.4上面解压该包,然后看一下
# tar -xvf pypy-2.3-linux_x86_64-portable.tar
[root@localhost ~]# ./pypy-2.3-linux_x86_64-portable/bin/pypy
Python 2.7.6 (394146e9bb673514c61f0150ab2013ccf78e8de7, May 09 2014, 08:05:14)
[PyPy 2.3.0 with GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
GCC编译版本不一样
先测试能不能打包安装模块,有时间再去找版本
#%setup -n %{Source} 可以解压,但是要cd过去
Requires: /bin/sh /usr/bin/env /usr/local/bin/python libX11.so.6()(64bit) libbz2.so.1()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.2)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libcrypt.so.1()(64bit) libcrypt.so.1(GLIBC_2.2.5)(64bit) libdl.so.2()(64bit) libdl.so.2(GLIBC_2.2.5)(64bit) libgcc_s.so.1()(64bit) libgcc_s.so.1(GCC_3.0)(64bit) libgcc_s.so.1(GCC_3.3.1)(64bit) libm.so.6()(64bit) libm.so.6(GLIBC_2.2.5)(64bit) libncurses.so.5()(64bit) libpanel.so.5()(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libpthread.so.0(GLIBC_2.3.2)(64bit) librt.so.1()(64bit) librt.so.1(GLIBC_2.2.5)(64bit) libsqlite3.so.0()(64bit) libtcl.so()(64bit) libtk.so()(64bit) libutil.so.1()(64bit) libutil.so.1(GLIBC_2.2.5)(64bit) libz.so.1()(64bit)
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/pypy-2.3.0-1.x86_64
Wrote: /root/rpmbuild/SRPMS/pypy-2.3.0-1.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/pypy-2.3.0-1.x86_64.rpm
Error: Package: pypy-2.3.0-1.x86_64 (jincom)
Requires: libX11.so.6()(64bit)
Error: Package: pypy-2.3.0-1.x86_64 (jincom)
Requires: /usr/local/bin/python
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@kdc ~]# rpm -qf /usr/lib64/libX11.so.6
libX11-1.5.0-4.el6.x86_6
#%define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel cmake libaio-devel
%define distro_requires libX11 /usr/bin/python
Requires: %{distro_requires}
http://smilejay.com/2011/11/denpendency_need_python/
[root@kdc rpmbuild]# grep -r '/usr/local/bin/python' BUILD/pypy-2.3-linux_x86_64-portable/
BUILD/pypy-2.3-linux_x86_64-portable/lib-python/2.7/cgi.py:#! /usr/local/bin/python
BUILD/pypy-2.3-linux_x86_64-portable/lib-python/2.7/cgi.py:# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
修改
BUILD/pypy-2.3-linux_x86_64-portable/lib-python/2.7/cgi.py
#! /usr/bin/python
打包Requires: /bin/sh /usr/bin/env /usr/bin/python变过了
%define distro_requires libX11
Requires: %{distro_requires}
yum --enablerepo=jincom install pypy
依赖解决
######################################
2.pypy
https://bbuseruploads.s3.amazonaws.com/squeaky/portable-pypy/downloads/pypy-2.3-linux_x86_64-portable.tar.bz2?Signature=RKD4KYAN4B6M0OGppFstNsQDzg8%3D&Expires=1402114176&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82
这个版本是移动版
pypy-2.3-linux_x86_64-portable.tar.bz2
pypy-2.3-linux_x86_64-portable.tar
[root@kdc ~]# ./pypy-2.3-linux_x86_64-portable/bin/pypy
Python 2.7.6 (394146e9bb673514c61f0150ab2013ccf78e8de7, May 09 2014, 08:05:14)
[PyPy 2.3.0 with GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
#补充说明
修改文件BUILD/pypy-2.3-linux_x86_64-portable/lib-python/2.7/cgi.py中 #! /usr/local/bin/python 为#! /usr/bin/python、
故解压操作注释
%prep
#tar -xvf %{pkgfile} ###if update
故清除操作也注释
%clean
#[ -d %{_builddir}/%{name}-%{version} ] && rm -rf %{_builddir}/%{name}-%{version}
rpmbuild -ba rpmbuild/SPECS/pypy.spec && createrepo ./rpmbuild/RPMS/x86_64/
3.各个模块
py-redis 2.10 .1 redis-2.9.0-py2.7.egg-info
py-tornado 3.2.1 tornado-3.2-py2.7.egg-info
pip-1.5.6-py2.7.egg-info
1)python-redis
__version__ = '2.9.0'
最新版本
https://codeload.github.com/andymccurdy/redis-py/zip/master
master.zip
redis-py-master
/usr/local/Python27/bin/python setup.py build
build/lib/redis/
使用版本
https://github.com/andymccurdy/redis-py/releases/tag/2.9.0
https://github.com/andymccurdy/redis-py/archive/2.9.0.tar.gz
rpmbuild -ba rpmbuild/SPECS/python-redis.spec && createrepo ./rpmbuild/RPMS/x86_64/
yum --enablerepo=jincom install python-redis
注意 因为安装到其他包的文件中,卸载文件没有删除
2)mysql-connector-python 1.2.2
对比了python26.python27,pypy setup buid的文件都一样,都是源码, 不改变mysql-connector-python-1.2.2-1.el6.noarch
https://pypi.python.org/pypi/mysql-connector-python/1.2.2
http://dev.mysql.com/doc/connector-python/en/index.html
http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-1.2.2.zip#md5= 5d72eedb06d2dcae258fe1e5fa93fc8a
代码修改部分
vim rpmbuild/BUILD/mysql-connector-python-1.2.2/build/lib/mysql/connector/cursor.py
359
def _row_to_python(self, rowdata, desc=None):
"""Convert the row from MySQL to Python types"""
to_python = self._connection.converter.to_python
try:
if not desc:
desc = self.description
res = dict([(flddsc[0], to_python(flddsc, val)) for flddsc, val in zip(desc, rowdata) ])
except StandardError, e:
raise errors.InterfaceError("Failed converting row to Python types; %s" % e)
else:
return res
return None
返回列表修改返回字典了
#补充说明
有修代码所以,第一运行之后,修改代码后,然后
%prep
#%setup -n %{name}-%{version}
%build
#%{python27} setup.py build
%clean
#[ -d %{_builddir}/%{name}-%{version} ] && rm -rf %{_builddir}/%{name}-%{version} #一直关着
然后在运行一次
rpmbuild -ba rpmbuild/SPECS/mysql-connector-python.spec && createrepo ./rpmbuild/RPMS/x86_64/
yum --enablerepo=jincom makecache yum --enablerepo=jincom install mysql-connector-python.
3)simplejson
__version__ = '3.4.0'
https://github.com/simplejson/simplejson/releases/tag/v3.4.0
https://github.com/simplejson/simplejson/archive/v3.4.0.zip
rpmbuild -ba rpmbuild/SPECS/python-simplejson.spec && createrepo ./rpmbuild/RPMS/x86_64/
4)python-tornado tornado-3.2-py2.7.egg-info
http://www.tornadoweb.org/en/stable/
rpmbuild -ba rpmbuild/SPECS/python-tornado.spec && createrepo ./rpmbuild/RPMS/x86_64/
要依赖python-simplejson
4.测试
yum --enablerepo=jincom makecache
yum --enablerepo=jincom install pypy
yum --enablerepo=jincom install python-redis
yum --enablerepo=jincom install mysql-connector-python
yum --enablerepo=jincom install python-tornado
注意源码包和rpm包不一样的,不要修改原来的name,修改rpm包的名字为newname
不对 name使用的是Name: %{pkgname} newname一样变化
Summary: %{pkgname}-%{version} on centos6.x for jincomgames
Group: jincomGAMES
rpm管理环境包和代码包的更多相关文章
- [Linux]服务管理:rpm包, 源码包
--------------------------------------------------------------------------------------------------- ...
- composer配合github发布管理代码包
前言 今日使用composer结合github管理代码包过程,方便日后需要,特此记录 流程 1 最大同性交友网站github创建自己项目,在自己项目新增composer.json文件 2 compos ...
- java之jvm学习笔记六-十二(实践写自己的安全管理器)(jar包的代码认证和签名) (实践对jar包的代码签名) (策略文件)(策略和保护域) (访问控制器) (访问控制器的栈校验机制) (jvm基本结构)
java之jvm学习笔记六(实践写自己的安全管理器) 安全管理器SecurityManager里设计的内容实在是非常的庞大,它的核心方法就是checkPerssiom这个方法里又调用 AccessCo ...
- Flask实战-留言板-安装虚拟环境、使用包组织代码
Flask实战 留言板 创建项目目录messageboard,从GreyLi的代码中把Pipfile和Pipfile.lock文件拷贝过来,这两个文件中定义了虚拟环境中需要安装的包的信息和位置,进入m ...
- Linux——【rpm、yun、源码包】安装
RPM包或者安装源码包 在windows下安装一个软件很轻松,只要双击.exe的文件,安装提示连续“下一步”即可,然而linux系统下安装一个软件似乎并不那么轻松,因为我们不是在图形界面下.所以我们要 ...
- 在 ASP.NET Core 项目中使用 npm 管理你的前端组件包
一.前言 在项目的前端开发中,对于绝大多数的小伙伴来说,当然,也包括我,不可避免的需要在项目中使用到一些第三方的组件包.这时,团队中的小伙伴是选择直接去组件的官网上下载,还是图省事直接在网上搜索,然后 ...
- 小程序代码包压缩 策略&方案
微信小程序自推出以来,逐渐发展,目前正受到越来越多的青睐.其中很重要的一点得益于小程序的轻量级特性,每个小程序最多不超过2MB,招之即来挥之即去,相比于几十上百兆的APP,用户进入小程序,或者说,小程 ...
- Net包管理NuGet(4)打包nuget包的进阶用法
nuget包不止可以放进dll,还可以引用其他包,创建项目文件及替换配置文件 引用的时候同时引用依赖项假设引用某个dll需要依赖其他的dll如Zeta.Core.dll需要引用ZETA.Seriali ...
- Linux磁盘管理,vi编辑器以及包管理器
一.Linux磁盘管理 Linux磁盘管理常用的三个命令为df,du,fdisk df:列出文件系统的整体磁盘使用量,利用这个命令来获取磁盘被占用了多少空间,,目前还剩下多少空间用法:df [-ahi ...
随机推荐
- java基础60 JavaScript字符串转换成数字(网页知识)
1.字符串转换成数字 <!doctype html> <html> <head> <meta charset="utf-8"> &l ...
- 2.SpringBoot之返回json数据
一.创建一个springBoot个项目 操作详情参考:1.SpringBoo之Helloword 快速搭建一个web项目 二.编写实体类 /** * Created by CR7 on 2017-8- ...
- LeetCode664. Strange Printer
There is a strange printer with the following two special requirements: The printer can only print a ...
- VMware虚拟机Mac OS X无法调整扩展硬盘大小的解决方案
使用VMware虚拟机搭建的MacOSX,在10.10以上可能会出现无法扩充磁盘大小的问题. 因为很多朋友在初次安装MacOSX的时候都默认选择40G的磁盘大小,结果用了没两天之后就发现磁盘不够用了. ...
- 【LOJ】#2031. 「SDOI2016」数字配对
题解 这个图是个二分图,因为如果有一个奇环的话,我们会发现一个数变成另一个数要乘上个数不同的质数,显然不可能 然后我们发现这个不是求最大流,而是问一定价值的情况下最大流是多少,二分一个流量,加上一条边 ...
- Hive分区和桶的概念
Hive 已是目前业界最为通用.廉价的构建大数据时代数据仓库的解决方案了,虽然也有 Impala 等后起之秀,但目前从功能.稳定性等方面来说,Hive 的地位尚不可撼动. 其实这篇博文主要是想聊聊 S ...
- hive将数据导致本地磁盘
hive -e "select * from wyp" >> local/wyp.txt 其中我更喜欢弄好临时表,然后交互式查询时让相关人员自己去按逻辑处理数据,最 ...
- 不定期更新的IDEA功能整理
目录 不定期更新的IDEA功能整理 idea 命令 Preferences 和 Project Structure Keymap HTTP Proxy Postfix Completion 插件 插件 ...
- 一、redis系列之基础知识与centos下环境搭建
1. Redis 与其他 key - value 缓存产品有以下三个特点: Redis支持数据的持久化,可以将内存中的数据保持在磁盘中,重启的时候可以再次加载进行使用. Redis不仅仅支持简单的ke ...
- MySQL大事务导致的Insert慢的案例分析
[问题] 有台MySQL服务器不定时的会出现并发线程的告警,从记录信息来看,有大量insert的慢查询,执行几十秒,等待flushing log,状态query end [初步分析] 从等待资源来看, ...