xz

非 root 用户全局安装和配置 NodeJS

自闭症网瘾萝莉.ら 提交于 2019-12-04 01:53:21
主要针对 Linux 非 root 用户,在没有 root 权限下如果安装及配置 NodeJS(注:这里安装的是官网上已经编译好的二进制包)。 首先,到 NodeJS 的官网( https://nodejs.org/en/download/ )下载对应的已经编译好的二进制包。 这里以 CentOS7 32bit 为例,安装 NodeJS 的 LTS 版本: 1. 下载 Linux Binaries 64bit 版本: curl -o node-v8.9.4-linux-x64.tar.xz https://nodejs.org/dist/v4.4.2/node-v4.4.2-linux-x86.tar.xz 2. 下载好的二进制压缩包解压至指定的安装目录(这里以~/tools/nodejs 为例) mkdir -p ~/tools/nodejs tar -xJf node-v8.9.4-linux-x64.tar.xz --no-wildcards-match-slash \ --anchored --exclude */CHANGELOG.md --exclude */LICENSE --exclude */README.md \ --strip 1 -C ~/tools/nodejs 注:如果出错并提示 xz: Cannot exec: No such file or

Python 2.7: Compressing data with the XZ format using the “lzma” module

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm experimenting with the lzma module in Python 2.7.6 to see if I could create compressed files using the XZ format for a future project that will make use of it. My code used during the experiment was: import lzma as xz in_file = open('/home/ki2ne/Desktop/song.wav', 'rb') input_data = in_file.read() compressed_data = xz.compress(input_data) out_file = open('/home/ki2ne/Desktop/song.wav.xz', 'wb') in_file.close() out_file.close() and I noticed there were two different checksums (MD5 and SHA256) from the resulting file compared to when I

centos 7 下 rabbitmq 3.8.0 & erlang 22.1 源码编译安装

丶灬走出姿态 提交于 2019-12-02 22:43:37
centos 7 下 rabbitmq 3.8.0 & erlang 22.1 源码编译安装 安装前请检查好erlang和rabbitmq版本是否相匹配 参考: RabbitMQ Erlang Version Requirements 1. erlang 22.1 源码编译安装 1.1 安装Erlang编译安装必要依赖 sudo yum install -y gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git 1.2 下载erlang 22.1源码包 wget http://erlang.org/download/otp_src_22.1.tar.gz 1.3 编译并安装 # 解压 tar -zvxf otp_src_22.1.tar.gz cd otp_src_22.1 #编译&安装 ./otp_build autoconf ./configure && make && sudo make install 默认安装在/usr/local/lib/erlang/目录下 1.4 验证 erl -version Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 10.5 或 erl

Linux学习打卡第二天

匿名 (未验证) 提交于 2019-12-02 21:59:42
cat 含义:concatenate,从第一行开始显示文件内容 格式:cat [-AbEnTv] 文件路径 -A:显示文件的完整信息,包括特殊字符 -b:列出行号,空白行不标行号 -n:列出行号,空白行也有行号 -T:将[tab]按键以 ^I 显示出来 tac 含义:cat倒着写,从最后一行往前开始显示 nl 含义:显示的时候顺带输出行号 格式:nl [-bnw] 文件路径 -b: -b a:空行也列出行号 $ nl - b a / etc / issue //结果显示: 1 \S 2 Kernel \r on an \ m 3 -b t:空行不列出行号(默认) $ nl - b t / etc / issue //结果显示: 1 \S 2 Kernel \r on an \m -n: -n ln:行号在屏幕最左方显示 -n rn:行号在自己字段的最右方显示,且不加0 -n rz:行号在自己字段的最右方显示,且加0 -w:行号字段的占用字符数 more 含义:一页一页的显示文件内容 格式:more 文件路径 [空格键]:向下翻一页 [enter]:向下翻一行 /字串:搜索关键字 q:离开,退出显示 b:往前翻页,只对文件有用,对管线无用 less [空白建]:向下翻一页 [pageUp]:向上翻一页 [pageDown]:向下翻一页 /字串:向下搜索字串 ?字串:向上搜索字串

Linux的压缩及解压命令

匿名 (未验证) 提交于 2019-12-02 21:56:30
压缩 #压缩成tar.zx格式,如果要保留被压缩的文件加上参数 -k ,如果要设置压缩率加入参数 -0 到 -9调节压缩率。如果不设置,默认压缩等级是6. xz -z 要压缩的文件 #将目录里所有jpg文件打包成jpg.tar #将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gz #将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz2 #将目录里所有jpg文件打包成jpg.tar后,并且将其用compress压缩,生成一个umcompress压缩过的包,命名为jpg.tar.Z #rar格式的压缩,需要先下载rar for Linux rar a jpg.rar *.jpg #zip格式的压缩,需要先下载zip for linux zip jpg.zip *.jpg 解压 解压到其他目录,开始用-C ,如:tar -xvJf ***.tar.gz /usr/local/xx #tar.xz格式 方法1: tar -xvJf ***.tar.gz 方法2: #xz是一个工具, 系统中没有安装,需要下载 xz -d ***.tar.xz #上面会把 .tar.xz 文件解压为 .tar文件 #解压 .tar 文件 tar -xvf **

Linux -gzip、bzip2、xz

匿名 (未验证) 提交于 2019-12-02 21:53:52
常见压缩文件: windows:.rar .zip .7z linux: .zip .gz .bz2 .xz .tar.gz .tar.bz2 .tar.xz 压缩作用: 1.节省空间,方便传输。 2.带宽资源耗费少。 gzip(不能压缩目录) 压缩: 公式: gzip 文件名 例如: gzip 1.txt 得到结果为:1.txt.gz 解压: 公式: gzip -d 文件名 例如: gzip -d 1.txt.gz 压缩级别(1-9级别,默认为6,1压缩不严谨,压缩级别越高时,cpu使用越高,不常用) 公式: gzip -1 文件 例如: gzip -1 1.txt zcat 压缩的文件 可查看压缩内容,流程是先解压,再查看 压缩到指定目录,且源文件不会消失 gzip在进行压缩时,压缩之后,源文件会消失,当 gzip -c 文件 >(重定向) /目录/文件.gz 解压到指定目录,且源文件不会消失 gzip在进行解压时,解压之后,源文件会消失,当 gzip -c -d 文件 >(重定向) /目录/文件.gz bzip2: 安装:yum install -y bzip2 用法与gzip相同,只不过压缩比gzip压缩更彻底 不支持压缩目录。 bzip2默认压缩级别为9。 用法与gzip相同,比bzip2压缩更彻底解压xz的压缩包。 不常用 压缩:gzip<bzip<xz

Rabbit MQ

一个人想着一个人 提交于 2019-12-02 19:43:18
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-deve wget http://erlang.org/download/otp_src_18.3.tar.gz tar -xvf otp_src_18.3.tar.gz ./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac make make install vim /etc/profile #在文件末尾添加下面代码 'ERLANG_HOME'等于上一步'--prefix'指定的目录 ERLANG_HOME=/usr/local/erlang PATH=$ERLANG_HOME/bin:$PATH export ERLANG_HOME export PATH #使环境变量生效 source /etc/profile #输入命令检验是否安装成功 erl wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-generic-unix

centos 7.6安装python 3.7

好久不见. 提交于 2019-12-02 19:00:27
原文参考: https://www.cnblogs.com/felixwang2/p/9934460.html https://blog.csdn.net/m0_37886429/article/details/86700665 前言:在centos 7.6上面已经安装了python2环境,如果想要继续安装python3而不卸载python2,下面详细介绍一下。 基本命令 (1)python -V 或者 python --version  #查看python版本 (2)python  #检测python安装是否成功,并且也可以查看版本号 1. 下载安装包并安装依赖关系 wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel 2. 解压文件并开始安装 这里要注意tar.xz结尾的文件的解压方式: mkdir /usr

Create a tar.xz in one command

别等时光非礼了梦想. 提交于 2019-12-02 13:54:48
I am trying to create a .tar.xz compressed archive in one command. What is the specific syntax for that? I have tried tar cf - file | xz file.tar.xz , but that does not work. Use the -J compression option for xz . And remember to man tar :) tar cfJ <archive.tar.xz> <files> Edit 2015-08-10: If you're passing the arguments to tar with dashes (ex: tar -cf as opposed to tar cf ), then the -f option must come last , since it specifies the filename (thanks to @A-B-B for pointing that out!). In that case, the command looks like: tar -cJf <archive.tar.xz> <files> Switch -J only works on newer systems.

How to unpack xz file with python which contains only data but no filename?

三世轮回 提交于 2019-12-01 16:21:58
I have a file, which I can decompress under linux using the following command: unxz < file.xz > file.txt How can I do the same using python? If I use python3 and the tarfile module and do the following: import sys import tarfile try: with tarfile.open('temp.xz', 'r:xz') as t: t.extract() except Exception as e: print("Error:", e.strerror) I get the exception: ReadError('invalid header',) . So apparently it expects some file- or directory information which is not present in the xz file. So how can I decompress a file without header information? The tarfile module is only for... err... tar files.