Skip to content

Tag: linux

Changing SAMBA Password in Java

I have a Java program running on linux that needs to be able to both set a users initial samba password, and then allow them to change their password without giving them access to the terminal. Below is my code for changing the users password, as this is easier to test with, and I will be able to figure the

How to prevent Python script from Force exit?

I am running a python script and trying to prevent from force exiting or print an error message or log that into the log file. I am already using logging.info(“”) for logging.. or just print for printing something.. but what or how do I create a method or function that can either do print or log w…

How to create hard link in Linux from a C program

We know we can create hard link in Linux using ln file1 file2 which will make file2 a hard link of file1. However when I try to do this by using a C program, I face issues. Below is the C code. After compiling this program with gcc I run it as below. Here file1 exists and file2 is the

Awk asking combine two files

I have combined two different files with Same Key by AWK command. And In case there is no key match compare to File1 and File2 then just put “ttt” instead. I have below AWK command. Example Combine File1 File2 Then Expected result My AWK Command Show I already tried to do few way like below But lo…