Skip to content

Instantly share code, notes, and snippets.

View phlegx's full-sized avatar
💪
never stop coding

Phlegx Systems phlegx

💪
never stop coding
View GitHub Profile
@phlegx
phlegx / UBLOX_AT_CellularNetwork.cpp
Last active March 17, 2022 12:30
Mbed OS 5.15.8: Add +UMNOPROF set option, set +URAT only if required and add third RAT to RAT list.
nsapi_error_t UBLOX_AT_CellularNetwork::set_access_technology_impl(RadioAccessTechnology opRat)
{
nsapi_error_t ret = NSAPI_ERROR_OK;
CellularNetwork::AttachStatus status;
get_attach(status);
if (status == Attached) {
tr_debug("RAT should only be set in detached state");
return NSAPI_ERROR_UNSUPPORTED;
}
@phlegx
phlegx / UBLOX_AT.cpp
Last active March 17, 2022 12:30
Mbed OS 5.15.8: Disable power save mode.
nsapi_error_t UBLOX_AT::init()
{
setup_at_handler();
_at->lock();
_at->flush();
_at->at_cmd_discard("", "");
nsapi_error_t err = NSAPI_ERROR_OK;
@phlegx
phlegx / onboard_modem_api.c
Last active October 20, 2021 12:01
Mbed OS 5.15.7: Add wait on onboard modem deinit.
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
<template lang='pug'>
div.drop-zone(:class='{dragging: isDragging }'
@dragover.prevent='dragover'
@dragenter.prevent='dragover'
@drop.prevent.stop='onDrop'
@dragleave.prevent='dragleave')
div(:class='{ hidden: uploadInProgress }' @click='openFileBrowser')
slot
i {{label}}
input(type='file' :multiple='multiple' ref='input' style='display: none')
@phlegx
phlegx / ublox_low_level_api.h
Last active March 17, 2022 12:30
Mbed OS 5.15.8: GPIO reset some pins at init.
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@phlegx
phlegx / Ubuntu 18.04 setup.md
Created December 9, 2020 20:31 — forked from labbots/Ubuntu 18.04 setup.md
Ubuntu 18.04 Manual partitioning setup with LUKS encryption and LVM - https://labbots.com/ubuntu-18-04-installation-with-luks-and-lvm

Ubuntu 18.04 installation with LUKS and LVM

Installation Process

Pre-installation from live OS

This setup of Ubuntu with LUKS and LVM is tested on Ubuntu 18.04.

Boot Ubuntu from a Live OS and select the option to try Ubuntu without installing. Follow the steps I've outlined below. Let's assume you're installing to /dev/nvme0n1.

  1. Partition the drive with your tool of choice: I used gparted to set mine up.
curl -u elastic:xxxx localhost:9200/jt-metricbeat-staging-000003/_mapping | jq
{
"jt-metricbeat-staging-000003": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
module Authenticable
extend ActiveSupport::Concern
# Filter to use with before_action
def authenticate_user
jwt_token
rescue JWT::DecodeError => e
render json: { error: e.message }, status: :unauthorized
end
POST /oauth/token HTTP/1.1
Content-Type: application/json

{
  "grant_type": "password",
  "client_id": "CLIENT_ID",
  "owner_type": "OWNER_TYPE",
  "username": "OWNER_EMAIL",
 "password": "OWNER_PASSWORD"
ag POSTGRES
sentry.conf.py
5:# SENTRY_POSTGRES_HOST
6:# SENTRY_POSTGRES_PORT
43:postgres = env('SENTRY_POSTGRES_HOST') or (env('POSTGRES_PORT_5432_TCP_ADDR') and 'postgres')
50: or env('POSTGRES_ENV_POSTGRES_USER')
55: or env('POSTGRES_ENV_POSTGRES_USER')
60: or env('POSTGRES_ENV_POSTGRES_PASSWORD')
65: env('SENTRY_POSTGRES_PORT')