So I have a bash script which will scan a directory and run a function on a selected input. It seems that for some reason, the key is not setting from the array properly. What am I missing? All help is much appreciated! EDIT: As a side note, I can run the commands separately and get results. Here is the
select() fails when adding m32 flag to Makefile
i have the following code, which simply creates udp socket to listen to a multicast group. I’m compiling it using gcc, with -c -g flags, on x64 machine. When adding -m32 flag to linking & compiling phases in Makefile, select() call is failing with Invalid Argument. After debugging a little bit with …
Why doesn’t the ‘syscall’ instruction work under Linux?
I have a very basic assembly program that runs in Linux userland: However, this doesn’t work as it is, but only if I replace the syscalls with int 0x80. Don’t these do the same thing? I know that syscall was designed to be lower-latency, but other than that, I didn’t think there was a differ…
Creating Linux Alias to list only Directories
I’m wanting to create an alias called dir for KSH that will show only the sub-directories in a cluttered directory with many files and directories. I can output a single-column list of the directories, but I am having a problem converting the single-column list into a multi-column. I want it to automati…
View git pgp sigs in a commit with out gpg installed
In some cases I will be using a system that does not have gpg installed and I do not want to take the time the set it up and get the pub key installed. I would like to just view the signature on the commit and copy it to another system to validate it. I can not seem to find
Unable to write on /dev/* files
I’m writing a basic char device driver for Linux kernel. For this, the code flow I have considered is as follows: alloc_chrdev_region() -> to use dynamic allocation of major number class_create() -> to create device class in sysfs device_creat() -> to create device under /dev/ cdv_init() -> …
Using a glob expression passed as a bash script argument
TL;DR: Why isn’t invoking ./myscript foo* when myscript has var=$1 the same as invoking ./myscript with var=foo* hardcoded? Longer form I’ve come across a weird issue in a bash script I’m writing. I am sure there is a simple explanation, but I can’t figure it out. I am trying to pass a…
How to run DNX ‘console app’ as a background service on Linux?
I’ve implemented a DNX (dnx451) ‘console app’ which is intended to run as a background service. On Windows I would just turn it into a Windows Service. What is the proper way to do this on Linux (for instance, Ubuntu)? EDIT: Found more info here: How to migrate a .NET Windows Service applica…
Why malloc is faster than static memory allocation in my test program?
I have a test program. I get this result when executing it in ubuntu trusty 64 bit. malloc time:9571 static time:45587 Why malloc is faster than static memory allocation,or my test program is wrong? The test program is like this. Answer That benchmark is essentially meaningless because most of what it is meas…
Using repo with goldfish Android kernel
I was trying to configure repo with a local_manifest.xml file to get the goldfish Android kernel available at: https://android.googlesource.com/kernel/goldfish.git I have written the following local_manifest.xml file that I copied in .repo/manifests/local_manifest.xml: Giving the following command: repo init …