/"([^\\]\\"|[^"])*?"/Sample Data:
"ASD"
"asd\" asd"
"asd\\" "asd"
"asd"
| file_names = Dir.glob("**/*.rb") | |
| file_names.each do |file_name| | |
| content = File.read(file_name) | |
| new_content = content.gsub(/\.dig\('([^']+)'\)/) { |function| function.gsub(/(.)\.(.)/, '\1\', \'\2' ) } | |
| File.open(file_name, "w") {|file| file.puts new_content } | |
| end |
| DO $f$ | |
| declare | |
| read_data TEXT; | |
| bad_id INT; | |
| begin | |
| FOR bad_id IN SELECT id FROM <TABLE_NAME> LOOP | |
| begin | |
| SELECT <TABLE_FIELD> | |
| INTO read_data | |
| FROM <TABLE_NAME> where id = bad_id; |
| require 'titleize' | |
| matches = [] | |
| input = ARGF.read | |
| puts "--------------------------------------------------------" | |
| puts "--------------------------------------------------------" | |
| puts "--------------------------------------------------------" |
/"([^\\]\\"|[^"])*?"/Sample Data:
"ASD"
"asd\" asd"
"asd\\" "asd"
"asd"
| #!/bin/bash | |
| dpkg -l | grep '^rc' | awk '{print $2}' | grep 'linux-image' | xargs sudo apt purge -y |
| netstat -apn | grep CLOSE_WAIT | awk '{ print $7 }' | sort | uniq -c | sort -nr |
| import grpc | |
| import logproto_pb2 | |
| import logproto_pb2_grpc | |
| import google.protobuf.timestamp_pb2 | |
| import time | |
| print("=== loaded loki plugin ===") |
| (import "ksonnet-util/kausal.libsonnet") + | |
| { | |
| local cronJob = $.batch.v1beta1.cronJob, | |
| local container = $.core.v1.container, | |
| hello_container:: | |
| container.new("hello", "busybox") + | |
| container.withCommand([ | |
| "sh", | |
| "-c", |
Commands to use where no docker is available e.g. in a container.
https://github.com/google/go-containerregistry/tree/master/cmd/crane
crane append -f jail.tar --new_tag jail:latest --output jail-latest.tar| tk eval environments/default | jq --raw-output '[paths(scalars) as $$p | select($$p[-1] == "image") | getpath($$p)] | unique[]' | tee -a images.txt |