If I compile this program: for x86-64, the asm output uses movl $.LC0, %edi / call puts. (See full asm output / compile options on godbolt.) My question is: How can GCC know that the the string’s address can fit in a 32bit immediate operand? Why doesn’t it need to use movabs $.LC0, %rdi (i.e. a mo…
Tag: linux
How do I search for a certain piece of text inside of a variable?
I am working on a script which prompts the user for their username. Once entered, the script uses the ‘rwho’ command to get a list of users who are logged into the network. It should crosscheck the text they entered (their username) with the results from the rwho command. If a match is found then …
How to configure Java 7 OR Java 8 dependency in Debian deb package?
I am building a Debian *.deb package for our proprietary software. The software is Java based, so I thought it would be good if the deb package checks for an installed Java package first. Problems: This fails if an Oracle JDK 7 is installed. It seems as this would only check for the OpenJDK 7 package. How can…
How to force HTTP to HTTPS with an exception?
So I had to force all connections via HTTP to go to HTTPS on a specific folder (e.g. “public_html/folder1”). I found a tutorial somewhere and used the following in an .htaccess file: Problem is, I have a folder inside that folder1 which should be allowed to be accessed via HTTP and not just HTTPS,…
Read and run different command based on each line of file in Bash Linux?
I am completely new to bash scripting. I am trying to write a script in order to read line by line recent_log.txt which has the following content: and then run the command below for each line depend on the suffix. Output should be in another file. each output should have 2 lines space between them. This is my…
Can bash be used to communicate directly with hardware?
I am interested in writing my own tool in bash to act in place of my current network controller (wpa_supplicant) if possible. For example if I want to issue commands in order to begin a wps authentication session with a router’s external registrar, is it possible, without using any pre-built tools, to c…
How can I find the bridge device name for my tap adapter in C?
On Linux, using C, how can I find the find the name of the bridge device my ethernet interface is attached to? Is there a sequence of ioctl() calls I need to make to find the master bridge device? My C program knows the device name of my TAP adapter from a configuration file (in this case, tap0). Ultimately, …
Pointers and virtual memory [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago. Improve this question According to my system’s cpuinfo file, each processor in my system has a 39 bit physic…
How to build Qt applications for imx6 processors?
The same question was asked in a similar way, but the answer is unsatisfying. That’s why I wanted to ask the following one more time: Starting just with an Ubuntu 14.04 OS, what are the steps that I should follow to cross-compile & deploy my Qt GUI application on an embedded board with imx6 processo…
Select lines by condition and count with one line command
I need help with analyze nginx logs. Sample of log: Is it possible to select with count all uniq ip addresses which contain per_page parameter and this parameter equal or greater than 100? So, the output can be in any format: Is it possible to get with one command? Answer This is absolutely basic awk – …