Skip to content

Instantly share code, notes, and snippets.

Avatar
💪
never stop coding

Phlegx Systems OG phlegx

💪
never stop coding
View GitHub Profile
@phlegx
phlegx / UBLOX_AT_CellularNetwork.cpp
Last active Mar 17, 2022
Mbed OS 5.15.8: Add +UMNOPROF set option, set +URAT only if required and add third RAT to RAT list.
View UBLOX_AT_CellularNetwork.cpp
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 Mar 17, 2022
Mbed OS 5.15.8: Disable power save mode.
View UBLOX_AT.cpp
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 Oct 20, 2021
Mbed OS 5.15.7: Add wait on onboard modem deinit.
View onboard_modem_api.c
/* 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
View DirectUpload.vue
<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 Mar 17, 2022
Mbed OS 5.15.8: GPIO reset some pins at init.
View ublox_low_level_api.h
/* 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 Dec 9, 2020 — 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
View Ubuntu 18.04 setup.md

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.
View gist:e58b000ff9becff279af1033eea98a8c
curl -u elastic:xxxx localhost:9200/jt-metricbeat-staging-000003/_mapping | jq
{
"jt-metricbeat-staging-000003": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
View app-controllers-concerns-authenticable.rb
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
View HTTP.md
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"
View gist:db21c67b8dcaf6b55896df2f8a415e39
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')