Skip to content

How can I push only the files in current index?

I have many large binary files with source code under git version control. I want to only push the source files to github for repo initialization. So I used git rm -r –cached to remove the large binary files from the index. After checking git ls-tree -r –names-only mybranch, I confirmed there are …

Return the ls -l output in docker container

So I have a docker container running which has a couple of folder/files inside. When I go inside the container I can see that they are: hostmachine$> docker exec -it testContainer bash testContainer@testContainer:~$ ls -l My question is: What script, how can I use it on my hostmachine that will: 1) Echo ba…

Print the two matched variables of awk in same line

This is the script which i wrote. The logs.txt consists of : In this the expected output is : But the output i am getting is : Can anyone rectify what is the error ? Answer I thinks this problem should be separated multiple problems. How do you think about below code? You can see what these code actually do

Issue with HH date time format

Need help to identify where is the issue, whether it is a java issue or linux box or something else. My app is running on linux weblogic, app is generating some kind of .tar files on linux with datetimestamp in filename. I am using below snippet to get current time to prepare filename: File format: SA_PART_YY…

Invoke Python as Executable

I have a Python script, a simple Hello, World. I need to invoke it as I would an executable and take piped input: How do I generate the command python3 myprogram.py and handle the piped input? Answer If you’re on a *Nix system, you’ll need to follow 3 steps: Make sure your script has executable pe…

Can a single peer run 2 different chaincode

I am trying to chaincode something so just have a question that can a single peer run 2 different chaincodes? So need your help here. Answer Yes, peer can have more than one chaincode installed and instantiated. Moreover for some case this is actually vital, for example if you would like to have a chaincode f…

How to run commands on CentOS reboot

I want to run the following commands one after the other upon reboot of the server after I do shutdown -r now but not sure how to do it: getenforce setenforce 0 systemctl start httpd.service I’m running CentOS 7.x Answer Technically you can crontab it and add the line and put the 3 commands in the myscr…