We want to download the stock price of Tesla every day, using the package “quantmod” in R. We managed to write the function that downloads the last available stock and store it in a database in SQL: indeed, if we run the function manually, we can see the table with the stock price of today. However, if we let it
Tag: linux
How echo grave accent symbol in bash
(_ is input, i think) Answer Escape the grave accent. It’s special to the shell and is one way (the archaic one) to do command substitution. As noted by @dave_thompson_085 an alternative is to use single quotes in lieu of the double quotes you used, or to specify the hexadecimal representation of the grace accent, by doing echo “x60”. You
Bash jq with dynamic name
I’m trying to create a script to read the return code from a json from a curl command. my curl command is: The json output is: How can read the value “http_httpCode#HTTP Code” if 1650468248 is a dynamic value? Answer You could use to_entries so you can use .value to target the ‘unknown’ key: Online demo Another approach by just
why my x64 process base address not start from 0x400000?
I learned from this link Why is address 0x400000 chosen as a start of text segment in x86_64 ABI? that 64-bit Linux process start address by default should be 0x400000, but on my Ubuntu, I only found my bash process starts from a very high base address (0x55971cea6000). Any one knows why? and how does dynamic linker choose the start
using file lock for a single instance program fails if spawn child process
I need to have a single instance program in Linux. That is if someone tries to run the program the new instance should print a message and exit. At the moment I have a lock mechanism like this: The problem is if I do anything that spawns child processes using int system(const char *command); and at some point, someone uses
SQL*Plus how to execute environment set-up and query in one statement
I execute the following query which returns one value and it works fine. The issue is that when the one value returned is too large it gets split in multiple rows thus the ETL tool that I further use gets problems. Therefore I have tried to use the linesize option but I am not able to combine it with the
Install packages from a list through ansible
I have 2 servers named testserver and vsphere server. Ansible is installed on testserver and I have a list of packages stored in a text file packages.txt. How can I install those packages on vsphere server through ansible? This is my packages.txt file. I just have to fetch the package name from the packages.txt And this the yml file inside
How to fail a Linux command if it doesn’t output a certain string within a minute?
I’m using AWS Codebuild to setup a self hosted Github Actions runner. In my main build section, I am just running the command ./run.sh and this starts the self hosted runner, listens for a job, and then picks up the particular job. In some cases, these don’t actually end up picking up a job and just sit out there listening
grep all .js urls from text file
There is a File a.txt I want to grep all .js extension URLs so I tried this but it not showing https://site.tld/b.js?query=1 And when I tried this, It also select js name from anywhere Thanks in advance Answer Just escape the . with a
Why does storing 7 floating-point numbers need 34 bytes?
I have a file that stores 7 numbers in double. See below. But its size is only 34 bytes. Shouldn’t it be 7*8 = 56 bytes instead? Answer The file contains text representations of the numbers (e.g. written out as digits with a decimal point and a newline separator) rather than as IEEE-754 floating point numbers. The byte count you’re