Skip to content
Advertisement

Stringizing / stringify name mangling

I load a path name with cmake and want to use as a string in my C++ program to load some data. For this the stringification operator # is really handy – I use the macro provided in this answer which is the same as here. Now when I have “linux” or “unix” in my path, this goes horribly wrong

Run a command on a list of files

The command shred in ubuntu does not shreds files recursively. Hence, I wanted to list all the files in a directory by doing find -L and then shred these files using shred. However, find -L | shred does not works. Can someone please help me do so? Thanks in advance. Answer find | shred works as if you ran just

Can’t connect to a MongoDB server

I’m trying to deploy this Fullstack app to a DigitalOcean droplet: https://github.com/maismin/stock-portfolio-app-demo I installed MongoDB like how to documentation said and then I started it and didn’t do anything else (I don’t know if I need to actually make a database or not this is the first time I’m using MongoDB). Then I cloned the repo, then I installed NPM

Excessive disk writes when using numpy.memmap

I have implemented a file-backed HashTable using numpy.memmap. It appears to be functioning correctly, however, I notice that on Linux both KSysGuard and SMART are reporting ridiculous IO Write amounts. About 50x the amount of data that should be written. I have not tested this on other operating systems. This is the code that creates the internal memory map And

Trying to use awk to parse lscpu output but can’t get it right

Essentially what I want is to extract the byte size of the L3 cache from lscpu. The tricky part is that the units lscpu uses is not consistent across versions and what I need has to work with all versions (including the versions before the –bytes option was available). lscpu from what I can see will either use K, KiB,

OpenMP Matrix Multiplication Issues

I am trying to multiple the values of a matrix. I have both a parallel and sync version. But the parallel version is longer than the sync version. Current the sync takes around 90 seconds and the parallel over 100. Which makes no sense to me. My logic was to split the matrix into 4 parts from the first 4

How to zip multiple folders separately in linux

Below mentioned folders contain some data. I need to zip all the folders separately. With this Command, I can zip only one folder How can I zip all the folders separately at once? Answer First, make sure that you are in the directory where the above mentioned folders are. Then run: find . -type d -maxdepth 1 -execdir zip ‘{}.zip’

rec FAIL sox: `default’ Device or resource busy: Operation not permitted

System Environment: root@orangepizero:~# rec test.mp3 Input File : ‘default’ (alsa) Channels : 2 Sample Rate : 48000 Precision : 16-bit Sample Encoding: 16-bit Signed Integer PCM In:0.00% 00:00:00.00 [00:00:00.00] Out:0 [ | ] Clip:0 rec WARN alsa: Input/output error rec FAIL sox: `default’ Device or resource busy: Operation not permitted In:0.00% 00:00:00.00 [00:00:00.00] Out:0 [ | ] Clip:0 Done. Answer

copy all copyQ tab names to a tab name tabs

i want to copy all existing tab names inside copyQ as items in a tab named tabs. my prototype producing duplicates: ./tabs.sh ; copyq tab > tabs.sh ; sed -i ‘s/.*/copyq tab tabs add “&”/’ tabs.sh ; ./tabs.sh i read: https://copyq.readthedocs.io/en/latest/scripting.html#working-with-tabs Answer the copyq removetab tabName removes the tab ( means also all items of the tab). If the tab

Advertisement