« first day (3333 days earlier)      last day (1615 days later) » 

1:20 AM
@JeffSchaller Did I answer your question?
 
1:36 AM
@JeffSchaller It seems there should be an xkcd about bizarre requirements for software.
 
 
3 hours later…
4:46 AM
I am looking for the question about difference between cat file and cat < file
searching is unhelpful.. It was on HNQ I guess
 
5:14 AM
22
Q: What is the difference between "cat < filename" and "cat filename"?

BlueSkiesThe simplest way to display file contents is using the cat line-command: cat file.txt The same result I get using input redirection: cat < file.txt Then, what is the difference between them?

This one is, surprisingly enough, higher quality:
70
Q: Difference between "cat" and "cat <"

rookieI was working through a tutorial and saw use of both cat myfile.txt and cat < myfile.txt. Is there a difference between these two sequences of commands? It seems both print the contents of a file to the shell.

 
 
2 hours later…
7:45 AM
Thanks!
 
8:19 AM
Dramatic political developments in Maharashtra. But I doubt it's made the international news.
 
 
3 hours later…
11:38 AM
I was trying to use an application from github which says the following instruction:

Make sure the following ports are available: port 8080 for Nginx frontend and 16686 for Jaeger.

How do I check if these ports are available, I'm using Ubuntu 18.04LTS
 
 
2 hours later…
1:26 PM
@kauray Generally, as the admin of the system, you would know what ports you run various services on. If that's not something that you keep track of, then starting any service on those ports would fail if the ports were not available.
This means that you could probably follow the instructions and start Nginx on port 8080 etc. and see if that worked or not. If it doesn't, check the logs and it may tell you that the port is already in use.
 
1:45 PM
113
A: Determining what process is bound to a port

Cakemoxnetstat -lnp will list the pid and process name next to each listening port. This will work under Linux, but not all others (like AIX.) Add -t if you want TCP only. # netstat -lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address St...

 
2:29 PM
I'm done making a mess of the question home page. Yay, fresh Sunday SEDE data!
 
 
1 hour later…
3:29 PM
What is the purpose of this command? ssh-keyscan github.com >> $HOME/.ssh/known_hosts
 
:52675677 ssh-keyscan is a utility for gathering the public SSH host keys of a
number of hosts.  It was designed to aid in building and verifying
ssh_known_hosts files, the format of which is documented in sshd(8).
ssh-keyscan provides a minimal interface suitable for use by shell and
perl scripts.
It adds the host key for github.com to your known_hosts file.
That way, the first time you connect to the host, you will not be asked whether the host key is correct or not.
 
@Kusalananda I did the same for my docker file
and added hosts key for github
 
You will only be notified if the host key reported by the remote host is different from the key that is in your known_hosts file for that host.
 
$ cat ~/.ssh/known_hosts
github.com ssh-rsa AAAAB3NzaC1yc2E....
But below code fails...
node('master'){
    git 'https://github.com/shamhub/todobackend.git'
}
at git 'https://github.com/shamhub/todobackend.git'
with error:
stderr: remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/shamhub/todobackend.git/'
this is private repo
 
Think about how you usually run git. You usually say git sub-command
What do you want git "some URL" to do?
 
3:38 PM
yes
If I give public repo it works
for example: git 'https://github.com/shamhub/docker-jenkins.git' works fine
because this is public repo, which everbody can view it
Now, to address the problem to connect private repo
 
What does that command do? I get a an error: git: 'https://github.com/shamhub/docker-jenkins.git' is not a git command. See 'git --help'.
 
oh sorry
 
What is it you want to do?
 
git 'github.com/shamhub/docker-jenkins.git'
try this
I want to ssh to these repos without password
 
Same thing: git: 'github.com/shamhub/docker-jenkins.git' is not a git command. See 'git --help'.
 
3:41 PM
above command uses ssh internally
 
You need to use git with an additional git-command, like git clone "$URL".
 
sorry this is groovy syntax
 
What?
 
if you are trying on shell prompt
then say
git clone github.com/shamhub/docker-jenkins.git
 
You mean git clone https://github.com/shamhub/docker-jenkins.git.
 
3:43 PM
yes
 
So, to summarise, you are asking about how to check out a private repository?
Is your SSH key registered with the Github project that you are trying to check out?
 
yes.. how to checkout private repo?
No I did not register any ssh key
I just ran ssh_keyscan
am new to this
let me know the steps for this.
 
To access a private GitHub repository, you (your github account) must be registered as a collaborator on the project. This is nothing that you can do yourself, but an existing admin for that project can add you to it. In your own github account, I believe you should add your SSH public key, and then use a git:// URL to check out the private repo once you have been added to the project.
This has nothing to do with the ssh-keyscan command.
 
nothign to do with ssh-keyscan? ok
let me delete the known_hosts file
github account is on my name
so I have privielege to do this
what exact changes are needed?
 
I believe that you need to add your public SSH key to your Github account.
 
3:51 PM
Can I automate that from jenkins dockerfile?
 
This is something you do once only.
 
Oh ok
Do I need to create public ssh key in jenkins docker container that connects to github?
 
I have never used Docker nor Jenkins. I will not answer that.
 
ok
ssh-keygen command is creating public and private key
 
If I was you, I would try to get it to work outside of both Docker and Jenkins first.
 
3:53 PM
ok
I created id_rsa and id_rsa.pub file
Do I need to copy the content of id_rsa.pub file to github account?
 
Yes. Go to your settings page on github, then select "SSH and GPG keys".
 
jenkins@479a1bec5451:~/.ssh$ pwd
/var/jenkins_home/.ssh
jenkins@479a1bec5451:~/.ssh$ ls
id_rsa	id_rsa.pub
jenkins@479a1bec5451:~/.ssh$
ok
added
with title jenkins
what about private key?
id_rsa
 
You do nothing with your private key. It's used to authenticate later.
Then try to clone your private repo using SSH
 
I tried...
jenkins@479a1bec5451:~/.ssh$ ls
id_rsa	id_rsa.pub
jenkins@479a1bec5451:~/.ssh$ git clone github.com/shamhub/todobackend.git
Cloning into 'todobackend'...
Username for 'https://github.com':
it is asking for passwd
 
It should be something like git clone git@github.com:...
Probably git clone git@github.com:shamhub/todobackend.git
 
4:00 PM
$ git clone git@github.com:shamhub/todobackend.git
Cloning into 'todobackend'...
The authenticity of host 'github.com (140.82.114.4)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
 
If it's asking for a passphrase when you use git@github.com:..., then it's the passphrase for the SSH key.
"yes"
 
Client is able to receive RSA key fingerprint for that host, because we copied public key?
 
No. That text would have appeard in any case. It's just that you're connecting to github for the first time (you just deleted your known_host file!)
That won't happen the next time.
Were you able to clone the repo?
 
How git@github.com:shamhub/todobackend.git different from https://github.com/shamhub/todobackend.git?
 
Were you able to clone the repo?
 
4:05 PM
yes
 
Good.
The https:// url does not use SSH, the other one does.
 
You were able to clone your private repo because Github could verify the SSH key stored in your account there.
... against the private one that you used to connect with.
 
is that the handshake?
 
It the same thing that happens when you log into a remote system using SSH keys.
 
4:07 PM
so, client encrypted the request with private key(id_rsa)... that GitHub is able to decrypt with public key(id_rsa.pub)
Is that correct?
 
That is correct.
 
and vice verca?
GitHub encrypts with id_rsa.pub and client decrypts with id_rsa
if yes, then these are symmetric keys
 
Hmmm... The public host key of github.com is now in your known_hosts file. Every time you connect to github.com using SSH, that key will be verified. You will be notified if there is a difference.
It is not symmetric in the sense that Github could connect to you (they can't, because they don't have your private key).
They can't authenticate as you anywhere because they don't have your private key. This means it's not symmetric.
Key-based encryption/authentication is not symmetric.
 
Got it!! so, public host key file of gihub.com in known_hosts will decrypt the messages that are sent by github.com's private encrypted
Now.. this enables only ssh communication
 
@overexchange I can't really say much about that part, but I believe it's essentially correct.
 
4:17 PM
this enables only ssh communication
what about https communication?
say git clone https://github-url
for a private repo
 
@overexchange I don't know how authentication is supposed to be handled in that scenario.
 
ok
may be thru webhook
 
4:36 PM
@Kusalananda In git clone git@github.com:shamhub/todobackend.git do I need to replace user git with specific user name?
 
125
A: git clone through ssh

dsrdakotaFor repositories on GitHub, try: git clone ssh://git@github.com/<user>/<repository name>.git For setting up git to clone via ssh see: Generating SSH Keys and add your generated key in Account Settings -> SSH Keys Cloning with SSH

In this answer... it recommends to use another syntax git clone ssh://git@github.com/shamhub/todobackend.git
So, what exactly is user git in that command?
 
 
2 hours later…
6:14 PM
@overexchange I can imagine that it is the name of the user on the remote system that manages the Git service. A service account on github.com. It is likely responsible for making sure that you are properly authenticated to the repository in the later part of the address.
Or, it's just a string that github.com uses to identify git command requests (as opposed to, for example, one of their employees wanting to log in over SSH).
It doesn't really matter much what it is.
 
 
2 hours later…
8:20 PM
Which one is correct order of X86_64 registers for arguments of Linux kernel syscalls?

1. https://filippo.io/linux-syscall-table/ shows rdi - rsi - rdx - r10 - r8 - r9
2. https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI shows rdi - rsi - rdx - rcx - r8 - r9
 
@StephenKitt Oh! Nice one!
@terdon Yes Sah! At your disposition, Sah!
>:-) ;-)
@JeffSchaller :D :D :D Good one!
(still grinning)
 
9:56 PM
@Biswapriyo the former; see the kernel itself for details. The latter is the x86-64 calling convention for non-syscalls (function calls inside programs).
 

« first day (3333 days earlier)      last day (1615 days later) »