Skip to content

Tag: go

Problem with a Golang webapp and system service

I am trying to create a Golang server using the gin framework on ubuntu. It works fine when it is executed in the terminal after building it with go build and equally works well locally. Systemd I got this error Answer Adding a working directory to the systemd fix this error.

Go pipe write end being closed, why?

I just read some Go code that does something along the following lines: some_binary is a long running process. Why is inst.wpipe closed and set to nil? What would happen if its not closed? Is it common/necessary to close inst.wpipe? Is dup2(pipe_fd[1], 1) the C analogue of cmd.Stdout = inst.wpipe; inst.wpipe.…

Changing linux user password from Golang not working

I need a one-liner from inside a go routine to change a user’s password in linux. The command that WORKS from the command line: But this doesn’t work from my Go program. I have tried substituting other one-liner commands, such as: drm file.txt, touch file.txt, etc. And those all work. The Go progr…

Failed to install

I was trying to install gospider and other tools,I get this error I tried to update sudo go get -u all as in here but it runs forever. Answer If strings.ReplaceAll is undefined that means you’re using a version of Go prior to 1.12, which is when that function was added. To install that package, you need…

How to get Resident Set Size (RSS)

I need to know physical memory consumption of my Go process in Linux. What I need is Resident Set Size (RSS). runtime.ReadMemStats is not suitable because there is no way to get a size of a portion of a virtual memory that is resident. syscall.Getrusage is not suitable because it returns only Maxrss that is m…

Slicing in Golang leads to blank terminal and messed up threads

Hey I am trying to automate a tool to do my recon I am using url to store url with https:// but there’s a tool whois and sublist3r that needs the address without https:// so I sliced the string but when I run the tool it crashes out and blanks out my terminal I can type but can’t see the