Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function() {
$('#list-users-button').click(function(){
$.getJSON('https://jsonplaceholder.typicode.com/users',
function (data) {
//console.log("> ", data);
$("#list-results-table tbody").append("<table>");
for ($i=0; $i < data.length; $i++){
$("#list-results-table tbody").append('<tr><td>' + data[$i].name + '</td></tr>');
@TheCase
TheCase / dmesg
Created March 5, 2018 04:52
raspi after boot
[ 2.766152] usb 1-1.4: new low-speed USB device number 5 using dwc_otg
[ 2.910606] usb 1-1.4: New USB device found, idVendor=1241, idProduct=1111
[ 2.910617] usb 1-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.916233] fuse init (API version 7.26)
[ 2.932977] input: HID 1241:1111 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:1241:1111.0001/input/input0
[ 2.952501] hid-generic 0003:1241:1111.0001: input,hidraw0: USB HID v1.00 Mouse [HID 1241:1111] on usb-3f980000.usb-1.4/input0
@TheCase
TheCase / dev-input
Created March 5, 2018 04:53
after replug
pi@retropi:/dev/input $ tree /dev/input/
/dev/input/
|-- by-id
| |-- usb-1241_1111-event-mouse -> ../event7
| |-- usb-1241_1111-mouse -> ../mouse0
| |-- usb-Apple_Inc._Apple_Keyboard-event-if01 -> ../event6
| |-- usb-Apple_Inc._Apple_Keyboard-event-kbd -> ../event5
| |-- usb-XGaming_X-Arcade-event-kbd -> ../event0
| `-- usb-XGaming_X-Arcade-if01-event-kbd -> ../event1
|-- by-path
@TheCase
TheCase / _commands
Last active November 28, 2018 15:18
nomad sample
yum -y install python-setuptools unzip wget
easy_install pip
pip install supervisor
wget https://releases.hashicorp.com/consul/0.8.0/consul_0.8.0_linux_amd64.zip
unzip consul*.zip
mkdir -p /opt/consul/data
mv consul /opt/consul
@TheCase
TheCase / filebeats-remove_ansi_coloring.yaml
Last active November 30, 2023 08:53
Filbeats - remove ansi control characters for colored logs
- script:
when:
regexp:
message: "[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]"
lang: javascript
id: remove_ansi_color
source: >
function process(event) {
var msg = event.Get("message")
var regex = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g