Search This Blog

Wednesday, April 12, 2023

[Ubuntu] find command with grep

 find -name "*.java" -exec grep "foo" -Hn {} \;

 

-H Display filesname

-n Display line number

Monday, March 27, 2023

[Ubuntu] Create tar file exclude specified directory

Tar foo directory, and exclude "foo/.repo"  directory

─foo

   ├─.repo

   │     └─ example

   └─ 1.txt

$ tar -cvf foo.tar --exclude='foo/.repo' foo


Remove directory "foo/.repo" from tar file

$ tar --delete foo/.repo -f foo.tar

Monday, November 14, 2022

[Ubuntu] Split large file into smaller pieces

Split file into per file 1024MB

split -b 1024M -d foo.tar.xz foo.tar.xz-

foo.tar.xz-00    1024MB

foo.tar.xz-01    1024MB

...


Merge pieces to large file

cat foo.tar.xz-* > foo.tar.xz


Wednesday, November 9, 2022

[Mac OS] React Native - Environment Setting

 Trouble Shooting:

% bundle install

Your Ruby version is 2.6.3, but your Gemfile specified 2.7.4

or 

Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5


Saturday, September 17, 2022

[Firefox] Youtube video decoding with hardware acceleration (GPU)

 Windows下使用Firefox看Youtube影片時,用工作管理員觀察,發現GPU的使用率都為0,但如果用Chrome則會使用到GPU。最後發現以about:config進行修改,就可以讓Firefox使用GPU 加速影片decoding。


Thursday, February 17, 2022

[7zip] 壓縮及分割檔案

壓縮比例

-mx=5

可填入數值0(封存),1,3,5(預設),7,9(最大壓縮比)

壓縮檔案分割大小

-v650m

可填入單位b(bytes),k(KB),m(MB),g(GB)

範例:

封存Source目錄,以650MB分割壓縮檔,以aaa.7z為壓縮檔名

 7z a -mx=0 -v650m aaa.7z Source

 


Friday, November 5, 2021

[Visual Studio] 下載NuGet套件(Restore NuGet packages)

在命令列模式下使用MSBuild下載Nuget套件(Restore NuGet packages in command line)

msbuild version > 16.5

專案中有packages.config檔案

在有.sln檔案的路徑,執行以下命令即可

msbuild -t:restore -p:RestorePackagesConfig=true


Reference:

https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#restore-using-the-nugetexe-cli