Skip to content

Instantly share code, notes, and snippets.

@pgorczak
pgorczak / lte-transport-block-size.md
Last active August 2, 2019 17:45
LTE transport block size table in convenient json (Table 7.1.7.2.1-1 from 3GPP TS 36.213)

LTE transport block size

This is the lookup table linking the transport block size index (determined by modulation and coding scheme) and the number of resource blocks to an LTE transport block size. It's taken from 3GPP [TS 36.213][36.213] (Table 7.1.7.2.1-1) at version 15.0.0. Multiply a TBS by 1000 to get the max throughput in bps.

Heatmap of block sizes

@stringfellow
stringfellow / slinear vs linear
Last active September 7, 2018 11:52
linear & slinear interpolation of constant data
pandas slinear: [60.0, 60.0, 60.0, 60.0, 59.999999999999993, 60.0, 60.0, 60.0]
pandas linear: [60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0]
scipy slinear: [60.0, 60.0, 60.0, 60.0, 59.999999999999993, 60.0, 60.0, 60.0]
scipy linear: [60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0]
F
======================================================================
FAIL: Proof that linear and slinear are not equal.
----------------------------------------------------------------------
Traceback (most recent call last):
File "....", line 329, in test_slinear_versus_linear
@bxshi
bxshi / tmux_local_install.sh
Last active December 3, 2021 15:17 — forked from smsharma/ tmux_local_install.sh
Install tmux locally without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $INSTALL_DIR/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.3
@gyglim
gyglim / tensorboard_logging.py
Last active August 23, 2023 21:29
Logging to tensorboard without tensorflow operations. Uses manually generated summaries instead of summary ops
"""Simple example on how to log scalars and images to tensorboard without tensor ops.
License: BSD License 2.0
"""
__author__ = "Michael Gygli"
import tensorflow as tf
from StringIO import StringIO
import matplotlib.pyplot as plt
import numpy as np
@rbsgn
rbsgn / vlc-ios-upload.sh
Last active January 19, 2024 23:37
upload videos to VLC running on iOS device
IP=10.0.1.18
for f in *; do
echo ">>> Uploading $f <<<"
curl \
--progress-bar \
--form "files[]=@$f" \
http://"$IP"/upload.json \
| tee -a vlc-ios-upload.log; test ${PIPESTATUS[0]} -eq 0
if (-not ("Windows.Native.Kernel32" -as [type]))
{
Add-Type -TypeDefinition @"
namespace Windows.Native
{
using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
@trendels
trendels / rsync_daemon_over_ssh.md
Last active November 13, 2023 03:26
Rsync daemon mode over ssh

rsync daemon mode over ssh

There are several common ways to do rsync backups of hosts over ssh:

  1. As a non-root user. Upsides: very secure. Downside: cannot back up sensitive files.
  2. As root, with a public key. Downsides: Whoever has the private key has full root access to the host being backed up.
  3. As root, with a public key and a "forced command". Upsides: Restricts access to the server. Downsides: Requires either careful matching of rsync options (which might change over time), or "validator" scripts. Neither idea sounds very appealing to me.
  4. Running rsync in daemon mode on the host being backed up. Upsides: Lots of useful options, like read-only mode, running as a different user if required, server-side excludes/includes, etc. Downsides: Opens up a TCP port that has full filesystem read access and is hard to secure (Ideally you could make the rsync daemon use a unix socket instead, that could be secured by filesystem permissions, but I haven't found a way to do that).

Here is another option t

@timcharper
timcharper / evil-init.el
Last active October 24, 2015 12:34
Better evil word behavior
(defun forward-evil-word (&optional count)
""
(let ((init-point (point)))
(forward-symbol (or count 1))
(if (= (point) init-point)
count 0)))
(setq evil-symbol-word-search t)
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mattyo161
mattyo161 / ical-yearly-events.applescript
Created February 25, 2012 01:51
Applescript for getting list of yearly events from iCal
tell application "iCal"
set results to ""
set todaysDate to current date
repeat with a in every calendar
set results to results & return & (name of a)
tell a
set eventList to {}
repeat with b in every event
if (recurrence of b) = "FREQ=YEARLY;WKST=SU" then
set startDate to start date of b