Linux OS Dev

Kernel programming for Linux operating systems can be done with many different languages; C, C++, Python, Perl and Java, which are some of the most common languages used.There are also many different varieties of Linux, such as Ubuntu, Fedora and OpenSUSE.

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

Sign up to Post

I'd like to determine in my bash script which NIC the default gateway is on in order to determine if i need to add static routes via the script or not. Since there are two instances of 0.0.0.0 in the routing table where the default gateway is I'n trying to determine the NIC mentioned in the routing table where there are two instances of 0.0.0.0. Then if it matches ${DftNic} below I no I won't have to add static routes on the server. Scratching my head on this so any help would terrific.

DftNic=$(ip route show | grep default  awk '{print $7}')
0
Exploring ASP.NET Core: Fundamentals
LVL 12
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

I need to script finding which of the NICS on the server is the one the IP the hostname of the server runs on my Redhat 5 and Redhat 6 x86 servers. This is only part of the script since I'll use the variable for comparison later on in the script but below is how I'm going to do it. Do you think there is a better way to do it or do you think this is good enough? What I'm relying on is that $(hostname) actually matches the entry in /etc/hosts but sometimes hostname has FQDN and sometimes not.

host=$(hostname)

HOSTIP=$(cat /etc/hosts | grep ${host} | awk ‘{print $1}’)
 
if [  ! -z ${HOSTIP} ]; then
          HOSTNIC=$(/sbin/ifconfig -a | grep -B2  ${HOSTIP} )
   else
         printf “HOST NIC IS UNKNOWN”
         exit 1
fi
0
I have multiple NICs on my Redhat 6 x86_64 server and as part of my script I have to determine which NIC is the default gateway on each server since there are lots of static routes over the other NICS. I always see the default gateway as the last line in the routing table but is that logic flawed and I just run net stat -rn | tail -1 | awk '{print $8}' but I'm not sure if that logic is up to par and I'm going to have to tally it up with what's in /etc/sysconfig/network as the gateway.
0
how to enable/disable systmctl "systemd command)?
0
hi i what to put comma delimeted when i do cat of file





cat filename*.out > filename.out



the file is like this

DB: eca1

Input truncated to 37 characters





NSN     INSTANCE   Unit Code

----------- --------- ----------

18-018-6113 ECA1    10582





DB: fsa1

Input truncated to 37 characters





NSN     INSTANCE   Unit Code

----------- --------- ----------

18-018-6113 FSA1    10622



i what file to be like this so i can put in excell



NSN           INSTANCE   Unit Code

18-018-6113 FSA1           10622

18-018-6113 ECA1         10582
0
how to find number of count in the unix logs for a grep search keyword say 'nullpointerexception on deviding 109418 with 0' please advise
0
what is the meaning of below command

less log123.log | grep -i nullpointerexception


why we use less and then grep on it

Please advise
0
in vi we can use /nullpointerexception to find that string right.

how to find how many occurrence of that string total and go to say 10th occurence line
please advise
0
Hi Experts

Could you point a good tool / strategy to a HD under Lubuntu defragmentation?

Thanks in advance
0
How to view the contents of a VMCORE file?
Similar to what Author Comment by:apunkabollywood did on ticket ID: 39512494 2013-09-21
0
HTML5 and CSS3 Fundamentals
LVL 12
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Individual log  files on my server getting zipped every 1 hour and individual log files getting deleted.

PRoblems i am facing with zipped log files are
1. not able to grep them as easily as individual files

2. not able to tail to see any recent issues



if i copy over to local windows laptop using winscp and unzil anf try to open individual file using notepadd++ says too huge file to open.


how to extract zip file in unix box itself and check log files by doing grep and tail etc

please advise
0
Hi Experts

Could you clear what must to be done before to install Lubuntu 64 bits ?

After download Lubuntu installer at  Lubuntu  and obtain what I expect to be the installer:

img002
And when trying to install it a DVD burn software starts...

img001
So, is it obligatory to create a DVD instalator before to install it?

But, if I want to start from a pen-drive f.e. , do I have any workaraound?

Thanks in advance.
0
Hi Experts

Could you point the more convenient  Ubuntu version and  where to obtain it to fit  with this hardware?
(an old laptop)

img001
Thanks in advance!
0
I have a Samsung Galaxy S9+.
Android Version: 8.0.0

I recently put a micro SD card in it and moved many apps to it.  One of them was Bejeweled Classic by Electronic Arts.  Later I noticed that the icon for it was missing, so I went to download/install it again.  When that happened I got a strange error message: "You cannot install this app because another user has already installed an incompatible version on this device"

NOTE: I cannot find the app on my Installed Applications list.

You cannot install this app because another user has already installed an incompatible version on this device
In the link above someone wrote:
What worked for me was: adb shell pm uninstall com.packagename

I have a Terminal Emulator to try that command, I just need to know the exact packagename.

Question: How do I get a listing of package names in the Terminal Emulator?

Screenshot of error message
0
Hi

after i installed nextcloud 13.0.1 on centos 7 and most of the features works

i am facing a strange issue with calendar

i cannot create or delete or do anything with calendar on nextcloud management    please check the attached file

do you think i have to change something from GUI or CLI  or install or do something


kindly advice
ccccccccc.jpg
0
How to send a command /dev/ttyXX.

I've tried these and none seem to worK;
1. echo "stop" > ttyS1
2. echo -ne "stop\n" > ttyS1
0
securecrt vs putty

what additional feature or advantages or disadvantages securecrt has compared to putty or mputty.

how much is the licence cost per year or life time?

any advantages using securecrt or any other commercial better tools?

please advise
0
winscp how to grep or search on a word say "xyz" in all the folders and sub folders
Please advise
0
Hello Experts,

Getting following error while execute cmd from ssh :-

[root@200 ~]# separateBod
ENTER SERVER IP LAST 1 QUADRANT WHICH YOU WANT TO BOD:
119
Option "-t" is deprecated and might be removed in a later version of gnome-terminal.
Option "-t" is deprecated and might be removed in a later version of gnome-terminal.
Failed to parse arguments: Cannot open display:

separateBod Code:-
#!/bin/bash
printf "ENTER SERVER IP LAST 1 QUADRANT WHICH YOU WANT TO BOD"
 read IPNAME
 for i in $IPNAME
 do
  ssh user@192.168.1.$i BOD & pid=$!
 done

BOD Code:-
#!/bin/bash
gnome-terminal \
        --tab -t "Exchange" -e " sh -c 'sleep 1s; ./startapp Exchange' "\
        --tab -t "Dragon" -e " sh -c 'sleep 10s; ./startapp Dragon' "\

startapp code:-
ulimit -c unlimited
export LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH}
./$1 $2 $3 $4 $5

After giving execution cmd from server (ssh) it should be displayed on other server vnc (user@192.168.1.119), it was working properly till last week suddenly i got this error, we have following versions of CentOS 64bit (6.7, 6.8, 6.9, 7.4), getting issue only with 7.4 64bit.

please suggest.
0
Exploring SQL Server 2016: Fundamentals
LVL 12
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

winscp how to name the link i save to favorite

say i have link
/home/xyz/bea/logs

i want to save above link with name as production_logs_folder

I have other link as below

/home/xyz/crm/logs

i want to save above link with name as crm_logs_folder

how do i name like above so that it is easy to locate and navigate later
\please advise
0
I have had to disable SELinux to get an application installed ,I was wondering if anyone has ever used 'AUDIT2ALLOW' to re-tag the objects in SELINUX and re-enable SELINUX  

I have never ever worked with SELINUX before and could use any advice you can give
0
log file how to copy whole content

zgrep -C20 '1234' 1234.log.gz

above gave lot of results in unix screen

how to copy whole page and paste into a text file on my C drive of the windows laptop through which i am connecting to unix box using putty?


also

i see all results like

0123456
9123488

etc

which i do not want

i want complete word search of 1234 only
how to achieve it
please advise
0
what is curl and ping in unix.

lets say i have service called
www.xyz/webservice_operation

now if do
curl  www.xyz/webservice_operation
get the exact_name of service from above result
then use that exact name to ping
ping exact_name
then we can get ip of the service where it is running?

please advise
0
how can I suppress this message when ssh into a linux server , i cant seem to find this like no check or something ,


ECDSA key fingerprint is MD5:de:66:6wea:32:dw2:65:d7wwwwwww:1c:a4:05:e0.
Are you sure you want to continue connecting (yes/no)? yes
0
I can see all processes in my box using memory total as 25GB but the actual memory used is 62GB, I am really confused that what happened for remaining memory....don't know whether i need to clear memory cache or not?

test@test[~] $  ps aux  | awk '{print $6/1024/1024 " GB\t\t" $11}'  | sort -nr | awk '{print $1}' | awk '{total = total + $1}END{print total " GB"}'
24.4622 GB
test@test[~] $ free -g
                            total       used       free     shared    buffers     cached
Mem:                      62         62          0          0               2             32
-/+ buffers/cache:              27         35
Swap:                        7          0          7
test@test[~] $

Open in new window



memory issue
0

Linux OS Dev

Kernel programming for Linux operating systems can be done with many different languages; C, C++, Python, Perl and Java, which are some of the most common languages used.There are also many different varieties of Linux, such as Ubuntu, Fedora and OpenSUSE.

Top Experts In
Linux OS Dev
<
Monthly
>