Skip to content

Instantly share code, notes, and snippets.

View kaatinga's full-sized avatar
😎
Learning

Michael Gunkoff kaatinga

😎
Learning
View GitHub Profile
@kaatinga
kaatinga / How to arrange your work with private repositories properly.md
Last active October 17, 2024 17:05
How to fix 'fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled'

Ops. https://gitlab.com': terminal prompts disabled

Ops. Username for 'https://codeberg.org':

Ops. etc

If you see this message, there is a short solution how to fix it here. In my case it appeared and it did not want to get fixed by many ways that are offered on the internet.

Some of the pieces of advice that did not work:

  1. Set git config --global --add credential.helper manager
Sometimes it is recommended to change `autocrlf` option that actually is not correct way if your team works on Windows and Unix-like operation systems.
A special setting `core.safecrlf` can be turned off `git config --global core.safecrlf false`. It will turn off only these warning, not the feature itself.
go get -u github.com/golang/protobuf/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
download protoc utility for Golang
https://github.com/protocolbuffers/protobuf/releases/tag/v3.13.0
put protoc binary somewhere in the PATH

First, generate a new RSA key pair, like this: ssh-keygen -t rsa -f test_server (the both files will appear in ~/.ssh folder).

Second, send your RSA key to the target server, ssh-copy-id -i test_server [email protected]. A note. The name of the file must be pointed out prior the address.

The last step, you have to indicate to the ssh utility which key to use if you connect to the 1.1.1.1 server. Edit the config file in the ~/.ssh folder like this:

#test server
Host 1.1.1.1
 HostName 1.1.1.1
@kaatinga
kaatinga / gist:2549927978f7b1d7876906cc10dd80ec
Created October 20, 2021 06:11
How to get access to virtual box shared folders
In case we enabled auto-mounting on creating a shared folder from the Virtual Box Manager those shared folders will automatically be mounted in the guest with mount point /media/sf_<name_of_folder>. To have access to these folders users in the guest need to be a member of the group vboxsf.
sudo usermod -aG vboxsf <userName>
@kaatinga
kaatinga / gist:ae88cd5fe3174f5b1d566c4c47e56168
Created December 9, 2021 15:36
docker: delete all volumes
docker volume prune -f
@kaatinga
kaatinga / Host_key_verification_failed.md
Last active February 2, 2022 09:18
Resolving `Host key verification failed`

If you see message when update dependecies in Go or in another cases when update git repositories:

Host key verification failed.
fatal: Could not read from remote repository.
	
Please make sure you have the correct access rights
and the repository exists.
@kaatinga
kaatinga / how_to_add_heroku_repo.md
Last active March 11, 2024 21:19
add heroku repository
heroku git:remote -a <app name>

for abc:

heroku git:remote -a abc

@kaatinga
kaatinga / test_data_sql.md
Created May 23, 2022 14:18
fast way to add a lot of data to a database
insert into attribute_allowed_lists (attributeid, allowedvalue) select 2, md5(generate_series::text) from generate_series(1, 100000);

or

insert into test3 (id, name) select generate_series, gen_random_uuid() from generate_series(1, 1000);
@kaatinga
kaatinga / ieee 754 floating point numbers.md
Last active June 1, 2022 12:35
Deep understanding of IEEE754 floating point numbers

Preface

In this article, we will take a closer look at the storage details of floating-point numbers in the go language

What is the result of the following simple program 0.3 + 0.6?Some would naively assume 0.9, but the actual output is 0.899999999999 (go 1.13.5)

    var f1 float64 = 0.3
    var f2 float64 = 0.6
    fmt.Println(f1 + f2)