Linux

66K

Solutions

33K

Contributors

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

Share tech news, updates, or what's on your mind.

Sign up to Post

This is using the bash shell script in our SuSE Linux Server 12. This is a "per-user" script, in which an SMS notification will be trigger for that user alone. We are using our internal SMS Gateway, and the handphone number has to be put into the subject. Please see the script contents below,

#! /bin/bash

HOSTSUBJECT="$NOTIFY_NOTIFICATIONTYPE $NOTIFY_HOSTNAME"
SERVICESUBJECT="$NOTIFY_NOTIFICATIONTYPE $NOTIFY_HOSTNAME $NOTIFY_SERVICEDESC"

# For Service notification
if [ "$NOTIFY_WHAT" = "SERVICE" ]; then
        if [[ -z $NOTIFY_NOTIFICATIONCOMMENT ]]
        then
                echo "$SERVICESUBJECT $NOTIFY_SERVICEOUTPUT $NOTIFY_HOSTALIAS" |   /usr/bin/mailx -s "95521688" sms@sms01.asia.abc.corp
        else
                echo " $SERVICESUBJECT  <$NOTIFY_NOTIFICATIONCOMMENT> (by $NOTIFY_NOTIFICATIONAUTHORNAME) $NOTIFY_SERVICEOUTPUT $NOTIFY_HOSTALIAS" |   /usr/bin/mailx -s "95521688" sms@sms01.asia.abc.corp
        fi

# For Host notification
else
        if [[ -z $NOTIFY_NOTIFICATIONCOMMENT ]]
        then
                echo "$HOSTSUBJECT $NOTIFY_HOSTOUTPUT $NOTIFY_HOSTALIAS" |   /usr/bin/mailx -s "95521688" sms@sms01.asia.abc.corp
        else
                echo " $HOSTSUBJECT <$NOTIFY_NOTIFICATIONCOMMENT> (by $NOTIFY_NOTIFICATIONAUTHORNAME) $NOTIFY_HOSTOUTPUT $NOTIFY_HOSTALIAS" |   /usr/bin/mailx -s "95521688" sms@sms01.asia.abc.corp
        fi
fi

We have about 50+ personnel need to get the handphone alert with the same SMS …
0
Rowby Goren Makes an Impact on Screen and Online
LVL 12
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Hi guys

We have an Linux instance in the cloud with Nginx installed on it. However, whenever the server restarts, the Nginx services don't. I'm not overly familiar with Linux commands. Can anyone help me how we can automate the Nginx services to start on restarts automatically?

Thanks for helping
Yash
0
So, I have been reading about this for a long time and there's never a conclusive answer to be found anywhere.

I have a Centos 6 LAMP web server which mostly hosts websites created by yours truly and the occasional website created by someone else.

Which is the most secure way to configure Wordpress folders ownership AND keep all the automatic features (updating, uploading and so on) without the need to insert ftp or sftp credentials each time?

Aside from permissions (which I always set to 755 for folder, 644 for files and 600 for special files, as suggested everywhere), there's a lot of different ideas about ownership.

Somebody says apache should be the owner of the whole folder. Somebody says that the owner should be your server user (root for instance, or a dedicated user) and never apache.

But if the owner is not apache, you have to use your ftp credentials to upload, update and so on.

So is there a way to actually have it all? What's the safest and smartest way to configure ownership for Wordpress?

Thanks guys.
1
I am trying to install VMWARE from the linux bundle on my Manjaro Linux system.  I got close with the Manjaro Forum (and it is still out there).  I need to find the kernel headers my kernel is using.  My kernel is up to date but I can not find the header files for it so I can tell VMWARE.  The message I get is below.Output of VMWARE install bundle
0
We have a kiosk running Android with a keyboard and mouse. Trying to reinstall the OS but there is no SDcard slot just USB but it wont boot off any usb drives (tried linux and android installers). Don't know they shortcut key to get it to boot off usb. Its not a phone so there is no 'power and volume down' combos. (See pics).
 It boots and displays the kitkat 4.4.2 logo and version then goes black...then screen freezes on black. There are no model numbers listed anywhere on the board.
pic150086365_10161408718690584_671152583.jpg
0
I'm trying to run a very simple Hello World program on a Linux workstation.  The code compiles, but when I double-click on the .exe file to run it, a window pops up with the message "An Error Occurred While Loading the Archive".  

I've attached the code and Makefile below.

What am I doing wrong?

Thanks!

#include <iostream>
using namespace std;
//hello.cpp

int main()
{
  cout << 'Hello world!\n';
  return 0;
}

Open in new window



TARGET	= hello.exe
OBJECT_01	= hello.o
SOURCE_01	= hello.cpp

$(TARGET): $(OBJECT_01)
	gcc -o $(TARGET) $(OBJECT_01) -lstdc++

$(OBJECT_01): $(SOURCE_01)
	gcc -c $(SOURCE_01) -o $(OBJECT_01)

all: $(TARGET)

clean:
	-rm -f $(TARGET) 
	-rm -f $(OBJECT_01)

Open in new window

0
Ubuntu freezes and shuts down laptop when writing to c drive.

this same command runs fine on one laptop but crashes on another....

user@DESKTOP-NNT86U6:/mnt/c/unix$ sed 's/[^,]*/"&"/g' test2.csv > testx.csv
0
grep "testing" 789.log

zgrep "testing"  123.gz

i like to redirect above production server output to
abc/def/test.txt file which is on some other system test server where i have access

how to do it
grep "testing" 789.log >> abc/def/test.txt
above gives error no such directory as that directory is not there in production server

grep "testing" 789.log
how above different from
grep -C2 "testing" 789.log

i see below time stamp lines came 3 of them when i use -C2
2019-Jan-17 04:50:51.198 EST

i see below time stamp lines came 3 of them when i did not use -C2
2019-Jan-17 04:50:51.198 EST

please advise
WithC2.png
WithoutC2.png
0
when i do ls -ltr i see bunch of .gz files says 123.gz and 456.gz
and bunch of no gz files say 789.log etc

how to grep on say "testing" on both zip gz files and non zip files

grep "testing" 789.log

zgrep "testing"  123.gz

not sure how to combine above two together

also how search today log between 10 am to 11 am for that "testing" word in log?
please advise
0
I have a java backend application which is containerised using docker. The front end for this application is developed using npm and these static files are deployed in nginx. And it works perfectly. The api calls to the backed is proxy passed to the docker host using nginx reverse proxy.




Now i need to setup docker swarm for this backend application using manager and worker nodes.


So these are the questions which I need to ask you experts,

To which host should I need to configure proxy pass in nginx while using docker swarm?


Thanks in advance :)
0
Determine the Perfect Price for Your IT Services
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

mongodb SSL encryption with application makes slow.
Can somebody help on this
0
Need to understand Error and solution  if this is issue with Nagios app running on Linux server or if all resulted due to Network Glitch

Error in Alert is
"HOST CHECK_VMWARE_API.PL CRITICAL - Server version unavailable at 'https://192.168.1.17:443/sdk/vimService.wsdl' at /usr/share/perl/5.10/VMware/VICommon.pm line 734"

What all are precautionary actions required to avoid such error alerts ?
Is there nay recommendation before we configure Nagios for N number of alerts /Devices /VMware /vCentere  
How actually load is decided before we configure nagios for monitoring
0
Can you please help me write a shell script to replace three lines in the .profile file on Linux server? I have attached a sample .profile file
I need to Change the following line to:

export ORACLE_HOME=/odb/oem01/orabin/product/core/12.1.0.4.0
TO
export ORACLE_HOME=/odb/oem01/orabin/product/agent_13.2.0.0.0

export ORACLE_SID=agent12c
TO
export ORACLE_SID=agent13c

export ORACLE_RAC_SID=agent12c
TO
export ORACLE_RAC_SID=agent13c

Also add this to the pat:
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH

I need a script that I can run from OEM as an OS command on all 3000+ servers..
List.txt
0
Hi there, I need some help with creating a folder structure in Artifactory which is installed on an ECS cluster within an redhat server ec2 instance.this is my first time doing this and I have been a bash script file which creates the necessary folders...my question is,how do I make sure I run this bash script file correctly and how do I check afterwards that it has been successful created using the web UI or command line... thanks in advance for your help.
0
Hi ...
On Slitaz distro, I disabled the X-Window. Does anyone know how I can enable auto login on the console.

Thank You For YOUR Quick Prompts.
0
While setting up a PXE boot server on a CentOS 7 machine, I encountered a strange problem with TFTP. I cannot retrieve any files from the TFTP server without encountering a timeout problem. The boot process comes so far that I correctly get an IP address and a file name from the DHCP server. However, when the boot files are to be retrieved from the TFTP server, a "TFTP open timeout" message comes. If I manually make a TFTP connection to the PXE server from a local computer, I immediately get access to the server. But if I try with a "get pxelinux.0" command, I get another timeout message.
My firewall is set up correctly and it also makes no difference if I completely turn off the firewall. SeLinux is also disabled.
If I make a tcpdump on port 69 I get the following message:
12:34:33.477401 IP 172.16.1.202.ah-esp-encap > tools.dmz.tuxme.dk.tftp:  27 RRQ "pxelinux.0" octet tsize 0
12:34:35.481131 IP 172.16.1.202.acp-port > tools.dmz.tuxme.dk.tftp:  27 RRQ "pxelinux.0" octet tsize 0
12:34:39.490793 IP 172.16.1.202.msync > tools.dmz.tuxme.dk.tftp:  27 RRQ "pxelinux.0" octet tsize 0
12:34:45.477712 IP 172.16.1.202.gxs-data-port > tools.dmz.tuxme.dk.tftp:  27 RRQ "pxelinux.0" octet tsize 0
12:34:53.441801 IP 172.16.1.202.vrtl-vmf-sa > tools.dmz.tuxme.dk.tftp:  27 RRQ "pxelinux.0" octet tsize 0
12:35:03.384065 IP 172.16.1.202.newlixengine > tools.dmz.tuxme.dk.tftp:  32 RRQ "pxelinux.0" octet blksize 1456
12:35:39.414843 IP 172.16.1.202.newlixconfig > 

Open in new window

0
In a nutshell:
I use an apache2 as webdav server and have a nginx reverse proxy in front of it.
The download of larger files (~ 6 GB) works without problems only the upload of larger files (already from 450 MB) aborts exactly at the EOF with the error message "65 client intended to send too large body " (on nginx).

I tested all possible settings like client_max_body_size, proxy_buffering off; unfortunately without success. If I run apache2 without nginx reverse proxy everything works as expected.

Thanks for your help

reredok
0
I have a C# program that runs perfectly under Windows 10.  It uses Connected Services so that I can add in additional Class and Method functions to connect to Ultimate Software's HR system and pull our employee information from.  What I would like to do is run this application under Linux CentOS.  I installed Mono for Linux on both CentOS 6 and CentOS 7; and verified 100% that it can and does run compiled Visual Studio C# programs under Linux.  No problem.

However, when I run the EXE program under Linux Mono, it does not connect to the external website defined in Connected Services.

Here is the line it is failing on.

loginClient = new LoginServiceClient("WSHttpBinding_ILoginService");

Open in new window


And the error I get back, is (of course), a NullReferenceException as the defined object of 'loginClient' never gets instantiated.

System.NullReferenceException: Object reference not set to an instance of an object.

Open in new window


Has anyone ever successfully taken an EXE file for Windows using Connected Services and run it under Linux Mono?

Thank you,
Jeff
0
I am having trouble trying to delete a file in linux
I have a file that I can see using ls -lrt called events.csv
but when I try to delete I get an error

ls -lrt
total 0
-rwxrwxrwx 0 root root 1048576 Jan 11 14:43 events.csv

sudo rm -rf  events.csv
<< does nothing >> i check back and the file is still there

sudo rm -rv events.csv
<< get error>
rm: cannot remove 'customer-events.csv': No such file or directory
0
Exploring SharePoint 2016
LVL 12
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

I  am unable to P2V  Linux Machine, details given below:

VCENTER : 6.5
Source Machine: SUSE Linux Enterprise Server 11 SP2
Destination: ESXi 6.5
Convertor: 6.2.0 (correct build)

I am getting various issues and when I resolve one issue, it generates another issue.  

Issue1: FAILED: A general system error occurred:
Network error. Host x.x.x.x key can't be retrieved. (return code 2)

Issue2: FAILED: Unable to obtain the IP address of the helper virtual machine.

Issue3: At Times it is stuck at 1% for a long time.


I did a Google Search and when I resolve one issue, it generates another issue.

I seek guidance from Experts.  VMware has refused to support saying that  the Converter is working fine and something at the OS end.
This is a production server and I really need to do a P2V.
0
Hi all,

 How to compare string within an array? That string contains backslashes, colon and paranthesis.

sample program:

use strict;
use warnings;

sub perl_func {
    my ($z, $x) = @_;

    print "\n";
    print "z: $z\n\n";
   
    my @lx=@$x;
    foreach my $tx (@lx)
    {
       
        if ($z !~ m|$tx|)
        {
            print "$z !~ $tx\n";
        }
        else
        {
            print "$z == $tx\n";
            return 1;
        }
    }
   
    print "\n";
    return 0;
   

}

#my @x = ("One", "Two", "Three", "Four", "Five");
#my $z = "Four";
#works fine for above x & z

my @x = ("One\\OnesPosition:Num (NumPerl)", "Two\\TensPosition:Num (NumPerl)", "Three\\HundresPosition:Num (NumPerl)", "Four\\ThosandsPosition:Num (NumPerl)", "Five\\TenThousPosition:Num (NumPerl)");
my $z = "Four\\ThosandsPosition:Num (NumPerl)";


if(perl_func($z, \@x))
{
    print "\nfound element\n";
}
else
{
    print "\nnot found element\n";
}
0
Hi Team,

I have a folder /opt/reports

In this folder I have some log files for the past 2 years  , I need to list the log files created between 01-03-2015 to 11-03-2015 and 01-03-2016 to 11-03-2016 ,  I tried with find command I was not successful . Is there any other way to get the output . I just need to list the files .

find /opt/reports -name "DatabaseServer" -ctime 720 -print , Iam trying to manupilate the creation time , but not getting the output

Filenames
DatabaseServer_01032015102354.log
DatabaseServer_02032015072354.log
DatabaseServer_03032015132354.log
DatabaseServer_04032015112354.log
DatabaseServer_11032015112654.log
DatabaseServer_12032015112354.log

DatabaseServer_01032016102354.log
DatabaseServer_02032016092354.log
DatabaseServer_03032016082354.log
DatabaseServer_04032016072354.log
DatabaseServer_11032015112654.log
DatabaseServer_12032015112354.log


In my Output  I must get the below files and exclude all files creatred before 1 st of march and after 11 th of march 2015 and 2016
0
Need help on setting permissions for a directory, new to linux.

I have a folder /opt/reports

I have users called user1 , user2  who loggin into linux and  read the contents of the files in this directory. I want to give read permission only to this user1 and user2 and rwx for others users.
Any help in this regard is really appreciated.
0
SYSTEM
Ubuntu Linux 16.04
Android Phone

BACKGROUND
We are on the floor of a convention and trying to connect our linux machine to our Android hot spot. There are too many WiFi hotspots and we cannot find the one from our phone.

QUESTION
On our Linux machine, how to find the hotspot that is being generated by our Android phone? Is there a way to search for the specific hotspot name? Is there a way to turn off the other 100 or more hotspots that are filling up the queue?
0
Hi,

I have a security related question on Linux Ubuntu.
Can we remove sudo access to root console for power users.
But still allow admin to ssh to the servers with root password.
As a security measure is it a good idea to disable root access to everyone if  connecting to servers remotely.

Thanks
0

Linux

66K

Solutions

33K

Contributors

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.