Skip to content

Instantly share code, notes, and snippets.

View mashayev's full-sized avatar

Eddie Mashayev mashayev

View GitHub Profile
@mashayev
mashayev / json_log.lua
Created November 11, 2020 10:33
Request / Response login in NGINX with lua
local list_req_headers = {}
for k, v in pairs(ngx.req.get_headers()) do
list_req_headers[#list_req_headers+1] = tostring(k) .. ": " .. tostring(v)
end
local list_res_headers = {}
for k, v in pairs(ngx.resp.get_headers()) do
list_res_headers[#list_res_headers+1] = tostring(k) .. ": " .. tostring(v)
end
#!/bin/bash
set -x
set -u
check_fstab () {
time_stamp=$(date +%F-%H:%M:%S)
cp /etc/fstab /etc/fstab.backup.$time_stamp
cp /etc/fstab /etc/fstab.modified.$time_stamp
sed -n 's|^/dev/\([sx][v]*d[a-z][0-9]*\).*|\1|p' </etc/fstab >/tmp/device_names # Stores all /dev/sd* and /dev/xvd* entries from fstab into a temporary file