I have file as: Here the 1st column represents dates as YYYYMMDDHH I would like to write the dates as YYMMDDHH. So the desire output is: My script: It is printing Any help please. Thank you. Answer Please don’t kill me for this simple answer, but what about this: You simply cut the first two digits by showing character 3
Getting curl: (3) URL using bad/illegal format
My bash code is simply this. I am trying to learn docker but also a newbie with bash scripting. I type in something simple like google.com for the read command but it gives me curl: (3) URL using bad/illegal format or missing URL. Anyone know what I am doing wrong? docker exec -it missingDependencies sh -c “echo ‘Input Website:’; read
Drone sometimes fail with error related to “No space left on device”
Sometimes we experience a drone pipeline failing due to a lack of disk space, but there is a lot of space. We use docker images for running drone infostracture. The console command: My assumption may be due to the docker container’s limitations, and we need to configure it somehow manually. Any suggestion on how to fix it? Answer We have
A solution to rEFInd unable to load using shim when Secure Boot is enabled
Background Ubuntu 21.10 can load on my computer through secure boot, and the shim version is 15.4. Then refer to the official tutorial, I installed rEFInd v0.13.2 (the latest version when I posted this blog) via PPA in Ubuntu 21.10. However, when I restart the system and load rEFInd, it always fails with the message Verification failed:(0x1A)Security Violation. I’m sure
Simple sorting in linux
I’m quite new to linux, and I can’t quite get to understand sorting. I need to sort a long file by column 4 and then column 5, ignoring the first line. The catch is, there are two separators – ‘.’ and ‘,’ – I don’t know how to make sort command to include both of them. I guess it has
How to adapt to Linux terminal back color in .NET 5/6?
We have a .NET 5 console application that runs on Windows/Linux/Mac. Our console application relies on the classic fore color scheme to highlight info/warning/error in console with fore colors gray/yellow/red. However we cannot gather the terminal back color as explained in Console.BackgroundColor documentation: Unix systems don’t provide any general mechanism to fetch the current console colors. Because of that, BackgroundColor
‘DT_REG Undeclared’ even when using header file in function
I’m using the <dirent.h> header file in the function I’m referencing DT_REG, however, I’m getting error an saying ” ‘DT_REG’ undeclared (first use in this function) ” The snippet of the code is: In my makefile I’m using “cc -std=c11 -Wall -Werror -pedantic”. Any ideas for the reason? Answer DT_REG is not part of ISO C11 extensions. Setting -std=c11 strictly
Ping program implementation in C about recvfrom() doubts
I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this. I have finished writing the program, and today when I tested the ping loopback address, after sending the packet, the function recvfrom() received the “first” packet (type 8), and the second recvfrom() received the response packet
How to automatically start 2 Java jars on AWS EC2?
I’m learning to deploy Spring Boot apps on AWS EC2. And I know how to automate app launch, when I start the EC2 instance, I don’t need to manually use the command java -jar java-service.jar, I just add this command in the /etc/rc.local file and that is all. But I have 2 microservice, and I want to start both of
How to set environment variable for non-interactive shell in docker container?
I’m using command docker run -e GRB_WLSACCESSID=xxxxxxx to set environment variables for Gurobi authorization. The OS of container is Ubuntu 16.04. This is OK if I login the container via SSH interactively and read the environment variables by python code os.getenv(). But, when I add this container as remote SSH interpreter in Pycharm and execute the python code along Pycharm,