I’m trying to check if the user input $1 exist in an array. And here is my code: What I expect is only “aaa.bbb.ccc” or “ccc.ddd.aaa” can be found. However, in this case, like “aaa” or “ccc” can also pass the validation. Seems like the dot is not treated a…
Tag: linux
How to run docker rmi $(docker images -a -q) in Jenkins as part of ssh script
I am building a Jenkins jobs to build docker container on AWS EC2 instance and this is a sample of a Jenkins script that is giving errors: When I build this job in Jenkins, it fails with following error on output console : “docker stop” requires at least 1 argument(s). See ‘docker stop ̵…
How to convert to / get RFC822 date in bash/linux?
Looking at date’s man page, I couldn’t find a standard way to convert to rfc822 (eg: from unix timestamp). I took a brief look at the spec, but I don’t know enough about the subject matter to get the format right. Is there a easy way to convert to rfc822 with standard linux terminal tools? A…
How to get Date Month values in linux date command as integers to work on
I want to convert date and month as integers. for example. if the current date as per the command “Date +%m-%d-%y” output, is this 09-11-17 Then I am storing the $cur_day will give me 11 and $cur_month will give me 09. I want to do some operations on the month as 09. like i want to print all the n…
truncate shell command output from last line matching a string until EOF
I would like to truncate the output of a shell script and only print the part between the last line matching a string/regex and EOF. E.g when running letsencrypt certbot renew –post-hook “service apache2 reload; service nginx reload” I get something like Now what I want to have is everything…
sed command to copy lines that have strings
I want to copy the line that have strings to another file for eg A file contain the below lines I want to copy the lines that has 100 or 200 to another file by skipping all the characters before (first occurrence in a line)100 or 200 I want it to copy 100 50 200 40 100 34 to another
tcpdump error message “That device doesn’t support monitor mode”
Running Linux on a Xilinx ZCU102 development board. When using a 1000BASE-X & Tri-Mode Ethernet Mac. I can send pings out of the Ethernet port, but when I run tcpdump to try and show that packets are coming into the system… I get a strange error from tcpdump. Curious if anyone has any insight on thi…
C – get list of opened handlers – duplicate entries
I have this code to retrieve list of opened handlers (mostly FILE) However, when i call single fopen and run this, it prints the same file multiple times (from n to FD_SETSIZE, where n is some offset id… first 0 .. n are some system handlers like dev/nul etc.). Answer Your error check after fcntl(fd, F_…
Why there are many i686 RPMs in CentOS x86_64 repository?
I’m looking at http://mirror.centos.org/centos-7/7.3.1611/os/x86_64/Packages where there are many i686 RPMs included. Not every x86_64 RPM has its i686 RPM counterpart though. I thought i686 packages are for 32 bit machine only, but why are they present under x86_64 directory? Are they really needed for…
Cordova can’t find ANDROID_HOME or android in my PATH although they are there
I set up ANDROID_HOME to my android installation dir as well as adding $ANDROID_HOME/platform-tools and $ANDROID_HOME/tools to my PATH. When adding the android platform to my project, cordova seems to find android as it needs to run “android update project …..” for doing so but when I’…