Blog | yookoala

Geek, Golang, Open Source

HOWTO: Find out the current user default shell

A snippet to get the current user’s default shell: getent passwd $LOGNAME | cut -d: -f7 This is the only method to have extract the default shell setting. Some would suggest to use echo $SHELL. The command only show your current shell. If you open another shell in it, the $SHELL changes accordingly. Read more

syscall.Utsname [65]int8 to string problem

As you might have noticed, syscall.Uname sets the variables into a *syscall.Utsname struct with fields in type [65]int. It is not difficult to display the output, but the code is too tiny for a library of any sort. Just share the code snippet here: // UtsnameStr reads [65]int8 into string func UtsnameStr(in []int8) string { i,... Read more

Started a new blog

Started a new blog on Github Pages with Jekyll. Will write technical related stuff here. Hope this is not too boring for you. Read more

©2023 All rights reserved. Made with Jekyll and ♥