What is Wrong with GNU Coreutils?
I recently came across Open Sourcing: Base 64 Converter on steemit. Talk about a low quality post. Some people are just really reaching for content on steemit anymore.
Why Do I not Like This?
Well, it's a nothingburger. There is no point. Base64 is part of so many languages and tools. I do not see the need for this. Normally, I would not care, but this is one of those, "If you find this tool useful, look inward" situations. I want to use this opportunity to really help people rather than let this one go.
What is wrong with gnu?
cat file | base64 > file.b64
or
cat file.b64 | base64 -d > file
What is wrong with Python
cat file.b64 | python -c "import base64, sys; print(base64.b64decode(sys.stdin.read().strip()).decode('utf-8'))"
cat file | python -c "import base64, sys; print(base64.b64encode(sys.stdin.read().strip().encode('utf-8')).decode('utf-8'))"
What is wrong with NodeJS
cat file | node -e "process.stdin.on('data', d => console.log(Buffer.from(d).toString('base64')))"
cat file.b64 | node -e "process.stdin.on('data', d => console.log(Buffer.from(d.toString().trim(), 'base64').toString()))"
What is wrong with Golang
cat file | go run <(cat <<EOF
package main
import (
"encoding/base64"
"fmt"
"io/ioutil"
"os"
)
func main() {
data, _ := ioutil.ReadAll(os.Stdin)
fmt.Println(base64.StdEncoding.EncodeToString(data))
}
EOF
)
cat file.b64 | go run <(cat <<EOF
package main
import (
"encoding/base64"
"fmt"
"io/ioutil"
"os"
)
func main() {
data, _ := ioutil.ReadAll(os.Stdin)
decoded, _ := base64.StdEncoding.DecodeString(string(data))
fmt.Println(string(decoded))
}
EOF
Leave What is Wrong with GNU Coreutils? to:
Read more #blog posts
Best Posts From timesheets
We have not curated any of timesheets's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From timesheets
- 💥 The Day Dell Killed My Boot: Evil Windows 11 Stop Code
- 🔐 Taming WSL in Bridged Mode with ProtonVPN and WireGuard
- Resolving Unintended Kubernetes Pod Scheduling: A Practical Guide
- What is Wrong with GNU Coreutils?
- Troubleshooting and Optimizing WSL2 Kubernetes Networking: A Journey to Seamless Bridged Mode Setup
- Troubleshooting Kubernetes DNS Issues in a WSL2 Node: A Tale of Flannel and Routes
- Troubleshooting k3s Agent Container Errors: A Real-World Fix
- How to Safely Remove a Control-Plane Node from a K3s Cluster
- 💥 How I Fixed Pop!_OS Booting into Emergency Mode
- Weekend Plans 2024/09/14
- SSHD in Kubernetes and communicating with buildkitd
- Bridging Network on Mac OS X for Kubernetes Cluster
- Update Your Wetware
- CVE-2022-3786 and CVE-2022-3602: What OpenSSL Version are you on?
- Downsides to WSL + Rancher Desktop + k8s + AWS
- Development Inside Kubernetes Part 5: Kaniko
- Development Inside Kubernetes Part 4: Private Container Registry
- Using Private Docker Registry with Skaffold
- Adding the Stable Chart Repo After Deprecation
- Development Inside Kubernetes Part 4: Private Container Registry