Showing posts with label Other. Show all posts
Showing posts with label Other. Show all posts

Sunday, January 2, 2022

[Other] 小内存处理1G或10G大小的log文件

 主要原理:大文件分割成小文件。split 分割文件命令


为了保证文件的完整性,要按行分割

wc -l test.log   #查看总共多少行

可知81910500行, 分割成10M左右,81910500/102.4 约800000 行一个文件

#     按行  行数   文件名   后缀数字  后缀4位   前缀  

split -l 800000 test.log -d       -a   4   test_




查看小文件即可

less test_0001

cat -n test_0001 | grep 查找内容



补充内容:

1、快速生成1G大log文件

首先我有约100k的小文件s.log,循环 10500次生成大约1G文件test.log。

shell脚本内容如下:


touch test.log

 

for((i=0;i<10500;i++))

do

    cat s.log >> test.log

    echo "www.djlcx.cn" >>test.log

done


2、split的使用

-b 按文件大小分割

split -b 1M file      #默认后缀是字母 xaa xab xac ...

split -b 10k file -d -a 3   #3位数字后缀  x000 x001 x002 ...

split -b 10k file -d -a 3 split_   #指定前缀



3、合并文件

cat test_* >t.log

————————————————

原文链接:https://blog.csdn.net/u010071211/article/details/85166744

Other Index

Blockchain

Docker

tmux

Kubernetes

平行壓縮程式

other

win10连接无线时不能输入密码

語系代碼 ISO 639-1

小内存处理1G或10G大小的log文件

Google Style Guide

  一个辅助 Clang-Format 整个目录的简单工具

 Clang-format格式化及配置参数

Thursday, February 4, 2021

Tmux index

用 tmux 保持遠端 ssh 連線

tmux关机永久保存会话

Tmux Cheat Sheet & Quick Reference

Run tmux



Run tmux

echo "create 2k11 Android  Ref session"

ROOT_PATH=`pwd`

CONN_PATH="src/"

BASE_PATH=${ROOT_PATH}/${CONN_PATH}

i=0

tmuxname[$((i++))]="build1"

tmuxname[$((i++))]="sync1"

tmuxname[$((i++))]="phone1"

tmuxname[$((i++))]="phone2"

tmuxname[$((i++))]="app1"

tmuxname[$((i++))]="app2"

tmuxname[$((i++))]="fmk"

tmuxname[$((i++))]="xml"


i=0

tmuxpath[$((i++))]=${BASE_PATH}

tmuxpath[$((i++))]=${BASE_PATH}

tmuxpath[$((i++))]=${BASE_PATH}/vendor/xxx

tmuxpath[$((i++))]=${BASE_PATH}/vendor/xxx

tmuxpath[$((i++))]=${BASE_PATH}/vendor/xxx

tmuxpath[$((i++))]=${BASE_PATH}/vendor/xxx

tmuxpath[$((i++))]=${BASE_PATH}/frameworks

tmuxpath[$((i++))]=${BASE_PATH}/xxx


fnum=${i}


pushd ${BASE_PATH}

  for ((i=0; i<${fnum}; i++))

  do

    tmux new -s ${tmuxname[$i]} -n add_1 -d "cd ${BASE_PATH};bash -i"

  done

popd


Friday, December 18, 2020

簡體 科技 翻譯

文件句柄  https://baike.baidu.com/item/%E6%96%87%E4%BB%B6%E5%8F%A5%E6%9F%84

Tuesday, November 3, 2020

HEAD detached at the HEAD commit id

git status

HEAD detached at e1997bd

git rev-parse HEAD

e1997bd

git checkout <commit_id>

 -- or --

git checkout origin/master

git checkout <branch_name>

Thursday, October 8, 2020

repo index

error: Your local changes to the following files would be overwritten by checkout:
    Android.mk
    extendedcommands.c
    flashutils/Android.mk
    flashutils/flashutils.c
    flashutils/flashutils.h
    mounts.c
    mounts.h
    nandroid.c
    roots.c
Please, commit your changes or stash them before you can switch branches.
Aborting
error: Your local changes to the following files would be overwritten by checkout:
    encore.mk
    init.encore.rc
Please, commit your changes or stash them before you can switch branches.
Aborting
<few more errors like this.........>
error: bootable/recovery/: CyanogenMod/android_bootable_recovery checkout 50822991460cbee65757e9de12b29e39238d6386 
error: device/bn/encore/: CyanogenMod/android_device_bn_encore checkout f6586ab41f0e3f5acfa16b43f9b17008e9bb0524 


解法:丢弃修改

repo forall -c git reset --hard HEAD


How switch to special tag?

repo forall -c "git checkout <special tag>"


repo sync -c -n -j4 && repo sync -c -l -j 16 

前面是抓code, 後面是長code


repo 打 tag

repo forall -c 'git tag spectralink_sprint_8'

repo forall -c 'git push origin --tags'

切换到另一个分支

repo forall -c git checkout your_branch

删除分支

repo forall -c git branch -D 分支名称


[git]repo、branch和tag取名建議和注意事項 - 怎麼取名比較不會有問題

n8n index

 【n8n免費本地端部署】Windows版|程式安裝x指令大補帖  【一鍵安裝 n8n】圖文教學,獲得無限額度自動化工具&限時免費升級企業版功能