Skip to content

Instantly share code, notes, and snippets.

@ebeigarts
ebeigarts / mikrotik-chateau-cell-lock.txt
Created August 28, 2021 18:00 — forked from mrskug/mikrotik-chateau-cell-lock.txt
Mikrotik Chateau LTE cell lock described. Saved for posterity, in case forum post gets deleted.
https://forums.quectel.com/t/eg12-and-freq-or-cell-lock-feature/4619
thanks.
After many test I discover all stuff.
This is example at RouterBoard Chateau, RouterOS 7 beta 8
Quectel EG12 not support frequency lock to select band at any tower.
Quectel EG12 support one and many Cell Lock’s, you can enter max 20 of CellLock’s and it select the one with the best signal and set it as primary-band.
@mcdougal
mcdougal / _error.js
Created September 28, 2018 11:53
Using @sentry/browser with Next.js for client and server-side rendering
import * as Sentry from '@sentry/browser';
import getConfig from 'next/config';
import React from 'react';
const { SENTRY_DSN } = getConfig().publicRuntimeConfig;
Sentry.init({ dsn: SENTRY_DSN });
/**
* Send an error event to Sentry.
@yyscamper
yyscamper / parseFloat.go
Created August 2, 2017 06:59
An advance ParseFloat for golang, support scientific notation, comma separated number
package main
import (
"fmt"
"math"
"strconv"
"strings"
)
func ParseFloat(str string) (float64, error) {
@dopey
dopey / main.go
Last active April 13, 2024 08:07 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@bussiere
bussiere / compress.go
Created December 22, 2016 01:16
compress uncompress a string in golang
package main
import (
"bytes"
"compress/gzip"
"fmt"
"encoding/base64"
"io/ioutil"
)
package main
import (
"fmt"
"time"
"github.com/bluele/factory-go/factory"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
)
@nickretallack
nickretallack / env.py
Last active March 16, 2023 20:57
How to run multi-tenant migrations in alembic.
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool, MetaData, Table, ForeignKeyConstraint
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
@mlavin
mlavin / NOTES.rst
Created September 23, 2013 14:17
Celery Late Ack Example

Running the Example

Start the worker:

celery -A tasks worker --loglevel=info -c 2 --pidfile=celery.pid

In another terminal send 6 tasks:

python script.py
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@wjlroe
wjlroe / README.md
Created November 20, 2012 17:16
JSON API -> CSV

Howto download a JSON API array and spit out a CSV

Tools needed

  • httpie -- easy_install httpie (probably you want to sudo easy_install httpie
  • this script -- curl -o /usr/local/bin/json-to-csv.py https://raw.github.com/gist/4119347/24adb5dcd9c025c272042653a70d25b73b485958/json-to-csv.py
  • make that executable -- chmod +x /usr/local/bin/json-to-csv.py

Here we go