Currently working on Linux Cinnamon. I have unistall/removed Open JDK from my local drive. Then I checked java -version via terminal and gives – After that following the installation guide to install oracle jdk 8 for linux. Then I just checked java -version command through [I just unpack jdk to /opt/jav…
Tag: linux
compiling c++ projects with dlib library on linux
I want to use dlib library for my c++ projects in linux. I have installed it successfully and able to compile and run the .cpp samples files given under the dlib. I have compiled the sample files through the “g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 example_program_name.cpp” …
Invalid ELF header out of the gate running simple nodejs script
I’m trying to run a simple nodejs script on Ubuntu 14.04, the contents of which are as follows: I’ve installed NodeJs via the instructions found here. Here is the excerpt I followed from that link: Option 2: Install Node.js with Ubuntu Package Manager To install Node.js, type the following command…
Responsibility of stack alignment in 32-bit x86 assembly
I am trying to get a clear picture of who (caller or callee) is reponsible of stack alignment. The case for 64-bit assembly is rather clear, that it is by caller. Referring to System V AMD64 ABI, section 3.2.2 The Stack Frame: The end of the input argument area shall be aligned on a 16 (32, if __m256 is passe…
How do I find the number of all .txt files in a directory and all sub directories using specifically the find command and the wc command?
So far I have this: I’m not quite sure how to use wc to find out the exact number of files. When using the command above, all the .txt files show up, but I need the exact number of files with the .txt extension. Please don’t suggest using other commands as I’d like to specifically use find a…
Does Bash ignore # after command?
I know that Bash ignores the # character at the beginning of shell script lines. But in documentation I’d like to add them at the end of lines for documentation: Just in case somebody copies and pastes the literal information I’ve written, will Bash ignore everything after the # character? For eve…
Makefile as simlink: not found
Is it possible to have a Makefile referenced by a simlink, and try calling action using make? I am experiencing that calling make in a directory where Makefile is a simlink, Makefile is not found. I have a need to reduce replication of Makefiles, and I would prefer using simlinks. Suggestions? Answer It shoul…
Converting date format in bash
I have similar different file of the format backup_2016-26-10_16-30-00 is it possible to rename using bash script to backup_26-10-2016_16:30:00 for all files. Kindly suggest some method to fix this. Original file: backup_2016-30-10_12-00-00 Expected output: backup_30-10-2016_12:00:00 Answer To perform only th…
Does context switching works everytime, or does it result in unexpected behaviour?
In the below code my friend has stimulated a dead lock situation with context switching and mutex lock in linux. The problem is, after execution it printed Statement 1,3 and 4 But the correct output should have been statements 1,3 and 2 But when I change the value of sleep in func2 to sleep(4) It works fine. …
bash if elif statement always prints first value
For some reason, the first value is always printed. I can’t figure out the reason behind it. Any ideas? I tried many things including single =, single [] but nothing seems to be working at all. Answer You need to add whitespace to the conditions: