tar

LeetCode in Java [10]: 86. Partition List

会有一股神秘感。 提交于 2020-01-07 19:54:26
Given a linked list and a value x , partition it such that all nodes less than x come before nodes greater than or equal to x . You should preserve the original relative order of the nodes in each of the two partitions. Example: Input: head = 1->4->3->2->5->2, x = 3 Output: 1->2->2->4->3->5 自己的想法链表元素的移动法要处理的细节比如两指针预先就位什么的很多很麻烦,结果: Success Runtime: 0 ms, faster than 100.00% of Java online submissions for Partition List. Memory Usage: 36 MB, less than 100.00% of Java online submissions forPartition List. 代码: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode

【Linux命令大全】

☆樱花仙子☆ 提交于 2020-01-07 02:25:50
Linux常用命令大全 Linux命令格式: 命令 【选项】 【参数】 系统信息 arch   显示机器的处理器架构(1) uname -m   显示机器的处理器架构(2) uname -r   显示正在使用的内核版本 dmidecode -q   显示硬件系统部件 - (SMBIOS / DMI) hdparm -i /dev/hda   罗列一个磁盘的架构特性 hdparm -tT /dev/sda   在磁盘上执行测试性读取操作 cat /proc/cpuinfo   显示CPU info的信息 cat /proc/interrupts   显示中断 cat /proc/meminfo   校验内存使用 cat /proc/swaps   显示哪些swap被使用 cat /proc/version   显示内核的版本 cat /proc/net/dev   显示网络适配器及统计 cat /proc/mounts   显示已加载的文件系统 lspci -tv   罗列 PCI 设备 lsusb -tv   显示 USB 设备 date   显示系统日期 cal 2007   显示2007年的日历表 date 041217002007.00   设置日期和时间 - 月日时分年.秒   date -s '2019-11-12 15:20:20' clock -w  

k8s安装dashboard(未解决)

心不动则不痛 提交于 2020-01-07 00:35:16
第一种,用helm安装 helm repo update Hang tight while we grab the latest from your chart repositories... ...Skip local chart repository ...Successfully got an update from the "stable" chart repository Update Complete. [root@k8s-master templates]# helm repo list NAME URL stable https://kubernetes-charts.storage.googleapis.com local http://127.0.0.1:8879/charts [root@k8s-master templates]# helm fetch stable/kubernetes-dashboard [root@k8s-master templates]# ls deployment.yaml kubernetes-dashboard-1.10.1.tgz service.yaml [root@k8s-master templates]# tar -zvxf kubernetes-dashboard-1.10.1.tgz kubernetes

Time output redirection

做~自己de王妃 提交于 2020-01-06 14:41:27
问题 i have made an script to compress 3 files in zip and tar and measure the time to make a comparison, but when i try to redirect the output of time to a file the output stored in it is the tar and zip ones, could someone help me? #!/bin/bash if [ "$#" != 3 ] then echo "usage $0 file1 file2 file3" exit fi echo "Start\n" echo "First zip:" > time.txt time >> time.txt zip -r $1.zip $1 echo "first zip done" echo "first tar:" >> time.txt time >> time.txt tar czf $1.tar.gz $1 echo "first tar done"

Time output redirection

风格不统一 提交于 2020-01-06 14:41:04
问题 i have made an script to compress 3 files in zip and tar and measure the time to make a comparison, but when i try to redirect the output of time to a file the output stored in it is the tar and zip ones, could someone help me? #!/bin/bash if [ "$#" != 3 ] then echo "usage $0 file1 file2 file3" exit fi echo "Start\n" echo "First zip:" > time.txt time >> time.txt zip -r $1.zip $1 echo "first zip done" echo "first tar:" >> time.txt time >> time.txt tar czf $1.tar.gz $1 echo "first tar done"

Ant not creating tar files

﹥>﹥吖頭↗ 提交于 2020-01-06 08:48:12
问题 I have a little ant script which should create 3 tar files. <?xml version="1.0" encoding="UTF-8"?> <project basedir="." > <property name="dcc-shell.dir" value="${basedir}"/> <property name="dcc-mdp.dir" value="${dcc-shell.dir}/eq-mo-drop-copy-converter-mdp"/> <property name="mdp-code.dir" value="${dcc-mdp.dir}/src/main/*"/> <property name="dcc-srv.dir" value="${dcc-shell.dir}/eq-mo-drop-copy-converter-server"/> <property name="srv-code.dir" value="${dcc-srv.dir}/src/main/*"/> <property name=

CentOS6.5手动升级gcc4.8.2

孤者浪人 提交于 2020-01-06 01:40:41
一、简易安装 操作环境 CentOS6.5 64bit,原版本4.4.7,不能支持C++11的特性~,希望升级到4.8.2 不能通过yum的方法升级,需要自己手动下载安装包并编译 本文记录了在CentOS上编译安装gcc 4.8.4的过程。 1、安装依赖三大件 按顺序安装gmp、mpfr、mpc,注意要都是disable share Shell 1 2 3 4 5 wget ftp : / / gcc .gnu .org / pub / gcc / infrastructure / gmp - 4.3.2.tar.gz tar - xzvf gmp - 4.3.2.tar.gz . / configure -- enable - shared = no make - j4 sudo make install Shell 1 2 3 4 5 6 7 wget ftp : / / gcc .gnu .org / pub / gcc / infrastructure / mpfr - 2.4.2.tar.bz2 tar - xjvf mpfr - 2.4.2.tar.bz2 cd mpfr - 2.4.2 . / configure -- enable - shared = no make - j4 sudo make install Shell 1 2 3 4 5 6 wget ftp

linux命令笔记

别等时光非礼了梦想. 提交于 2020-01-05 06:51:08
目录说明 / 根目录 bin 和程序相关 boot 和开机相关 cdrom 光盘 dev 设备 etc 配置文件 lib 库 home 家目录,账户登录后默认的路径 常用命令 ls pwd 查看当前路径 从 / 根目录 开始 例如: /home/python cd change dir 改变当前路径 touch 创建文件 例如: touch 1.txt mkdir 创建文件夹 例如: mkdir laowang 自动创建依赖文件夹 例如: mkdir A/b/c/d -p clear 清屏 gedit 很low的编辑文件方式 例如: gedit nihaolaowang.txt cat 查看文件 例如: cat nihaolaowang.txt more 分屏显示 例如: more xxx.txt 例如:ls -alh /bin | more 释意:将 /bin目录下的所有文件 放到 | 里 分屏显示 history 查看历史命令 例如:history !+数字 重复历史命令,数字为历史编号 例如: !1544 cd ~ 跳到家目录 cd - 反回上次起跳目录 ctrl + c 该行命令暂时不执行 通配符 * 通配符,任意字符任意位 例如: python@ubuntu:~/Desktop/laowang$ ls 2* 223.txt 233.txt 243.txt 253.txt

Read Contents Tarfile into Python - “seeking backwards is not allowed”

给你一囗甜甜゛ 提交于 2020-01-05 04:01:08
问题 I am new to python. I am having trouble reading the contents of a tarfile into python. The data are the contents of a journal article (hosted at pubmed central). See info below. And link to tarfile which I want to read into Python. http://www.pubmedcentral.nih.gov/utils/oa/oa.fcgi?id=PMC13901 ftp://ftp.ncbi.nlm.nih.gov/pub/pmc/b0/ac/Breast_Cancer_Res_2001_Nov_9_3(1)_61-65.tar.gz I have a list of similar .tar.gz file I will eventually want to read in as well. I think (know) all of the tarfiles

python 解压 压缩包

杀马特。学长 韩版系。学妹 提交于 2020-01-04 15:49:16
转 http://m.blog.csdn.net/blog/wice110956/26597179# 这里讨论使用Python解压如下五种压缩文件: .gz .tar .tgz .zip .rar 简介 gz: 即gzip,通常只能压缩一个文件。与tar结合起来就可以实现先打包,再压缩。 tar: linux系统下的打包工具,只打包,不压缩 tgz:即tar.gz。先用tar打包,然后再用gz压缩得到的文件 zip: 不同于gzip,虽然使用相似的算法,可以打包压缩多个文件,不过分别压缩文件,压缩率低于tar。 rar:打包压缩文件,最初用于DOS,基于window操作系统。压缩率比zip高,但速度慢,随机访问的速度也慢。 关于zip于rar之间的各种比较,可见: http://www.comicer.com/stronghorse/water/software/ziprar.htm gz 由于gz一般只压缩一个文件,所有常与其他打包工具一起工作。比如可以先用tar打包为XXX.tar,然后在压缩为XXX.tar.gz 解压gz,其实就是读出其中的单一文件,Python方法如下: import gzip import os def un_gz(file_name): """ungz zip file""" f_name = file_name.replace(".gz", "")