jr, jp and jb are commands for JSON modification.
$ data='{"name":"chris", "friends":["alice", "bob"]}'
# jr
$ echo $data | jr 'i.name'| const http = require('http'); | |
| const httpProxy = require('http-proxy'); | |
| const redis = require('redis'); | |
| // listen port | |
| const port = 5050; | |
| // redis client | |
| const client = redis.createClient(); |
| begin | |
| # Some exception throwing code | |
| rescue => e | |
| puts "Error during processing: #{$!}" | |
| puts "Backtrace:\n\t#{e.backtrace.join("\n\t")}" | |
| end |
| /** | |
| * Inspiration taken from here https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/258#issuecomment-413786762 | |
| * Alternative: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/258#issuecomment-407996126 | |
| * | |
| * Original: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/258#issuecomment-437080813 | |
| */ | |
| const express = require('express'); | |
| const cors = require('cors'); | |
| const bodyParser = require('body-parser'); |
| #!/bin/bash | |
| # | |
| # Update DNSimple DNS record if ISP IP changes | |
| # | |
| # Requirements: | |
| # existing DNS record hosted with DNSimple | |
| # curl in $PATH | |
| # | |
| # run from cron | |
| # |
| {"lastUpload":"2022-02-03T22:19:36.554Z","extensionVersion":"v3.4.3"} |
| #!/bin/bash | |
| # | |
| # Ping external IP from wired network to monitor for ISP outtage | |
| # 2020-06-16 | |
| # | |
| # runs on pi-hole from cron every day | |
| # | |
| # kill any other instances running | |
| # name log file day_of_month_down.txt | |
| # remove todays log file if there is one, since it will be a month old |
| require 'connection_pool' | |
| require 'faktory' | |
| T = ARGV[0].to_i | |
| puts "Starting #{T} jobs for each (ruby, node, python)" | |
| puts Time.now() | |
| SomeRubyWorker = Faktory::Job.set(queue: 'ruby', jobtype: 'RubyWorker') | |
| SomeNodeWorker = Faktory::Job.set(queue: 'node', jobtype: 'nodeWorker') | |
| SomePythonWorker = Faktory::Job.set(queue: 'python', jobtype: 'python_worker') |
| while true; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l localhost 4000; done |
| #!/bin/bash | |
| set -e | |
| DEST="${JEKYLL_DESTINATION:-_site}" | |
| REPO="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
| BRANCH="gh-pages" | |
| BUNDLE_BUILD__SASSC=--disable-march-tune-native | |
| echo "Installing gems..." |