Skip to content

Instantly share code, notes, and snippets.

View carlosedp's full-sized avatar

Carlos Eduardo carlosedp

View GitHub Profile
@carlosedp
carlosedp / highlight.sh
Last active August 29, 2015 14:10
highlight.sh - Highlights/colorizes strings of text
#!/bin/bash
if [ "$#" -eq 0 ]
then
echo ""
echo "Highlights output based on regex and color id"
echo "Usage: cat log.txt | highlight.sh pattern1 31 pattern2 34 pattern 3 32"
echo ""
echo "Color ID"
echo "Black 30"
@carlosedp
carlosedp / downloader.js
Created October 18, 2011 23:33
downloader.js
var http = require("http");
var url = require("url");
var fs = require("fs");
var sys = require('sys');
var config = require('./config');
var emailer = require('./emailer').emailer;
var appLogger = require('./logger').appLogger;
var downloadDirSuffix = config.downloadDirSuffix;
var downloadDir = config.downloadDir;
@carlosedp
carlosedp / destructuring.md
Created October 7, 2016 20:39 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))

let
  (a,b,c) = myTuple
#!/bin/bash
# Set the lb id
LB_ID=$1
read -p "Do you really want to delete LB \"${LB_ID}\"? " -n 1 -r
echo # new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
listeners=($(neutron lbaas-loadbalancer-show ${LB_ID} --format json |grep listeners| grep -o '[a-f0-9-]\{36\}'))
U-Boot SPL 2017.09-g5a90a9a (Jan 29 2018 - 14:55:03)
setup_ddr_param 1
booted from eMMC
Trying to boot from MMC1
NOTICE: BL31: v1.3(release):f947c7e
NOTICE: BL31: Built : 14:55:02, Jan 29 2018
NOTICE: BL31:Rockchip release version: v1.3
U-Boot 2017.09-g5a90a9a (Jan 29 2018 - 14:55:17 +0000), Build: jenkins-linux-build-rock-64-180
Message from syslogd@kubemaster1 at Feb 22 22:11:57 ...
kernel:[ 4976.042257] Internal error: Oops: 96000005 [#1] SMP
Message from syslogd@kubemaster1 at Feb 22 22:11:57 ...
kernel:[ 4976.744825] Process store (pid: 21052, stack limit = 0xffffffc0ec790020)
Message from syslogd@kubemaster1 at Feb 22 22:11:57 ...
kernel:[ 4976.749027] Stack: (0xffffffc0ec793a70 to 0xffffffc0ec794000)
Message from syslogd@kubemaster1 at Feb 22 22:11:57 ...
@carlosedp
carlosedp / master_dump
Created March 22, 2018 16:58
kubernetes_master-KernelDump
Master
DDR version 1.06 20170424
In
LPDDR3
786MHz
Bus Width=32 Col=11 Bank=8 Row=15/15 CS=2 Die Bus-Width=32 Size=4096MB
ddrconfig:7
OUT
Boot1 Release Time: 2017-05-18, version: 2.43
kubemaster1 login:
[ 87.240971] core: dev_pm_opp_get_voltage: Invalid parameters
[ 87.241616] mali-utgard ff300000.gpu: Failed to get voltage for frequency 163840000: -34
[ 87.243050] devfreq ff300000.gpu: Couldn't update frequency transition information.
[ 87.245883] Unable to handle kernel paging request at virtual address ffffff8007ffc9c0
[ 87.246739] pgd = ffffffc0e5c2f000
[ 87.247104] [ffffff8007ffc9c0] *pgd=00000000e4a42003, *pud=00000000e4a42003, *pmd=0000000000000000
[ 87.248091] Internal error: Oops: 86000006 [#1] SMP
[ 87.248611] Modules linked in: ip_set_hash_ip xt_set xt_comment xt_mark ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_conntrack_netlink iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype iptable_filter xt_conntrack nf_nat nf_conntrack overlay ip_tables x_tables
[ 87.251426] CPU: 2 PID: 1892 Comm: kube-apiserver Not tainted 4.4.77-rockchip-ayufan-136 #1
INFO: PSCI Power Domain Map:
INFO: Domain Node : Level 2, parent_node -1, State ON (0x0)
INFO: Domain Node : Level 1, parent_node 0, State ON (0x0)
INFO: Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO: Domain Node : Level 0, parent_node 0, State ON (0x0)
INFO: CPU Node : MPID 0x0, parent_node 1, State ON (0x0)
INFO: CPU Node : MPID 0x1, parent_node 1, State ON (0x0)
INFO: CPU Node : MPID 0x2, parent_node 1, State ON (0x0)
INFO: CPU Node : MPID 0x3, parent_node 1, State ON (0x0)
DDR version 1.06 20170424
@carlosedp
carlosedp / snmp.yml
Created March 28, 2018 00:20
snmp-exporter config to support expanded dd-wrt OIDs
apcups:
walk:
- 1.3.6.1.2.1.1.3
- 1.3.6.1.2.1.2
- 1.3.6.1.4.1.318.1.1.1.12
- 1.3.6.1.4.1.318.1.1.1.2
- 1.3.6.1.4.1.318.1.1.1.3
- 1.3.6.1.4.1.318.1.1.1.4
- 1.3.6.1.4.1.318.1.1.1.7.2
- 1.3.6.1.4.1.318.1.1.1.8.1