Using Gnumeric for spreadsheet files manipulation

Gnumeric has tools to automate and manipulate spreadsheet files from command line interface. It can be used to create spreadsheet from CSV files, convert between different file formats like f,e: XLS, ODS, HTML, LaTeX, PDF and many more. Below are listed a few examplesfor spreadsheet manipulation.

Merge all csv files in current directory into a spreadsheet named test.xls, using gnumeric automation command:

ssconvert -merge-to=output.ods *.csv

ssconvert --merge-to=output.xls one.csv two.csv three.csv ...

To convert a gnumeric spreadsheet f.e. table.gnumeric to a Microsoft Excel format table.xls use:

ssconvert table.gnumeric table.xls

Convert to a Libreoffice file:

ssconvert table.gnumeric table.ods

Export a spreadsheet to a Portable Document File:

ssconvert table.ods table.pdf
Check portage dependencies using emerge

Verify portage dependencies pulled by a example package, the emerge --tree option displays a dependency tree

user@host ~ % emerge -va firefox --tree

These are the packages that would be merged, in reverse order:

Calculating dependencies               ... done!                   
[ebuild     U ~] www-client/firefox-63.0::gentoo [62.0.3::gentoo] USE="eme-free hardened hwaccel system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-sqlite -bindist -clang -custom-cflags -custom-optimization -dbus -debug -geckodriver -gmp-autoupdate -jack -lto (-neon) -pulseaudio -screenshot (-selinux) -startup-notification -test -wifi" L10N="de -ach -af -an -ar -as -ast -az -bg -bn-BD -bn-IN -br -bs -ca -cak -cs -cy -da -dsb -el -en-GB -en-ZA -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mai -mk -ml -mr -ms -nb -nl -nn -or -pa -pl -pt-BR -pt-PT -rm -ro -ru -si -sk -sl -son -sq -sr -sv -ta -te -th -tr -uk -uz -vi -xh -zh-CN -zh-TW" 0 KiB
[ebuild  N     ]  net-libs/nodejs-8.12.0::gentoo  USE="npm snapshot ssl -debug -doc -icu -inspector -systemtap -test" CPU_FLAGS_X86="sse2" PYTHON_TARGETS="python2_7" 0 KiB
[ebuild  N     ]   net-libs/nghttp2-1.33.0:0/1.14::gentoo  USE="cxx threads xml -debug -hpack-tools -jemalloc -libressl -static-libs -test -utils" ABI_X86="(64) -32 (-x32)" 0 KiB
[ebuild  N     ]   dev-libs/libuv-1.20.0:0/1::gentoo  USE="-static-libs" ABI_X86="(64) -32 (-x32)" 0 KiB
[ebuild  N    ~]  dev-util/cbindgen-0.6.6::gentoo  USE="-debug" 0 KiB

Total: 5 packages (1 upgrade, 4 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] 

And yes, it is true, Firefox-63 started to pull nodejs as dependency on gentoo systems.

For gentoo slotted packages, like f.e. python3.6 python3.5 use the following command to find out packages depending on certain python version:

emerge -capv python:3.6

Same example showing dependency on Qt4:

user@host ~ % emerge -capv qtgui:4                                

Calculating dependencies... done!                            
  dev-qt/qtgui-4.8.7 pulled in by:                                                               
    sys-boot/unetbootin-657 requires dev-qt/qtgui:4                                              

>>> No packages selected for removal by depclean                                        
Packages installed:   1355                                 
Packages in world:    370                                                 
Packages in system:   43                                     
Required packages:    1355                      
Number to remove:     0       
Sed file manipulation snipplets

sed snipplets to manipulate file content.

Following file:

user@host % more example.txt
Lorem ipsum
dolor sit amet,
consectetur adipiscing elit,

Add a character at the beginning of each line using sed command. Add ! at the front of each line:

user@host % sed 's/^/!/' example.txt
!Lorem ipsum
!dolor sit amet,
!consectetur adipiscing elit,

Add a character at the end of each line using sed command. Add # at the end of each line:

user@host % sed 's/$/!-end/' example.txt
Lorem ipsum !-end
dolor sit amet, !-end
consectetur adipiscing elit,!-end
Show configuration archive on a Cisco NX-OS

Using an IOS it is possible to configure a archive that is held in RAM or configation changes writen to flash:

Configuration:

conf t
!
archive
 log config
  logging enable
  logging size 1000
  hidekeys
!
end
wr

Show archive configuration commands hold in the memory:

R1# show archive log config all

On a NX-OS device an archive is not needed to be configured. The command to show the configuration archive:

R2#show accounting log | i configure