I’ve got this simple code that plays with pointers taken from Jon Eriksen’s book that I’m trying to compile but gcc gives me warnings in compilation and segmentation fault (core dumped) when I run it. Output: Answer This program is wrong, and the advice given in the book is obviously wrong, …
Awk in loopwith different file
I have four files and want to run a awk code on each file. But this code is not working. My code: Answer Awk can work with multiple files no need of for syntax will be like this or In your case To correct your existing code change To
extract multiple blocks of text to a new file
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 …
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 …