Manjaro/Arch: Disabling IRQ #31 (Thinkpad X1 7th) - irq

I've stumbled upon the beforementioned error (disabling IRQ #31) during boot and have tried to resolve it by trying to find out what caused the interrupt.
Running lspci -v | grep 31 gives no result and a cat /proc/interrupts | grep 31 returns:
31: 0 0 0 0 100000 0 0 0 IO-APIC 31-fasteoi tpm0
122: 0 0 0 0 0 0 0 0 PCI-MSI 3162112-edge pciehp
131: 0 0 0 0 0 0 4780 0 PCI-MSI 1572871-edge nvme0q7
136: 0 0 0 0 0 0 377 0 PCI-MSI 520192-edge enp0s31f6
160: 0 0 1 0 0 0 1260 0 PCI-MSI 333831-edge iwlwifi: queue 7
RES: 25967 11451 13108 4439 3441 4165 4926 4203 Rescheduling interrupts
How should I proceed knowing that it maybe has to do something with IO-APIC 31-fasteoi tpm0?
Many thanks.

I ran into a similar problem on my Lenovo L390 (running Fedora 31). In my case the issue reproduced by waking up the laptop when in suspension mode.
For me the issue was resolved (or worked around) by disabling the Trusted Platform Module in the BIOS.

Related

How to capture mysqlsh output in bash script?

I want to capture the output of a mysqlsh script (LOAD DATA):
logs=$(mysqlsh --user=$USER --password=$PASS --socket=/var/run/mysqld/mysqld.sock < /script.js)
echo $logs
script.js:
util.importTable('/my.csv', {schema: 'db', table: 'mytable', dialect: 'csv-unix',
fieldsTerminatedBy: ';', linesTerminatedBy: '\n', replaceDuplicates: true
showProgress: false, bytesPerChunk: '200M', threads: 3, columns: [...]});
On the console I see:
WARNING: Using a password on the command line interface can be insecure.
Importing from file '/my.csv' to table `db`.`mytable` in MySQL Server at /var%2Frun%2Fmysqld%2Fmysqld.sock using 3 threads
[Worker000] db.mytable: Records: 351229 Deleted: 0 Skipped: 0 Warnings: 0
[Worker001] db.mytable: Records: 357374 Deleted: 0 Skipped: 0 Warnings: 0
[Worker002] db.mytable: Records: 352552 Deleted: 0 Skipped: 0 Warnings: 0
...
File '/my.csv' (21.11 GB) was imported in 5 min 22.7004 sec at 65.42 MB/s
Total rows affected in db.mytable: Records: 37129973 Deleted: 0 Skipped: 0 Warnings: 0
BUT: echo $logs shows an empty line.
Why is the mysqlsh output not captured here?
With the help above, indeed a 2>&1 at the end fixes the problem:
.../script.js 2>&1)

YCSB cleanup phase

[CLEANUP], Operations, 1
[CLEANUP], AverageLatency(us), 627.0
[CLEANUP], MinLatency(us), 627
[CLEANUP], MaxLatency(us), 627
[CLEANUP], 95thPercentileLatency(ms), 0
[CLEANUP], 99thPercentileLatency(ms), 0
[CLEANUP], 0, 1
[CLEANUP], 1, 0
[CLEANUP], 2, 0
[CLEANUP], 3, 0
[CLEANUP], 4, 0
Taken from YCSB output, what is a database cleanup operation? I am trying to understand why MySQL takes so much longer during this phase than a MongoDB system.
The cleanup operation is needed to shut down the thread(s) which was providing the workload to the db. So, if you set the parameter -thread n, you will see exactly n cleanup operations at the end of the benchmark!

mapping j function (used defined) over a list

I've written my own version of the exponential (^) function which works fine for simple scalars :
3 : '+/ (y&^%!) i.50'
It doesn't work over a list, so I thought of modifying it with "0
3 : '+/ (y"0&^%!) i.50'
This works over a list but gives the wrong answers.
Two questions arise:
1) Given my usage of "0 doesn't work, is there one that does ?
2) If I don't have access to a functional definition like this, what is the best way to apply it to the individual elements of an array ?
You need to apply the rank conjunction "0 over the function you want to map (y&^%!), instead of its argument y:
3 : '+/(y&^%!)"0 i.50'
However, the precision isn't as good as the native ^:
a =: 3 : '+/(y&^%!)"0 i.50' 4 4 $ 10+i.20
b =: ^ 4 4 $ 10+i.20
a = b
1 1 1 1
0 0 0 0
0 0 0 0
0 0 0 0

Calling .csv file into Octave

I have a code written in C++ that outputs a .csv file with data in three columns (Time, Force, Height). I want to plot the data using Octave, or else use the octave function plot in the C++ file (I'm aware this is possible but I don't necessarily need to do it this way).
Right now I have the simple .m file:
filename = linear_wave_loading.csv;
M = csvread(filename);
Just to practice bringing this file into octave (will try and plot after)
I am getting this error.
error: dlmread: error parsing range
What is the correct method to load .csv files into octave?
Edit: Here is the first few lines of my .csv file
Wavelength= 88.7927 m
Time Height Force(KN/m)
0 -20 70668.2
0 -19 65875
0 -18 61411.9
0 -17 57256.4
Thanks in advance for your help.
Using octave 3.8.2
>> format long g
>> dlmread ('test.csv',' ',2,0)
ans =
0 0 0 -20 70668.2
0 0 0 -19 65875
0 0 0 -18 61411.9
0 0 0 -17 57256.4
General, use dlmread if your value separator is not a comma. Furthermore, you have to skip the two headlines.
Theoretical dlmread works with tab separated values too '\t', but this failes with you given example, because of the discontinuous tab size (maybe it's just a copy paste problem), so taking one space ' ' as separator is a workaround.
you should better save your .csv file comma separated
Wavelength= 88.7927 m
Time Height Force(KN/m)
0, -20, 70668.2
0, -19, 65875
0, -18, 61411.9
0, -17, 57256.4
Then you can easily do dlmread('file.csv',',',2,0).
You can try my csv2cell(not to be confused with csv2cell from io package!) function (never tried it < 3.8.0).
>> str2double(reshape(csv2cell('test.csv', ' +',2),3,4))'
ans =
0 -20 70668.2
0 -19 65875
0 -18 61411.9
0 -17 57256.4
Usually it reshaped successful automatically, but in case of space seperators, it often failed, so you have to reshape it by your self (and convert to double in any case).
And when you need your headline
>> reshape(csv2cell('test.csv', ' +',1),3,5)'
ans =
{
[1,1] = Time
[2,1] = +0
[3,1] = +0
[4,1] = +0
[5,1] = +0
[1,2] = Height
[2,2] = -20
[3,2] = -19
[4,2] = -18
[5,2] = -17
[1,3] = Force(KN/m)
[2,3] = 70668.2
[3,3] = 65875
[4,3] = 61411.9
[5,3] = 57256.4
}
But take care, then everything is a string in your cell.
Your not storing you .csv filename as a string.
Try:
filename = 'linear_wave_loading.csv';

wicked_pdf doesn't work -- Ruby on Rails

I want to generate PDF from a html doc in a rails app. So I decided to use wicked_pdf. But its not working. I tried to integrate it in an app, but it did not work. So I thought of trying to see if it works in the rails console then i will integrate it in the app.
Here's what I came across in the console
wp = WickedPdf.new
=> #<WickedPdf:0x4e7eea0 #exe_path="C:\\wkhtmltopdf\\wkhtmltopdf.exe">
HTML_DOCUMENT = "<html><body>Hello World</body></html>"
=> "<html><body>Hello World</body></html>"
pdf = wp.pdf_from_string HTML_DOCUMENT
"***************C:\\wkhtmltopdf\\wkhtmltopdf.exe - - ***************"
NotImplementedError: fork() function is unimplemented on this machine
from C:/Ruby/lib/ruby/1.8/open3.rb:57:in `fork'
from C:/Ruby/lib/ruby/1.8/open3.rb:57:in `popen3'
from C:/Users/raw/Desktop/html/scheduler/vendor/plugins/wicked_pdf/lib/wicked_pdf.rb:22:in `pdf_from_string'
from (irb):3
UPDATE: I am using Windows7
I am not able to figure out where I am going wrong.
Please help.
Thanks in advance.
Install the gem win32-open3
gem install win32-open3
And now Change line:6 in lib/wicked_pdf.rb
require 'open3'
to
require 'win32/open3'
and line:20 in the same file
command_for_stdin_stdout = "#{#exe_path} #{options} - - -q"
to
command_for_stdin_stdout = "#{#exe_path} #{options} - -"
and now in console I get
wp = WickedPdf.new
=> #<WickedPdf:0x4e65f70 #exe_path="C:\\wkhtmltopdf\\wkhtmltopdf.exe">
?> HTML_DOCUMENT = "<html><body>Hello World</body></html>"
=> "<html><body>Hello World</body></html>"
?> pdf = wp.pdf_from_string HTML_DOCUMENT
"***************C:\\wkhtmltopdf\\wkhtmltopdf.exe - - ***************"
=> "%PDF-1.4\n1 0 obj\n<<\n/Title (\376\377)\n/Producer (wkhtmltopdf)\n/CreationDate (D:20101127124137)\n>>\nendobj\n4 0 obj\n<<\n/Type /ExtGState\n/SA true\n/SM 0.02\n/ca 1.0\n/CA 1.0\n/AIS false\n/SMask /None>>\nendobj\n5 0 obj\n[/Pattern /DeviceRGB]\nendobj\n8 0 obj\n<<\n/Type /Catalog\n/Pages 2 0 R\n>>\nendobj\n6 0 obj\n<<\n/Type /Page\n/Parent 2 0 R\n/Contents 9 0 R\n/Resources 11 0 R\n/Annots 12 0 R\n/MediaBox [0 0 595 842]\n>>\nendobj\n11 0 obj\n<<\n/ColorSpace <<\n/PCSp 5 0 R\n/CSp /DeviceRGB\n/CSpg /DeviceGray\n>>\n/ExtGState <<\n/GSa 4 0 R\n>>\n/Pattern <<\n>>\n/Font <<\n/F7 7 0 R\n>>\n/XObject <<\n>>\n>>\nendobj\n12 0 obj\n[ ]\nendobj\n9 0 obj\n<<\n/Length 10 0 R\n/Filter /FlateDecode\n>>\nstream\nx\234\245\222QKÄ0\f\200ßó+ò,\×6ëÖ‚øàPÁa\254àƒø ;O9\274Ãy\017\376}ÓtÇ�\003\213`ÖåKÒ\264ɪ\273áß\016XuÃ'\216\263îÐJ\273\220\027j\226ÕX\257Èê\264ÐRM+tÜÁ\204\023ôÐó;é Ž\273j\221ø\207*×›\243\022Ý�\017\r)ÞÁ\023\233\037K\223È©`\264v\236\271>7Sð;<^à¾Xêè1\"KÏA\271ÐÖ\244\255\225\2643\223o$\224j$\207_\257\260IçþKÚï\247Édèøë-Þó\263ŧg\206ëâ5\256#T\267-\032\217qÃ÷\220\241d\025\271\205\270\2625Æ5^òPÌÆ-\230䜉\025\022N\200\004P\001Ôç)N#}\002M.ã
9\255\000W(ãÜDil\376qLî¢ùo3Ó ÊØÃ\0177Ч\201endstream\nendobj\n10 0 obj\n271\nendobj\n13 0 obj\n<< /Type /FontDescriptor\n/FontName /QNAAAA+ArialRegular\n/Flags 4 \n/FontBBox [-594.726562 -290.527343 1790.03906 900.390625 ]\n/ItalicAngle 0 \n/Ascent 651.367187 \n/Descent -188.476562 \n/CapHeight 0 \n/StemV 65.4296875 \n/FontFile2 14 0 R\n>> endobj\n14 0 obj\n<<\n/Length1 3840 \n/Length 17 0 R\n/Filter /FlateDecode\n>>\nstream\nx\234\245W]l\024×>wgg×C0ÆkW\204p\rÄ?\024l\263Æ»ÆÄ8ÈD\245\030cc\e\0220\224\214wf\275cvgV\263\263^\257\241\205\2406BQ#\245\205\246\025êC‰\2226I[~ÒÚ”\246\250M\245<\264\225ÒH\225\252\242ÊM\213\232\206(U\037\"\265Ä?=÷ÜYgL(RÕ]Í�ïœ{î9ßùæÞY\030\000\224ÁiP\000ú‡Z¢+\242Gsèù*^O\216\245\213Ék\237Áø
Take a look at this blog post for understanding it.
Thanks.
You can try DocRaptor.com. It's an online app that lets you convert html to pdf. They have free accounts available, plus paid accounts if you need a lot of docs.
Hope that helps!
Julie
create a folder in your public called "pdfs"
Controller:
pdf = render_to_string :pdf => "graphs", :orientation => 'Landscape', :font_size => 11
# then save to a file
save_path = Rails.root.join('pdfs', filename.pdf')
File.open(save_path, 'wb') do |file|
file << pdf
end
graphs.rhtml
View:
add this line of code for styles
<%= wicked_pdf_stylesheet_link_tag "css filename here" %>