Questions tagged [algorithms]
The algorithms tag has no usage guidance.
21
questions
0
votes
0
answers
54
views
AWK command for summary statistics of array with several columns and a grouping variable [closed]
I got a data file with time-series data.
Each line of the 5+ GB csv file freqs.csv has the appearance:
start_freq stop_freq measurement1 measurement2 ... measurementk
Frequencies are represented on ...
0
votes
0
answers
43
views
How to measure CPU, MEM usage and more for a short lived process
I've got a program with some compiled sorting algorithms, and I'm trying to use top to monitor its cpu and ram usage.
Normally this would be fine, given that the process runs for a few minutes, ...
1
vote
1
answer
508
views
How to reposition the elements of a json array conditionally using jq?
I want to re-position elements of an array (change index of array elements) based on a condition. I don't know how to translate this to jq which is more of a functional language.
Basically I want to ...
0
votes
0
answers
44
views
What kind of Hashing algorithm is my Linux using? [duplicate]
In Kali Linux, I found an unknown hash algorithm used to encrypt the Kali Linux password.
root:$y$j9T$J3nInhusIQkrmvCnX8tlo.$KduXmrDY7wv3o2P/k9t35adUH5XWUBYngo1Wxypy2X.:18749:0:99999:7:::
My ...
3
votes
0
answers
621
views
GRUB alternative for LUKS2 with Argon2ID support
It seems that the even the most recent version of GRUB2 doesn't support LUKS2 with the PBKDF Argon2ID (source).
The Raspberry Pi bootloader for instance fully supports this new hashing function.
Is ...
1
vote
1
answer
73
views
Where can i learn algorithms from zero? [closed]
I've been studying programming for like 3 years or so but my teachers never taught me algorithms.
Are there any online courses for beginners? with tasks.
-2
votes
1
answer
400
views
Why is it not possible to use SJF (Shortest Job first) in Linux? [closed]
why it is not possible to use SJF as the scheduling algorithm for Linux?
1
vote
1
answer
599
views
What data structure is the stack using in Linux?
I have looked in several places such as here but none explain in detail the structs used for implementing the stack itself (the place where "tasks" (processes/threads) store their nested call ...
0
votes
1
answer
351
views
Restrict Access to SSH server based on incoming key type
I am running ubuntu 18.04.3 server HWE edition in my local lab and while reading the manuals I came across the issue that I am unable to determine how to exclude users from connecting to my server via ...
0
votes
1
answer
98
views
Arguments for, and the applicability of, using multiple forms of compression on one or more files?
I was wondering whether there are any scenarios which require file(s) to be compressed multiple times with the same or a different algorithm. As far as i can tell the file size can be reduced further ...
1
vote
2
answers
652
views
Transforming if statement in case
I'm currently testing changes in my scripts for performance purposes. Specifically, I want to change if to case statements.
However, being new to shell programming I'm getting stuck on this type of ...
-1
votes
2
answers
184
views
Trying to complete Project Euler #5, passes all syntax checks but doesn't work
trying to complete Project Euler #5. The code I have should logically work, and it passes ShellCheck, but gives no output for some reason. The code is below. Thanks and sorry if this should be in a ...
2
votes
1
answer
2k
views
OpenSSH accesslog : Logging ciphers, MAC and user agent
How to log the Protocol, KexAlgorithm, Cipher and MAC algorithm negociated by the client and the client's user agent string?
What I'm looking for is the OpenSSH equivalent to Apache HTTPD's CustomLog+...
0
votes
3
answers
1k
views
Can I obtain microsecond granularity when I calculate the number of nanoseconds from Windows Epoch to today?
Using Ubuntu Linux 16.04 and g++, I was wondering if could obtain microsecond or millisecond granularity when I calculate the number of nanoseconds between Unix Epoch or Windows Epoch and an arbitrary ...
3
votes
2
answers
145
views
How can I partition a set of words given pairs that must end up together?
I have a space or comma separated table with two columns, each row representing equivalence of the two words.
A B
B C
B D
C E
F G
What I want is a table with each row listing all mutually ...
6
votes
4
answers
1k
views
Can I use scrypt to hash for LUKS?
Can scrypt be used as the hashing algorithm for LUKS? Can I tune its parameters? How can I do this?
19
votes
7
answers
12k
views
Is there an algorithm to decide if a symlink loops?
Unix systems usually just error out if they are confronted with a path that contains a symlink loop or just too many symlinks, because they have a limit to the number of symlinks they will traverse in ...
5
votes
2
answers
11k
views
What does net.ipv4.tcp_app_win do?
I can't figure out why the tcp_adv_win_scale
and tcp_app_win variables coexist in Linux.
The information from tcp(7) says:
For tcp_adv_win_scale:
tcp_adv_win_scale (integer; default: 2; since Linux ...
5
votes
4
answers
14k
views
Grepping over a huge file performance
I have FILE_A which has over 300K lines and FILE_B which has over 30M lines.
I created a bash script that greps each line in FILE_A over in FILE_B and writes the result of the grep to a new file.
...
29
votes
1
answer
4k
views
Why isn't a straightforward 1/5/15 minute moving average used in Linux load calculation?
Until recently I thought the load average (as shown for example in top) was a moving average on the n last values of the number of process in state "runnable" or "running". And n would have been ...
9
votes
3
answers
1k
views
Why does it makes sense to cache swap?
It sounds quite counter-productive to me to cache pages that are swapped out. If you swap pages in, what is the advantage to first cache them in memory, only to have to than move them to the right ...