I need help extracting blocks of information from a single text file into new files or some form where I can manipulate the data from each block. Example: I need to be able to display and/or manipulate the variables (which I can do if I can isolate the right one). I don’t mind writing each one of these …
Tag: linux
Using a compiled Python shell in Linux
Is it possible to use a “more complex” shell than just a single command shell? We have written a python shell that is a command loop, and it works fine in /etc/passwd like this: Of course the Python file has the shebang line for /usr/bin/python in it. However, we’d like to compile the Python…
Setting up nginx with multiple IPs
I have my nginx configuration file under /etc/nginx/sites-available/ with two upstreams say Sending a curl request to <PrimaryIP>:80 works but I want to use <SecondaryIP1>:80 for test1 and <SecondaryIP2>:80 for test2. Is it possible to define this in nginx? Answer You have to have two server…
phpmyadmin: Can’t login
I have installed phpmyadmin in a Linode Server. I set mysql password but when I’m trying to login via phpmyadmin interface I get the message: I also tried via terminal: mysql -u root -p root And then I got the following message: My config.inc.php file is: Answer Watch out for special characters that may…
JSON list (not object) to Bash array?
I’ve got a JSON list (the value of a key-value pair containing a list of items): [ “john”, “boris”, “joe”, “frank” ] How would I convert this to a bash array, so I can iterate over them? Answer Easy Case: Newline-Free Strings The simple approach is to use …
Path gets copied with the files in the folder to a new destination
I’m using Deploy extension in VS-CODE to deploy a published ASP.NET Core Angular app straight to the production server via SFTP. Everything runs smoothly except for one thing. In my settings.json in VS Code I make the appropriate arrangements as stated by Marcel Kloubert here. So this is the path to the…
ESP8266 Linux: Programming and Flashing
So I’ve recently gotten hold of an ESP8266 chip with a microusb port. I’ve been trying to program it with the arduino IDE but need to flash it. So far I have tried this tutorial here but when I got to the stage of connecting in putty it would not connect giving me an error message, I tried running…
Bash: Want to move certain amount of files, that contains spaces to a different directory
So I’m quite new with bash and Stack Overflow in general, so forgive me if I may be missing something. I’ve been trying to create a script that moves a certain amount of files (ex: 3 files), that may contain spaces (like “hello world.txt”), to another directory. I’ve tried a few …
Combining ionice and nice in Linux, and transitive priorities
I want to load use both ionice (I/O priority) and nice (process priority) to start-up a program. I see variations of this line all over the internet: (or) Everyone lists it without any elaboration. My question is… how does ionice (the first program) setting the priorities of nice (the second program), a…
compare two comma separated strings and list the common values
How many I compare the two comma separated list (master and input) and list the common values among them (result) while preserving the order of elements in master list. For example: case1: case 2: case 3: This is what I tried: Answer Here is one awk-oneliner solution: Test with your 3 cases: Case 1 Case 2 Cas…