Skip to content

Instantly share code, notes, and snippets.

Ivan Zezyulya ivanzoid

Block or report user

Report or block ivanzoid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Linux find.sh
# A find Tutorial and Primer: https://danielmiessler.com/study/find/
find . -name '*.jpg'
# find only directories
find . -name 'foo' -type d
# find only files
find . -name 'foo' -type f
View Linux create tarball.sh
tar cvf file.tar path
tar cvzf file.tar.gz path
tar cvjf file.tar.bz2 path
View Golang write string to file.go
package main
import "os"
func writeStringToFile(path string, s string) error {
file, err := os.Create(path)
if err != nil {
return err
}
View Golang shabang.go
//usr/bin/env go run $0 -- "$@"; exit $?
View Golang run command.go
package main
import (
"os/exec"
"strings"
"fmt"
)
func runProgram1(program string, args ...string) (string, error) {
outStrings, err := runProgram(program, args...)
View Golang read first string from file.go
package main
import (
"os"
"bufio"
)
func readFirstLineFromFile(path string) (string, error) {
file, err := os.Open(path)
if err != nil {
View Golang program with single argument.go
package main
import (
"fmt"
"os"
"flag"
"path/filepath"
)
func usage() {
You can’t perform that action at this time.