I want to verify that if the seed is same, the resulting pseudo random number is same. Using rand() is the simplest but I’m looking for safer way. I found that using device entropy with /dev/random of linux is very reliable but cannot find how to set exact same seed. I also tried cryptgenrandom of windo…
Tag: linux
Setting up minecraft server service on usb hard drive problem
I’m trying to set up a minecraft server to play with my friends. It’s my first time doing this on linux, so I have a (I believe) small problem. I can’t figure out how to set up it on my usb hard drive. Here’s my minecraft.service small edit – I removed -%i, because it’s to …
Alternative to cron that retains environment variables
I have been trying to set up a cron job to run a bash script every 30 minutes on a Linux-based compute cluster. The problem is that some functions normally available in my shell are not available to the cron job, causing it to crash. I import all my environment variables (including the ~/.bashrc) but no luck,…
Where can I download the Northwind sample database for SQLite?
After looking at: Where can I download Northwind database for Postgresql? it looks like the best place for Northwind data, outside of the Microsoft itself, is: https://code.google.com/archive/p/northwindextended/downloads to what extent does this raw data match the Microsoft data? Is there any advantage in do…
Compiling my C++ exe for Linux with VS2019
I have created a C++ standalone exe with VS2019. This exe uses 1 external ressource file. This exe creates WAV files. It does not use any special libraries. I have been asked if this application runs under Linux, too. What would I have to do / check to see if / how I can compile my application for Linux, and
How to iterate over two arguments in the sh linux shell
I have two sets of arguments: a = “5 7 1” and b = “dogs cats horse” They should come in pairs: 5 matches dogs, 7 matches cats and 1 matches horse They also should do this in one line: The problem is that the $a and $b can have hundreds of arguments, so writing many lines like the above
need perl to die when implicit open fails
I’m trying to migrate a sed script to a perl one-liner, because perl supports non-greedy regexp. I’ve taken advices from Non greedy (reluctant) regex matching in sed? and Why is my Perl in-place script exiting with a zero exit code even though it’s failing? I need my oneliner to exit with no…
Remove part of file name in multiple sub directories
The main folder “Main” contains multiple subfolders (6900,159, 9997, …) and each subfolder contains 8 items (4 files (6900Log.final.out, 6900Log.out, 6900Log.progress.out, 6900SJ.out.tab), 3 folders (6900_STARgenome, 6900_STARpass1, 6900_STARtmp), and one compressed file (6900Aligned.sortedB…
Generate combined virtual key presses to get chars like â, ó, ć, and more complex
I’m implementing a virtual keyboard using QML. So far I literally map the char to print for the different key maps (w/o shift, with shift, with Alt Gr, etc.). So I have to write down all the chars for different layouts somewhere in the code. Especially for layouts and languages where two or more key pre…
Renaming JSON files based on their contents
I have loads of geographical json files with date_geohash.json name format and I have to convert them to date_latitude-longotude.json format. For example I need to convert 2017-03-28_u13hhyn.json to 2017-03-28_N52.76-E1.62.json. I’m trying to write a bash script to rename these json files using ‘…