Skip to content

Instantly share code, notes, and snippets.

@qosmio
qosmio / iwchan.awk
Created Jan 13, 2021 — forked from vgaetera/iwchan.awk
Select wireless channel automatically
View iwchan.awk
#!/usr/bin/awk -f
# Coded by: Vladislav Grigoryev <vg[dot]aetera[at]gmail[dot]com>
# License: GNU General Public License (GPL) version 3+
# Description: Select wireless channel automatically
function get_iwphy() {
cmd = "iw phy"
while(cmd | getline) {
if($0 ~ /^\s*Wiphy\s/)
@qosmio
qosmio / README.md
Created Jul 25, 2020 — forked from joyrexus/README.md
Perl one-liners
View README.md

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

View gist:6a054b60a53f3e2b7f0cc678a2c10ee3
#!/bin/bash
PORT=62419
OUTFILE=/tmp/db2_was.log
SLEEP=30
echo " TIMESTAMP | PRT | CONNECTION_STATES"
echo "------------------------ ------ ---------------------------------------------------"
while true
do
netstat -ant | grep -v grep |grep $PORT|
awk -v port=$PORT -v date=" $(date +"%Y-%m-%d %r")" '