How to get an environment variable in Go?
In Go lang, how to get an environment variable?
To get an environment variable (e.g. “VAR”) in GO:
import "os"
import "fmt"
fmt.Println("VAR:", os.Getenv("VAR"))
In Go lang, how to get an environment variable?
To get an environment variable (e.g. “VAR”) in GO:
import "os"
import "fmt"
fmt.Println("VAR:", os.Getenv("VAR"))
I come across some closed source software that only provides .deb packages. Fedora manages packages with rpm/yum. How to install the .deb packages on Fedora? Alien is a tool to convert .deb package to .rpm package: http://joeyh.name/code/alien/ In latest Fedora, the tool alien is in Fedora’s repository. You can use dnf to install the package….
How to print a binary file in hexadecimal format of all content? Use xxd: xxd file.txt or xxd -p file.txt Read more: Printing Integers in Hexadecimal Format in Python How to sort a file by hexadecimal numbers on Linux using sort command? How to read the whole file content into a string in Go? How…
How to run Firefox on Remote Host over SSH ? After $ ssh -X remotehost Run this script on remote host: #!/bin/bash export $(dbus-launch) export NSS_USE_SHARED_DB=ENABLED firefox -no-remote & This script credits to Waxborg: http://waxborg.servepics.com/opensuse/remote-administration/running-firefox-remotely-over-ssh. Read more: How to run screen on a Linux host reporting “Cannot make directory ‘/var/run/screen’: Permission denied”? Fixing “Remote Host…
I know that gettimeofday() is a nice API. But how to get the number of seconds with milliseconds since the epoch time? You can get the time at nano-seconds level (although it is not guaranteed that the last digits are accurate) by: date +%s.%N Read more: Setting sbt log level at the command line Why…
MPlayer has a fully configurable, command-driven control layer which allows you to control MPlayer using keyboard. But which are these shortcuts are not immediately know to users of MPlayer. Below is a list of mostly used MPlayer keyboard control shortcuts. They come from the [[man:1|mplayer|mplayer manual]] where you can find a full list of all…
How to find which package provides a file in Debian based releases, such as Linux Mint, Ubuntu? You can use `dpkg`: $ dpkg -S /path/to/the/file -S or –search is the option to make dpkg do a “search”: -S, –search filename-search-pattern… Search for a filename from installed packages. To search which package provides a command file…