Skip to content
Advertisement

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.Close()? Answer That code is typical of a program that

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 program is in a package inside a big

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 to first update

Why is this twurl command (run on linux, by golang exec) not being authenticated?

I’m currently working on a Golang website (running on Ubuntu) that will update a twitter status. I used twurl customer key authentication on the system and I can successfully update the status if I type directly into the linux terminal. For example ssh/putty into target system type in terminal: twurl -d ‘status=is this thing on’ /1.1/statuses/update.json twitter status successfully updated

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 maximal RSS during process life.

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

Advertisement