Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
import logging | |
HEADER_FMT = "Call stack at %s, line %d in function %s, frames %d to %d of %d:" | |
"""The log header message formatter.""" | |
STACK_FMT = "%s, line %d in function %s." | |
"""The log stack message formatter.""" | |
def log_stack(logger=None, limit=None, start=0): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Written by Frans Rosén (twitter.com/fransrosen) | |
_debug="$2" #turn on debug | |
_timeout="20" | |
#you need a valid key, since the errors happens after it validates that the key exist. we do not need the secret key, only access key | |
_aws_key="AKIA..." | |
H_ACCEPT="accept-language: en-US,en;q=0.9,sv;q=0.8,zh-TW;q=0.7,zh;q=0.6,fi;q=0.5,it;q=0.4,de;q=0.3" | |
H_AGENT="user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidycensus) | |
library(tigris) | |
library(tidyverse) | |
library(sf) | |
library(ggiraph) | |
library(patchwork) | |
options(tigris_use_cache = TRUE) | |
set.seed(123456) | |
# Get a list of counties within the Austin CBSA using tigris |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Low battery level detection & notification for all battery sensors | |
description: Regularly test all sensors with 'battery' device-class for crossing | |
a certain battery level threshold and if so execute an action. | |
domain: automation | |
input: | |
threshold: | |
name: Battery warning level threshold | |
description: Battery sensors below threshold are assumed to be low-battery (as | |
well as binary battery sensors with value 'on'). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
More recent resolution: | |
1. cd ~/../../etc (go to etc folder in WSL). | |
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
5. cd ~/../../etc (go to etc folder in WSL). | |
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
secondary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit | |
# Copyright (c) 2021 Marat Reymers | |
## Golden config for golangci-lint v1.57.2 | |
# | |
# This is the best config for golangci-lint based on my experience and opinion. | |
# It is very strict, but not extremely strict. | |
# Feel free to adapt and change it for your needs. | |
run: |
Notes for software engineering meeting presentation
- mid to late 2000s: appearance of Document stores / NoSQL databases such as Mongo, Couch
- Relational DBs now have support for document data: JSON in MySQL, JSON and JSONB in PostgreSQL
- Focus on JSONB in Postgres (most full featured)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install bluealsa to create interface to Bluetooth device | |
git clone https://github.com/Arkq/bluez-alsa.git | |
cd bluez-alsa | |
su | |
apt-get install libglib2.0-dev -y | |
apt-get install -y libasound2-dev | |
apt install -y build-essential autoconf | |
apt-get install -y libbluetooth-dev | |
apt-get install libtool -y |
NewerOlder