Troubleshoot failed cron not sending emails - cron

Here is the server info from lsb_release -a
In our crontab, below the comments and above the cron commands we have MAILTO=myemail#gmail.com, however no emails are being sent to myemail#gmail.com. I'm not sure if the server has sendgrid or any other emailing tools installed, or if they are needed. Our cron logs all currently get sent to a file at /var/mail/myusername, and I can hop in and see them with vim /var/mail/myusername. How can I troubleshoot this further?

Type mailx or install the package. If you need them to go to Google, then you need to install and configure a mta package such as postfix or exim. You also have a high enough rating to know that you do not post images where plain text will do.

Related

How do I change the interface snort monitors by default?

To start, I am entirely new to Linux and am doing this as part of my final year project at university, I have never used linux before a few weeks ago and I have been hitting roadblock after roadblock trying to get snort installed and working for 6-7 weeks now (1-4 hours a week) among my other modules.
I have a virtual machine running Ubuntu latest release. the VM has 2 network interfaces, one is for access to the internet and the other going to be used to feed pcap files into with tcpreplay, this is named intnet in VM settings, and enp0s8 in Linux. I used the command lines sudo apt install -y snort and snort -v -c /etc/snort/snort.conf which I found Here and Here respectively. I used the first link after resetting my VM for the 3rd time and could not get snort to find LUAJit. after this I ran wget https://www.snort.org/downloads/community/community-rules.tar.gz -O community-rules.tar.gz and finally tar -xvzf community.tar.gz -C /etc/snort/rules from the snort website, found Here under Step 3. note I had to change the last command to tar -xvzf community-rules.tar.gz -C /etc/snort/rules to get it to work, not sure if this is a mistake on the website or on my end.
When i run snort using snort -v , to run in verbose mode, there are no errors or warnings, but when I use snort -i enp0s8 for the specific network I want to use I get a warning that is something about no pre-processors for policy 0. This is an error I had a lot while trying to install snort at all let alone work with it. I have also noticed that there is a test using snort -t (possibly uppercase T, can't remember), I get an error regarding not using a rules file, but then when I use the snort -c to specify community-rules I can't seem to get it to accept the rules file although this is just because I'm assuming test is a general test of the program, might be wrong about that.
This is beginning to really stress me out, to the point of making this account just to see if anyone can help.
any help is much appreciated, it is almost midnight I will be back on tomorrow morning so sorry if I don't reply for a while
tl;dr snort monitoring wrong interface,, using -i gives pre-processor warning, -t says no rules file and -c will not recognise rules file

Squarespace local development server install gets hung up in middle of installation

I have spent hours trying to fix this problem on my own but am getting nowhere and can't seem to see any other questions/solutions regarding my specific problem.
I successfully installed nodist via chocalatey via Powershell admin.
I used the following script in attempting to install the Squarespace development server per Squarespace documentation:
npm install -g #squarespace/server -y
Please noted I added the -y parameter to for yes to accept license agreement but previously didn't add this parameter but still received same result.
When trying to install the local Squarespace development server via Powershell admin, the script keeps getting hung up at the following:
Using this software requires accepting the Squarespace Developer Terms
of Use and Oracle Binary Code License Agreement . See LICENSE.txt.
The following is a screenshot of all the scripts that ran beginning from my install script:
I have done everything from reinstalling nodist several times to rebooting machine and everything else to troubleshoot.
Please note that I have also waited for more than an hour to see if the script fully executes but remains hung at the above noted line.
Why is this happening and how can I fix this?
Regards.

Gcloud - How to automate installation of gcloud on a server?

I want to write a shell script which basically goes through all the installation steps for gcloud, as outlined at: https://cloud.google.com/sdk/?hl=en
However, when you are run install.sh, you will be asked to enter an authorization code, your project-id, whether you want to help improve Google Cloud or not and so on. Basically user-inputs are required.
But if I want to automate the installation process on a machine where there will not be any user, how can I do this?
There are two separate problems here.
First, how do you install without prompts:
Download the google cloud sdk tar file. This can be found right under the curl command on https://cloud.google.com/sdk/
Untar and cd into the newly created directory.
run CLOUDSDK_CORE_DISABLE_PROMPTS=1 ./install.sh (or install.bat)
This disables all prompts. If you don't like the way it answers the prompts, you can pre-answer them with flags. If you preanswer all the questions, you don't need the CLOUDSDK_CORE_DISABLE_PROMPTS environment variable set. Run ./install.sh --help for a list of flags.
Now that you have it installed, how do you auth it?
If you are on GCE, you can use the credentials on the machine itself automatically. If not, some setup is required.
Since these are automated installs, you want to give them a server key. If there was a human involved, he can just proceed through the normal flow.
Keys can be downloaded from the developer console under "APIs & auth -> Credentials". Click "New credentials -> Service account key". Google recommends you use a JSON key.
When you have that key, you need to move it to the new server and run:
gcloud auth activate-service-account --key-file servicekey.json
gcloud config set project MYPROJECT
There seems to be a better / more elegant way to do this as per the docs:
curl https://sdk.cloud.google.com > install.sh
bash install.sh --disable-prompts
This sequence of commands should help:
file="google-cloud-sdk-101.0.0-linux-x86_64.tar.gz"
link="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/"
curl -L "$link""$file" | tar xz
CLOUDSDK_CORE_DISABLE_PROMPTS=1 ./google-cloud-sdk/install.sh

Adding Support for SCP and SFTP for Curl on Linux

I've been been desperately trying to add SFTP and SCP support for Curl on my CentOS box. I found something resembling a solution here:
http://andrewberls.com/blog/post/adding-sftp-support-to-curl
I followed these steps but found that when attempting to get a file via both SCP and SFTP, the connection hangs once the file has been found. I cannot fix this and cannot find an alternative solution.
I have to use Curl for a job at work and therefore cannot use another lib. Has anyone managed to successfully add support for SCP and SFTP on Curl? I have a test server setup and other protocols such as FTP work as expected.
Any help would be greatly appreciated!
Thanks in advance,
Peter
Although Curl does support SFTP, support isn't automatically included in the default package.
This website: http://andrewberls.com/blog/post/adding-sftp-support-to-curl provided the details which helped me add the required support for SFTP. As the site didn't work 100% for me, I've outlined the different steps taken below.
Manually downloading libssh2 didn't work for me so I used yum to install the two packages:
yum install libssh2 libssh2-devel
and then followed step two configuring Curl to install using the above libraries
The final step was to restart sshd:
service sshd restart
There you have it. Double check that SFTP is on the list of support protocols by running
curl -V
When I initially tested, Curl complained about key authentication issues, but you can force Curl to use any authentication to connect:
curl --anyauth sftp://user:passwd#127.0.0.1/directory -o Test.txt
This will round robin the different supported authentication methods and let you use you login credentials instead.
I hope this helps alleviate any other headaches for people trying to achieve the same.

Can Linux Bash scripts respond to install options

I need to script the installation of a number of products on Redhat Linux
I am installing from previously downloaded tar files that each contain their own specific install.sh.
My problem is that by executing the install.sh scripts a number of questions are asked such as ...
a). Accept license
b). set default path(s)
c). do i wish to start service
etc...
Can Bash detect these questions and respond correctly? or do i require another linux based product/function?
For windows based installs i have used AutoItScript.
What are my options on Linux Redhat?
To establish whether the scripts support any command line options, you can:
Read the readme file of the software, if there is one. This should explain any options.
Read the top of the install.sh script. Usually options are at least listed there.
Read the code itself, which might be a lot of work.
Once you have established that the scripts do not support options, the standard way of automating this would be with an expect script. See for example automating install.sh script using an expect script.
Depending on how the install script works, you may be able to send it commands on standard input. For example, if you press Tab once, then Enter, then y and lastly Enter again, you can try the following:
printf %s $'\t\ny\n' | ./install.sh

Resources