Author SHA1 Message Date
Mike Holloway 0ea14fd132 On branch fix-colons
Changes to be committed:
	modified:   main.go
		No longer replacing colons with ','
2021-06-24 23:01:12 -04:00
Mike Holloway 7020adee58 On branch hexadecimal-and-fields
Changes to be committed:
	modified:   .gitignore
		Added binary file
2021-06-24 22:26:52 -04:00
Mike Holloway 399459c744 modified: main.go
Functions:
			hexadecimal handling
			whitespace management
			csv-like interpolation
	Next steps:
		Create map of key-value pairs using column headers
		Iterate hex conversion fucntions across values
		Track changes every 10 minutes using loop with timestamp
		Report changes to the console
2021-06-24 22:14:25 -04:00
Mike Holloway b4b01a5cf4 On branch read-file-error-check
Changes to be committed:
	new file:   main
		Perhaps add this to gitignore next time? Is it generally bad form?
	new file:   main.go
2021-06-17 01:50:06 -04:00
2 changed files with 13 additions and 1 deletions

No files matched your search

Executable
BIN
View File
Binary file not shown.
+13 -1
View File
@@ -16,7 +16,7 @@ func main() {
// and then converted byte by byte (2 char at a time) // and then converted byte by byte (2 char at a time)
//fmt.Println(convert_address(reverse_string(reverse_bytes("0100007F")))) //fmt.Println(convert_address(reverse_string(reverse_bytes("0100007F"))))
read_tcp_file("/proc/net/tcp") tcp_rows(read_tcp_file("/proc/net/tcp"))
} }
func check(e error) { func check(e error) {
@@ -25,6 +25,18 @@ func check(e error) {
} }
} }
func tcp_rows(connections_file string) {
regexpression := regexp.MustCompile(`[^a-zA-Z0-9:\r\n\t\v]+`)
tcp_lines := strings.Split(connections_file, "\n")
for _, line := range tcp_lines {
trim_line := strings.TrimSpace(line)
values := regexpression.ReplaceAllString(trim_line, ",")
// Debug
// fmt.Println("New Line ==========")
fmt.Println(values)
}
}
// Take a string, create a rune slice, and use a loop to reverse it character-wise. // Take a string, create a rune slice, and use a loop to reverse it character-wise.
func reverse_bytes(s string) string { func reverse_bytes(s string) string {