I’ve been trying for some time now to enable my computer’s Fn+F9/F10 brightness control. Reading this thread, I tried to set up an acpi event/action script to manually change my brightness. The scripts themselves work – I can manually call bl_down.sh and bl_up.sh in the terminal. However, fo…
Node.js is installed but it’s not usable
I’m using Debian 9.1.0 and I have installed Node.js by downloading the LTS version Linux Binaries (x64). From the location (where I installed Node.js), I can use it: But when I run it outside this location, like: I got the error: bash: node: command not found The solution I found on Internet: create a s…
How to “grep” in array with dot “.” precisely?
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…
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 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…
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…
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_…