Terminator 1.91 slow after few days - terminator

I am using terminator 1.91; and it tends to get very slow over time. By slow I mean the interactive response & display. I generally have very very long sessions for multiple days with approximately 20 tabs open; not using any grouping functionality. Also, not displaying a lot of data continuously in any terminal.
The bug happens in 1.91 and the current head release but doesn't happen on 0.98 though I can't use 0.98 because of another unrelated bug. I have also tried to completely remove my config file and that doesn't help either.
Library Calls in 5 seconds (time ltrace -c -f -p 24070)
% time seconds usecs/call calls function
------ ----------- ----------- --------- --------------------
20.66 0.110916 135 818 strlen
19.03 0.102159 135 752 memset
13.44 0.072136 135 532 memcmp
11.12 0.059714 136 438 strchr
10.45 0.056124 136 412 __ctype_b_loc
6.45 0.034630 137 252 strncpy
4.94 0.026512 132 200 memcpy
3.12 0.016724 135 123 sem_post
2.42 0.012983 141 92 pthread_self
2.18 0.011700 139 84 malloc
2.13 0.011434 136 84 sem_trywait
2.10 0.011292 134 84 free
1.13 0.006068 155 39 sem_wait
0.71 0.003818 159 24 __errno_location
0.12 0.000650 325 2 strcmp
------ ----------- ----------- --------- --------------------
100.00 0.536860 3936 total
0.14user 0.49system 0:05.44elapsed 11%CPU (0avgtext+0avgdata 2888maxresident)k
0inputs+0outputs (0major+222minor)pagefaults 0swaps
System calls in 5 seconds (time strace -c -f -p 24070)
strace: Process 24070 attached with 4 threads
^Cstrace: Process 24070 detached
strace: Process 24072 detached
strace: Process 24073 detached
strace: Process 24074 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
80.09 0.023601 142 166 poll
9.46 0.002787 2787 1 restart_syscall
4.38 0.001292 4 302 191 read
3.25 0.000957 5 190 163 recvmsg
2.40 0.000707 4 188 write
0.14 0.000042 11 4 sendmsg
0.14 0.000041 3 13 writev
0.14 0.000041 3 16 nanosleep
------ ----------- ----------- --------- --------- ----------------
100.00 0.029468 880 354 total
0.00user 0.04system 0:05.36elapsed 0%CPU (0avgtext+0avgdata 2464maxresident)k
0inputs+0outputs (0major+162minor)pagefaults 0swaps
lsof shows a lot of /tmp/#<> files and a few /dev/pmtx
It would be great if anybody has any idea.

Related

wanted to extract table info from the webpage

i just wanted to scrape the Countries in the world by population table from below table
"https://www.worldometers.info/world-population/population-by-country/"
sample data
You can grab the desired table data using pandas
import pandas as pd
import requests
headers={"User-Agent":"mozilla/5.0"}
url='https://www.worldometers.info/world-population/population-by-country/'
red=requests.get(url,headers=headers).text
df = pd.read_html(red)[0]
print(df)
Output:
0 1 China 1439323776 ... 38 61 % 18.47
%
1 2 India 1380004385 ... 28 35 % 17.70
%
2 3 United States 331002651 ... 38 83 % 4.25
%
3 4 Indonesia 273523615 ... 30 56 % 3.51
%
4 5 Pakistan 220892340 ... 23 35 % 2.83
%
.. ... ... ... ... ... ... ...
230 231 Montserrat 4992 ... N.A. 10 % 0.00
%
231 232 Falkland Islands 3480 ... N.A. 66 % 0.00
%
232 233 Niue 1626 ... N.A. 46 % 0.00
%
233 234 Tokelau 1357 ... N.A. 0 % 0.00
%
234 235 Holy See 801 ... N.A. N.A. 0.00
%
[235 rows x 12 columns]

How access to display device in embedded-linux + Qt ? /dev/fb0 not found

1-I have built Qt5.4.1 and Qt4.8.4 for an embedded device (based on armv5tejl) and all things work except GUI.
2-It seems that no frame buffer device exists:
~/bin $ ls -alh /dev/
drwxr-xr-x 3 0 sandbox 0 Nov 10 11:48 .
drwxr-xr-x 14 0 root 0 Nov 14 2017 ..
srw-rw-rw- 1 0 root 0 Nov 10 11:48 log
crw-rw-rw- 1 0 root 1, 3 Nov 10 11:48 null
crw-rw-rw- 1 0 root 5, 2 Nov 10 12:10 ptmx
drwxr-xr-x 2 0 root 0 Jan 1 1970 pts
crw-rw-rw- 1 0 root 5, 0 Nov 10 11:48 tty
crw-rw-rw- 1 0 root 204, 66 Nov 10 12:05 ttyAMA2
crw-r--r-- 1 0 root 1, 9 Nov 10 11:48 urandom
/proc $ cat devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
/proc $ cat devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
5 /dev/tty
5 /dev/console
5 /dev/ptmx
7 vcs
10 misc
13 input
21 sg
29 fb
89 i2c
90 mtd
100 softkey
116 alsa
122 pman
128 ptm
136 pts
150 pwmr
153 upc
154 kdrv_csc
180 usb
189 usb_device
204 ttyAMA
254 rtc
Block devices:
1 ramdisk
259 blkext
8 sd
31 mtdblock
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
3-from dmesg log:
Console: switching to colour frame buffer device 80x30
CLCD: PL110 CLCD hardware, HIE AT-T050QGH-02, VGA Landscape (supports 640x480 # 24Mhz) display
4-Device itself has a SDK and display things using that SDK and libs in HTML format.
5-I have a restricted user on the device and I'm using my own BusyBox v1.20.0.
My Questions:
1-Is it possible for me to use device display via Qt without using provided SDK?
2-How could I access to the display device?
Any help would be appreciated.
Thank you very much

gnuplot, How to connect points with multiple lines in 3D from a file?

I'm not familiar with gnuplot, so I'm really getting hard time to deal with it. I know how to plot as 3D and use columns for variables.
Anyway, my question is how to connect points which have the same distance values, but connect those in order of rank below. For example, my file has the information below ;
#ID Rank Diatance x y z
25 2 50 13 14 39
34 1 50 19 90 23
23 3 50 54 87 12
48 1 143 78 40 36
38 5 143 10 76 54
96 4 143 64 76 88
104 3 143 19 82 74
201 2 143 30 89 47
76 1 604 103 298 263
97 2 604 111 103 133
87 4 604 215 222 132
109 5 604 175 184 158
283 3 604 102 108 155
294 6 604 530 456 384
You see there are 3 different distances and 3 groups of each distance have own ranks. What I want to do is to connect those points that have the same distance values only(the 3rd column), but simultaneously I want to make those being connected in order of rank(the 2nd column), so the expected result I think is that in 3D plot, there are only 3 lines(or curves).
Please help me!
You have to sort the data file first by distance, then by rank, and insert blank lines whenever the distance value changes. I'm not sure if you can do all this from within gnuplot, but on a unix-ish system you can easily invoke standard tools to do that for you:
splot "<cat test.dat | sort -n -k 3 -k 2 | awk '{if ($3 != olddistance) {print \"\"}; print; olddistance=$3}'" u 4:5:6 w lp
If you want different colors for the lines that connect each group you can use
splot "<cat test.dat | sort -n -k 3 -k 2 | awk '{if ($3 != olddistance) {print \"\"}; print; olddistance=$3}'" u 4:5:6:-1 w lp lc variable
It would be interesting to know more about the background of this plotting challenge. What is it for?
Yes, you can do it with gnuplot-only (hence platform-independent), however, gnuplot itself is really bad at sorting. Actually, it doesn't want to be good, you are supposed to use external tools for simple sorting of internal data. From gnuplot 5.4.0 on, you have zsort (check help zsort), but which is also not a really good way of sorting.
Nevertheless, there is a cumbersome workaround to sort within gnuplot. It requires gnuplot>=5.2.0 since it's using indexing of datablocks.
For your task, I assume that the data is already sorted in column 3.
The script below does the following:
adds the row number in front of the line
inserts empty lines when colunn 3 value changes
sorts the lines (each block separately) by (former) column 2 (now column 3) via smooth freq (check help smooth)
prints the data in new order to the datablock $Sorted
plots the data colored by pseudocolumn -1 (check help pseudocolumns) as you have empty lines between the subblocks
Script: (works with gnuplot>=5.2.0, Sept. 2017)
### plot points (dis)connected in a sorted way
reset session
$Data <<EOD
#ID Rank Diatance x y z
25 2 50 13 14 39
34 1 50 19 90 23
23 3 50 54 87 12
48 1 143 78 40 36
38 5 143 10 76 54
96 4 143 64 76 88
104 3 143 19 82 74
201 2 143 30 89 47
76 1 604 103 298 263
97 2 604 111 103 133
87 4 604 215 222 132
109 5 604 175 184 158
283 3 604 102 108 155
294 6 604 530 456 384
EOD
# add empty lines when column 3 changes
set print $Temp1
v1 = NaN
do for [i=2:|$Data|] {
v0 = v1
v1 = real(word($Data[i],3))
if (v0!=v1) { print ""}
print sprintf("%d ",i).$Data[i] # add row index in front
}
set print
# sort by column 3 (former column 2)
set table $Temp2
plot $Temp1 u 3:1 smooth freq
unset table
# re-print $Temp2 in sorted order
set print $Sorted
do for [i=5:|$Temp2|] {
if (strlen($Temp2[i])>0) { print $Data[int(word($Temp2[i],2))] }
else { print "" }
}
set print
set key noautotitle
set xyplane relative 0
set ytics 100
set grid x,y
set view 65,16
set colorsequence classic
splot $Sorted u 4:5:6:(column(-1)+1) w lp pt 7 lc var lw 2, \
'' u 4:5:6:(column(-1)+1) w p pt 7 lc var
### end of script
Result:

debugger freezes on X (arm)

I am developing an application for Olimex A20 with Qt 5.7. This app needs to run on X. If I just run the application it works perfectly fine. The issue is with the debuging - debugger freezes. This is the stack trace I see when I interrupt the debugger.
This is the line of code where the debugger is waiting for something to happen (qwaitcondition_unix.cpp - line 143).
code = pthread_cond_wait(&cond, &mutex);
This is the main stack trace from thread #1
1 __libc_do_syscall 0xb5dd6514
2 pthread_cond_wait * *GLIBC_2.4 0xb5dd1da6
3 QWaitConditionPrivate::wait qwaitcondition_unix.cpp 143 0xb63a7a44
4 QWaitCondition::wait qwaitcondition_unix.cpp 215 0xb63a7a44
5 QSemaphore::acquire qsemaphore.cpp 143 0xb63a2dba
6 QMetaObject::activate qobject.cpp 3708 0xb6506c6e
7 QMetaObject::activate qobject.cpp 3602 0xb6506fee
8 QDBusConnectionManager::connectionRequested moc_qdbusconnectionmanager_p.cpp 141 0xb3baf2a0
9 QDBusConnectionManager::connectToBus qdbusconnection.cpp 225 0xb3b6b37e
10 QDBusConnectionManager::busConnection qdbusconnection.cpp 134 0xb3b6b488
11 QDBusConnection::sessionBus qdbusconnection.cpp 1195 0xb3b6c058
12 DBusConnection::DBusConnection dbusconnection.cpp 73 0xb3e08a4c
13 QSpiAccessibleBridge::QSpiAccessibleBridge bridge.cpp 66 0xb3dff070
14 QXcbIntegration::accessibility qxcbintegration.cpp 337 0xb3dc563c
15 platformAccessibility qaccessible.cpp 485 0xb6a4ae34
16 QAccessible::isActive qaccessible.cpp 791 0xb6a4ae34
17 QQuickTextInputPrivate::emitCursorPositionChanged qquicktextinput.cpp 4206 0xb6eb5fde
18 QQuickTextInputPrivate::moveCursor qquicktextinput.cpp 3264 0xb6eb9d76
19 QQuickTextInputPrivate::setCursorPosition qquicktextinput_p_p.h 407 0xb6eb9e2a
20 QQuickTextInput::setReadOnly qquicktextinput.cpp 682 0xb6eb9e2a
21 QQuickTextInput::qt_static_metacall moc_qquicktextinput_p.cpp 1180 0xb6f593e8
22 QQuickTextInput::qt_metacall moc_qquicktextinput_p.cpp 1257 0xb6f59cf8
23 QQmlPropertyPrivate::write qqmlproperty.cpp 1254 0xb68a648a
24 QQmlPropertyPrivate::writeValueProperty qqmlproperty.cpp 1183 0xb68a7594
25 QQmlBinding::write qqmlbinding.cpp 333 0xb68f38da
26 QQmlBinding::update qqmlbinding.cpp 197 0xb68f46fc
27 QQmlObjectCreator::finalize qqmlobjectcreator.cpp 1202 0xb68faf92
28 QQmlComponentPrivate::complete qqmlcomponent.cpp 926 0xb68a861e
29 QQmlComponentPrivate::completeCreate qqmlcomponent.cpp 962 0xb68a8698
30 QQmlComponent::create qqmlcomponent.cpp 788 0xb68a85ac
31 QQmlApplicationEnginePrivate::_q_finishLoad qqmlapplicationengine.cpp 136 0xb68f55fc
32 QQmlApplicationEnginePrivate::startLoad qqmlapplicationengine.cpp 115 0xb68f57a4
33 QQmlApplicationEngine::load qqmlapplicationengine.cpp 260 0xb68f57de
34 main main.cpp 50 0x1fd60
This is thread #6
1 __libc_do_syscall 0xb5dd6514
2 pthread_cond_wait * *GLIBC_2.4 0xb5dd1da6
3 _mali_osu_lock_wait 0xb61ec7fe
4 __egl_worker_thread 0xb61e7096
5 start_thread 0xb5dcd5dc
6 ??
0xb5ffd71c
Anyone came across this issue? Any pointers would be appreciated.

merge two files by one column

I have two files
$ wc -l new_bacteria.txt
28633861 new_bacteria.txt
$ wc -l allin1_trinity_bacteria_blastx.tsv
4352 allin1_trinity_bacteria_blastx.tsv
$ head new_bacteria.txt
gi|406035365|ref|ZP_11042729.1| Acinetobacter parvus
gi|406035366|ref|ZP_11042730.1| Acinetobacter parvus
gi|406035367|ref|ZP_11042731.1| Acinetobacter parvus
gi|406035368|ref|ZP_11042732.1| Acinetobacter parvus
gi|406035369|ref|ZP_11042733.1| Acinetobacter parvus
gi|406035370|ref|ZP_11042734.1| Acinetobacter parvus
gi|406035371|ref|ZP_11042735.1| Acinetobacter parvus
gi|406035372|ref|ZP_11042736.1| Acinetobacter parvus
gi|406035373|ref|ZP_11042737.1| Acinetobacter parvus
gi|406035374|ref|ZP_11042738.1| Acinetobacter parvus
$ head allin1_trinity_bacteria_blastx.tsv
c91_g1_i1 gi|46447089|ref|YP_008454.1| 39.60 101 59 1 306 4 1676 1774 6e-11 68.2
c146_g1_i1 gi|357399595|ref|YP_004911520.1| 39.53 86 47 2 246 4 49 134 5e-06 52.0
c202_g1_i1 gi|508605652|ref|YP_006991274.2| 62.16 37 14 0 154 44 49 85 3e-06 45.4
c202_g1_i1 gi|508605652|ref|YP_006991274.2| 63.16 19 7 0 201 145 33 51 3e-06 27.7
c202_g1_i1 gi|508605652|ref|YP_006991274.2| 76.92 13 3 0 242 204 20 32 3e-06 21.6
c224_g1_i1 gi|395217261|ref|ZP_10401556.1| 72.62 84 23 0 260 9 274 357 6e-38 144
c230_g1_i1 gi|261381445|ref|ZP_05986018.1| 57.50 40 17 0 248 129 57 96 2e-09 45.8
c230_g1_i1 gi|261381445|ref|ZP_05986018.1| 50.00 42 19 1 120 1 101 142 2e-09 41.2
c294_g1_i1 gi|298242911|ref|ZP_06966718.1| 37.33 75 46 1 14 238 814 887 3e-07 56.2
c304_g1_i1 gi|296393792|ref|YP_003658676.1| 42.86 56 32 0 56 223 17 72 6e-06 51.2
I want to merge this two files by the second column of allin1_trinity_bacteria_blastx.tsv. And I wish to output a file have same number of lines of the this tsv file since the other file is really big.
This is a easy job in R but since here my annotation file (new_bacteria.txt) is really big. I am thinking about using unix merge. But how can I make the output only contains the columns I want in the tsv file, but not all the liens in the new_bacteria.txt file?
Thank you!
I am thinking about using unix merge. But how can I make the output
only contains the columns I want in the tsv file, but not all the
liens in the new_bacteria.txt file?
There is indeed a program named merge, but despite the name match with the merge() function of R, its purpose (combining separate changes to an original file) is not what you need; you could rather use join. Note that the files must be sorted on the join fields. The example script sorts both files prior to joining; if new_bacteria.txt is already sorted, you can use it instead of sorted.txt; and if you want to run multiple joins on allin1_trinity_bacteria_blastx.tsv, it may be worth it to sort it only once and reuse the sorted.tsv.
sort -k2b allin1_trinity_bacteria_blastx.tsv >sorted.tsv
sort new_bacteria.txt >sorted.txt
join -1 2 sorted.tsv sorted.txt

Resources