Skip to content

Instantly share code, notes, and snippets.

@petedoyle
petedoyle / Make easier to read
Created December 30, 2010 23:57
BBB url creation
// CONFIG:
def apiBaseUrl = "http://conf.cotni.org/bigbluebutton/api" // no trailing '/' please
def salt = "26f31c52-6d4f-4562-b3c7-fd7857d191ac"
def phoneNumber = "360-536-4392" // the number to join the conference via phone
def meetingParams = [
name: 71000,
meetingID: 71000,
attendeePW: 7777,
moderatorPW: 8888,
@petedoyle
petedoyle / MainActivity.java
Created May 17, 2011 19:46
Sample android-support-v4-googlemaps MapFragment setup
public class MainActivity extends android.support.v4.app.FragmentActivity {
// Only one MapView instance is allowed per MapActivity,
// so we inflate it in the MainActivity and tie its
// lifetime here to the MainActivity. Package scope
// so we can grab them from different instances of map
// fragments.
//
// The other option was to make them static, but that causes
// memory leaks on screen rotation.
View mMapViewContainer;
@petedoyle
petedoyle / backup.sh
Created September 26, 2011 05:40
Early bash script to snapshot an entire ZFS pool (storage) and send|receive it to another pool (backups)
#!/bin/bash
# Capture current date as a variable
DATE=`date +"%Y%m%d-%H:%M:%S"` # example output format: 20110925-21:10:36
echo -e "\nRecursively snapshotting storage pool with tag @BACKUP_$DATE"
echo "Running 'zfs snapshot -r storage@BACKUP_$DATE'"
time zfs snapshot -r storage@BACKUP_$DATE
echo -e "\n\nDeleting backups pool to make way for new backup (usually takes a few minutes)."
@petedoyle
petedoyle / reader_tweaks.css
Created November 2, 2011 08:24
CSS Tweaks for new Google Reader
#top-bar {
height: auto;
}
#search {
padding: 8px 0;
}
#lhn-add-subscription-section {
height: 48px;
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style
name="Theme.MyTheme"
parent="android:style/Theme.Holo">
<!-- Setting windowNoTitle to true would turn off the ActionBar -->
<item name="android:windowNoTitle">false</item>
<item name="android:windowActionBar">true</item>
</style>
</resources>
@petedoyle
petedoyle / gist:2069845
Created March 18, 2012 08:08
Storm 3GB SSD - bonnie++ performance
Storm 3GB SSD instance
Filesystem: Ext3
----------------------
root@ssddb1:~# bonnie++ -d tmp -u root
...
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
ssddb1.local 5464M 1480 99 888791 77 281107 23 5919 98 608776 26 12463 111
Latency 5591us 55315us 72806us 4821us 89998us 2431us
@petedoyle
petedoyle / backup_postgres.sh
Created April 20, 2012 22:42
Backup postgres, upload to s3 using s3cmd
#!/bin/bash
if [ -z "$1" ]
then
FILENAME=pg_dumpall_$(date +"%Y%m%d-%H:%M:%S").sql.gz
else
FILENAME=$1
fi
FQ_FILENAME=/var/lib/pgsql/backups/$FILENAME
su -c "pg_dumpall | gzip -c > $FQ_FILENAME" postgres
@petedoyle
petedoyle / backup_postgres.sh
Created May 23, 2012 06:52
Postgres backup script
# Copyright 2012 Peter Doyle (petedoyle at gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# http://localhost:8080/v1/solution?solutionCategoryId=4942
select
this_.id as id3_1_,
this_.version as version3_1_,
this_.date_created as date3_3_1_,
this_.description as descript4_3_1_,
this_.import_source as import5_3_1_,
this_.import_source_collection_url as import6_3_1_,
this_.import_source_url as import7_3_1_,
this_.keywords as keywords3_1_,
@petedoyle
petedoyle / gist:4129668
Last active January 29, 2021 08:19
Notes: OpenWRT / Codel on TL-WDR4300

Overview

I'm tired of massive delay (500-1000 ms pings) while uploading large files. QoS helps some, but a significant portion remains due to bufferbloat (100-150ms). This leads to delay in VoIP calls and generally sluggish web browsing while uploading.

The new Codel algorithm in OpenWRT / Attitude Adjustment should help a lot. The results below show only ~5-6ms of added latency during uploads (i.e. 14ms vs 500+ms before!). Insane.

These instructions are for the TP-Link TL-WDR4300, because I got a good deal. If you have the money, buy a Netgear WNDR3800 and install CeroWRT, you'll probably see even better results.

Why the TP-Link TL-WDR4300

In short, its fully supported in OpenWRT Attitude Adjustment and works well for my needs:

  • Cheap