Skip to content

Instantly share code, notes, and snippets.

View exocode's full-sized avatar
🏠
Working from home

Jan exocode

🏠
Working from home
View GitHub Profile
@exocode
exocode / lectl.md
Created October 25, 2021 21:04
Check Letsencrypt rate limits on MacOS

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Now install coreutils (contains gdate) and gnu-sed (contains gsed) brew install coreutils gnu-sed

Create a dir for lectl, download the latest version (0.11) and modify variables _date and _sed to point to gdate and gsed (installed with brew)

cd ~
mkdir lectl
@exocode
exocode / gist:3145e38ba4b797666fba0abd3fef381d
Created March 26, 2021 15:18 — forked from kostia/gist:4075236
German synonyms for Elasticsearch
This file has been truncated, but you can view the full file.
80470 => 80470
ABC => ABC
ABM => ABM
ACL => ACL
ACPI => ACPI
ADAC => ADAC
ADSL => ADSL
AEG => AEG
AG => AG
AGP => AGP
brew install elasticsearch
brew services start elasticsearch
#try in browser http://localhost:9200/
####
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings -d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'
// Hook for localStorage
import { useState, useEffect } from 'react';
function useLocalStorageState(key, defaultValue) {
const [state, setState] = useState(() => {
let value;
try {
@exocode
exocode / Raspberry Pi autostart.md
Created January 3, 2021 19:59
All you need if you wanna use a Chrome Extension as your main app on Raspberry Pi. With these settings, RPI will start clean with a Chrome app in fullscreen

Autostart Apps in Chrome

  • sudo apt-get update
  • Open the local copy in /usr/share/applications (drag it over an open nano sudo nano ~/.local/share/applications/chromium-browser.desktop)
  • look for the first line, starting with Exec=. Replace the line by (in the case of "YOURNAME"):

Exec=chromium-browser --profile-directory="Default" %u

  • add mouse hide software sudo apt-get install unclutter
  • edit autostart file sudo nano /etc/xdg/lxsession/LXDE-pi/autostart:
@exocode
exocode / Cloudcone Wordpress installation.sh
Created January 3, 2021 19:56
Create Wordpress instance on Cloudcone
apt-get update && apt-get upgrade
# create user
useradd deploy
adduser deploy sudo # make user an admin
# restart ssh to make user active
sudo service ssh restart
# install nginx
@exocode
exocode / Quadcopter.md
Created January 3, 2021 19:55
My personal cheat sheet for UAV FPV and Betaflight. Everything you need!

Quadcopter and Betaflight cheat sheet

Introduction

On my yourney though hundreds of videos, tutorials and manuals (Bardwell, UAV Tech, JohnnyFPV, Mr. Steele, Le Drib, RotorRiot (sorry, for the missed ones) and wrote down their suggestions). This is the result of my notes. It should provide the least necessary but most compressed information to start tuning and setting your Quadcopter. In my case I use the widely spread Taranis X7 remote control.

I am a freestyle pilot, so keep in mind, that these settings are in this scope (more smooth, softer flight behaviour).

Remote Control (Taranis X7)

Create your own File:
~/Library/Preferences/Ableton/<Version/>/Options.txt
-ShowDevicesSlots # shows devices in mixer (button is on the right side )
-EnableMapToSiblings # adds a new dropdown if you wanna simultanious map values to Macros
-AutoAdjustMacroMappingRange # adjusts automatically current to Macro
-_PluginAutoPopulateTreshold=32 # automap plugin params / default 32 min 28-128 -1 is maxiumum
-NoVstStartupScan # scans only if you do this in preferences
-ThinningAggressiveness=0.6 # default 0.45 < glatter > feiner
@exocode
exocode / auth.js
Created February 12, 2020 12:05
If you have a Rails API using devise_token_auth and wanna connect your React app then use this snippet snippet for React apps. Someone posted a snippet, which I adapted: https://github.com/lynndylanhurley/redux-auth/issues/127#issuecomment-437891442
import { API_PROTOCOL, API_DOMAIN, headers } from './constants';
import { parseResponse, paramsToObject } from './parse';
const endpoints = {
signOutPath: '/auth/sign_out',
emailSignInPath: '/auth/sign_in',
emailRegistrationPath: '/auth',
accountUpdatePath: '/auth',
accountDeletePath: '/auth/cancel',
passwordResetPath: '/auth/password',