kubectl get nodes > all_nodes.txt
cat all_nodes.txt | while read line ; do if [[ $line == *"sobusy"* ]]; then echo $line; fi; done > filtered_nodes.txt
kubectl logs <pod> <search_criteria> > some_file.txt
-- | |
-- PostgreSQL database dump | |
-- | |
-- Dumped from database version 9.6.6 | |
-- Dumped by pg_dump version 10.4 (Debian 10.4-2.pgdg90+1) | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET idle_in_transaction_session_timeout = 0; |
kubectl get nodes > all_nodes.txt
cat all_nodes.txt | while read line ; do if [[ $line == *"sobusy"* ]]; then echo $line; fi; done > filtered_nodes.txt
kubectl logs <pod> <search_criteria> > some_file.txt
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
This is pretty specific to my setup but the idea can be adapted to work with pretty much anything.
Go has a flag package which makes parsing command line arguments really easy.
package main