NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
- Each line is a valid JSON value
- Line separator is ‘\n’
cat test.json | jq -c '.[]' > testNDJSON.json
NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
cat test.json | jq -c '.[]' > testNDJSON.json
| #!/usr/bin/env bash | |
| set -e | |
| wget \ | |
| --recursive \ | |
| -c \ | |
| --level=inf \ | |
| --page-requisites \ | |
| --convert-links \ |
For excessively paranoid client authentication.
Original: https://gist.github.com/mtigas/952344
openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
| 1. Dump the data only sql to file | |
| $ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql | |
| 2. scp to local | |
| 3. Remove the SET statements at the top | |
| such as: | |
| SET statement_timeout = 0; | |
| SET client_encoding = 'SQL_ASCII'; | |
| 4. Remove the setval sequence queries |
Update: I created jq-zsh-plugin that does this.
One of my favourite tools of my trade is jq. It essentially enables you to process json streams with the same power that sed, awk and grep provide you with for editing line-based formats (csv, tsv, etc.).
Another one of my favourite tools is fzf.
| #!/bin/bash | |
| # Recommended steps: | |
| # | |
| # bootstrap before entering chroot | |
| # copy this script into INSTALL_DIR | |
| # rootinit after entering chroot | |
| # x (if installing graphics) | |
| # pkgs | |
| # xpkgs (if installing graphics) |
| sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common | |
| sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev | |
| #Optional: so vim can be uninstalled again via `dpkg -r vim` | |
| sudo apt-get install checkinstall | |
| sudo rm -rf /usr/local/share/vim /usr/bin/vim | |
| cd ~ |
| { | |
| "lib/**/views/*_view.ex": { | |
| "type": "view", | |
| "alternate": "test/{dirname}/views/{basename}_view_test.exs", | |
| "template": [ | |
| "defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}View do", | |
| " use {dirname|camelcase|capitalize}, :view", | |
| "end" | |
| ] | |
| }, |