Add 'yq/1.sh'
This commit is contained in:
		
							
								
								
									
										24
									
								
								yq/1.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								yq/1.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					###################################
 | 
				
			||||||
 | 
					############ by Sthope ############
 | 
				
			||||||
 | 
					###################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## nano ~/.bashrc
 | 
				
			||||||
 | 
					## and add this to the end of the file: export PATH=$PATH:~/bin
 | 
				
			||||||
 | 
					## sudo chmod +x ~/bin/*;su -l $USER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### USAGE
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### fake passwords
 | 
				
			||||||
 | 
					yq eval '.[] = "fake_password"' secrets.yaml > fake_pwds.yaml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### fake ips
 | 
				
			||||||
 | 
					yq eval '(.[] | select(. == "*.*.*.*")) |= "127.0.0.1"' secrets.yaml > fake_ips.yaml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### merging all into one
 | 
				
			||||||
 | 
					yq eval-all 'select(fi == 0) * select(filename == "fake_ips.yaml")' fake_pwds.yaml fake_ips.yaml > fake_secrets.yaml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### clean up..
 | 
				
			||||||
 | 
					rm fake_pwds.yaml fake_ips.yaml
 | 
				
			||||||
		Reference in New Issue
	
	Block a user