Skip to content

Instantly share code, notes, and snippets.

View karlicoss's full-sized avatar
🌴
🐰

karlicoss

🌴
🐰
View GitHub Profile
@fabian-thomas
fabian-thomas / orgzly-sync.sh
Last active May 28, 2024 19:45
Orgzly auto syncronisation for sync tools like syncthing. See orgzly/orgzly-android#8.
#!/data/data/com.termux/files/usr/bin/bash
# https://github.com/orgzly/orgzly-android/issues/8
orgzly_sync() {
# if you are using orgzly-revived use the following instead:
# am broadcast -n com.orgzlyrevived/com.orgzly.android.ActionReceiver -a com.orgzly.intent.action.SYNC_START
am broadcast -n com.orgzly/com.orgzly.android.ActionReceiver -a com.orgzly.intent.action.SYNC_START
}

Fix magisk stock backup does not exist

# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)

last edited on 2020-05-04 (please see edit history for changes)

See the results here: https://guzey.com/science/sleep/14-day-sleep-deprivation-self-experiment/


This is the protocol for my sleep experiment that I will start on 2020-04-03. I will sleep 4 hours per night for 2 weeks and evaluate the effects of doing so on my cognition using psychomotor vigilance task (essentially, a reaction test), SAT (a 3 hour test that involves reading and math), and Aimgod custom scenario I called guzey_arena_0 (video) (this is a first-person shooter trainer game that allows the creation of custom scenarios. The scenario I created requires constant attention, eye-hand coordination, tactical thinking).

Methods

@olejorgenb
olejorgenb / places-exploration.sql
Last active April 7, 2024 00:35
Firefox places.sqlite exploration (browser history)
--- Firefox places.sqlite exploration
-- https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Database
-- https://wiki.mozilla.org/images/d/d5/Places.sqlite.schema3.pdf
-- http://forensicswiki.org/wiki/Mozilla_Firefox_3_History_File_Format (probably somewhat outdated)
-- [select text -> right click -> search] does not set from_visit :(
-- Gotchas :angry-face: https://superuser.com/a/1405880/153095 (Explains why your history is incomplete)
@luqmaan
luqmaan / generate-systemd-schedule.js
Last active May 26, 2020 08:10
Script from my blog post "Using systemd as a better cron." https://medium.com/horrible-hacks/using-systemd-as-a-better-cron-a4023eea996d. ⚠️ It may not actually work. 🤷‍♂️
const fs = require("fs");
const getTimerTemplate = (platform, importType, interval) => `
[Unit]
Description=Run ${platform}-${importType} every 15 minutes
Requires=${platform}-${importType}.service
[Timer]
Unit=${platform}-${importType}.service
OnUnitInactiveSec=${interval}
@harperreed
harperreed / emfitqs-local-api.md
Created February 17, 2018 20:08
EMFIT QS Sleep tracker location API

EMFIT Local API

There is a functional http server running on the device that can be crawled for realtime data. It runs on port 80 and uses plain http.

You will need to know the IP address if your emfit device.

shortdvm.htm

For demoing / testing with a web browser there is an auto-refreshing page that contains only HR and RR values, it’s name is shortdvm.htm

# Demonstrate data download from Emfit API
# Config
remember_token="XXXXXXXX" # token returned from API login
device_id=666 # Your own device id number
from_date = "2017-01-01"
to_date = "2017-01-14"
# End of config
@Isk1n
Isk1n / index.html
Last active May 2, 2020 12:03
Plain text linkifiers comparison (work in progress) (http://jsbench.github.io/#54315d74264c857856c73f18c81278dc) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Plain text linkifiers comparison (work in progress)</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@hreeder
hreeder / parser.py
Last active February 27, 2024 03:53
Python nginx Log Parser
#!/usr/bin/env python
import gzip
import os
import sys
import re
INPUT_DIR = "nginx-logs"
lineformat = re.compile(r"""(?P<ipaddress>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?P<dateandtime>\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] ((\"(GET|POST) )(?P<url>.+)(http\/1\.1")) (?P<statuscode>\d{3}) (?P<bytessent>\d+) (["](?P<refferer>(\-)|(.+))["]) (["](?P<useragent>.+)["])""", re.IGNORECASE)