Skip to content

Instantly share code, notes, and snippets.

@gebi
gebi / AGPS.md
Created March 26, 2021 19:30 — forked from veproza/AGPS.md
Getting u-blox MAX-7C GPS to work with Assisted A-GPS

Getting u-blox MAX-7C GPS to work with Assisted A-GPS

So you got your u-blox GPS and wired it up only to look at it struggling to get a valid fix? Under less than ideal conditions, it can take a better part of half an hour. That's because unlike your smartphone GPS, it doesn't have the luxury of having downloaded all the auxiliary navigation data (almanacs and the lot) out-of-band, via fast mobile connection. Instead it relies on the satellite's signal itself, which is being transmitted to you at meager 50 bits per second (I'm not missing "kilo" there, it's three orders of magnitude slower than your 2G GPRS connection).

Luckily, the u-blox receivers are fitted with what the company calls "AssistNow" capability and it does exactly the same thing your iPhone does - feeds the GPS with pre-downloaded almanacs, speeding up the acquisition process to mere seconds.

In principle, the process looks easy enough - we just need to download the data, and then push them to the receiver. Sadly, the AssistNow documentat

@gebi
gebi / diskchecker.pl
Created March 5, 2021 14:59 — forked from bradfitz/diskchecker.pl
diskchecker.pl
#!/usr/bin/perl
#
# Brad's el-ghetto do-our-storage-stacks-lie?-script
#
sub usage {
die <<'END';
Usage: diskchecker.pl -s <server[:port]> verify <file>
diskchecker.pl -s <server[:port]> create <file> <size_in_MB>
diskchecker.pl -l [port]
@gebi
gebi / psql_internals_cheatsheet.sql
Created March 5, 2021 14:57 — forked from azet/psql_internals_cheatsheet.sql
PostgreSQL internals SQL collection
# long running queries:
SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
query,
state
FROM pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes';
## active queries and killing them:
@gebi
gebi / out.b
Created November 3, 2010 16:13
convert text to brainfuck
>++++++++[<++++++++>-]<-->
>++++++[<+++++++>-]<+>
,[[-<.>]<+++.---<.>>,]
@gebi
gebi / gitconfig
Created November 18, 2016 16:30
Git config
[alias]
a = annex
sf = svn fetch
sr = svn rebase
sd = svn dcommit
s = status
st = status
sb = show-branch
b = branch
c = clone
@gebi
gebi / google-chrome-anon
Created November 8, 2016 16:54
Start temporary google chrome instance
#!/bin/bash
tmp_=$(mktemp -d --tmpdir google-chrome-anon-XXXXXXXXXX)
echo "private dir: " $tmp_
trap "{ rm -rf /tmp/$(basename $tmp_); exit 255; }" EXIT
nice -n5 google-chrome --user-data-dir=$tmp_
@gebi
gebi / json_utils.go
Created July 30, 2013 19:52
http utils for protobuf/json
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"strconv"
)
@gebi
gebi / csv-test.go
Last active December 19, 2015 16:38
csv test progs in various languages
package main
import (
"encoding/csv"
"flag"
"fmt"
"io"
"os"
)
@gebi
gebi / static_mem_test.c
Last active December 16, 2015 18:59
Short example program to show linux memory allocation behaviour (memory is only allocated on first access, in this example program after you press enter) Test with: gcc -O0 -Wall static_mem_test.c -o static_mem_test && /usr/bin/time --verbose ./static_mem_test
#include <unistd.h>
static char staticfoo[80*1024*1024]; // = {"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"};
#define WRITE(Str) write(1, Str, sizeof(Str))
int main()
{
char in;
int i;
package main
import (
"os"
"fmt"
"log"
"strconv"
"github.com/cznic/mathutil"
)