0

Set Simple Queue Burst Rates

by Jim Bouse 30. September 2012 19:56

I have a Mikrotik router as my bandwidth limiter for my ISP.  I use Simple Queues for each IP to assign them to a speed.  I recently decided to be nice and add bursting to the plans.  I decided that the customers would get 2X their purchased speed for 16 seconds (a standard time window).  Since I had about 100 IPs and Simple Queues, I defanately did not want to manually add bursting to my Simple Queues.  I wrote the following script.  It will loop through all your simple queues and add the 2X burst amount.

You can download the .txt here in case the formatting gets screwed up. - setSimpleQueueBurst.txt (1.46 kb)

:local rate
:local inboundrate
:local outboundrate
:local inboundburstrate
:local outboundburstrate
:local inboundburstthreshold
:local outboundburstthreshold
:local ip
 
/queue simple
:foreach i in=[find] do={
  :set ip [get $i target-addresses]
  :set rate [get $i max-limit]
  :set inboundrate [:pick $rate ([:find $rate "/"]+1) 999 ]
  :if ([:find [:tostr $inboundrate] "k" ] > 0) do={
    :set inboundrate ([:pick $inboundrate 0 [:find [:tostr $inboundrate] "k" ]]*1000)
  }
  :if ([:find [:tostr $inboundrate] "M" ] > 0) do={
    :set inboundrate ([:pick $inboundrate 0 [:find [:tostr $inboundrate] "M" ]]*1000000)
  }
  :set outboundrate [:pick $rate 0 ([:find $rate "/"]+1)]
  :if ([:find [:tostr $outboundrate] "k" ] > 0) do={
    :set outboundrate ([:pick $outboundrate 0 [:find [:tostr $outboundrate] "k" ]]*1000)
  }
  :if ([:find [:tostr $outboundrate] "M" ] > 0) do={
    :set outboundrate ([:pick $outboundrate 0 [:find [:tostr $outboundrate] "M" ]]*1000000)
  }
  :set inboundburstrate ($inboundrate*2)
  :set outboundburstrate ($outboundrate*2)
  :set outboundburstthreshold ($outboundrate*2)
  :set inboundburstthreshold ($inboundrate*2)
  :set inboundrate ($inboundrate/5)
  :set outboundrate ($outboundrate/5)
  
  set $i limit-at="$outboundrate/$inboundrate" burst-time="16s/16s" burst-threshold="$outboundburstthreshold/$inboundburstthreshold" burst-limit="$outboundburstrate/$inboundburstrate"
  :put "Set $ip simple queue burst."
 
}

Tags: , ,

Mikrotik | WISP

0

Even Easier UBNT AirCam Snapshot

by Jim Bouse 28. August 2012 21:09

SSH into the unit.

Run:

mkdir /etc/persistent/www ; ln -s /tmp/snap.jpeg /etc/persistent/www/logo.gif ; save

View Image: http://device.address/images/logo.gif

Note: the image is only 640x480

Tags:

0

Low Cost Outdoor UPS

by Jim Bouse 30. July 2012 16:24

I own a small WISP and need an UPS in a small enclosure at the bottom of my towers to provide temporary power for when the grid drops for a few minutes/hours.

This is often coupled with a multi-port POE injector from Wifi-Soft and a router for a WISP tower location.

This comes to $387 for an outdoor UPS with a run time of about 8 hours without power for 2 - 8 watt radios and a RouterBoard.

Here is a similar version of what I have described.



Tags: , , , , ,

Mikrotik | Ubiquiti | WISP

0

Capture full resolution snapshot from UBNT AirCam with PHP and FFMPEG

by Jim Bouse 16. May 2012 08:42
<?php
system("ffmpeg -i rtsp://username:password@10.0.0.1/live/ch00_0 -y -f image2 -sameq -t 0.001 /path/to/warehouse.jpg");

header( "Content-type: image/jpeg" );
@readfile("/path/to/warehouse.jpg");
?>

Originally posted: http://forum.ubnt.com/showpost.php?p=299673&postcount=1

Tags:

Ubiquiti

0

Revert PicoM2 from UniFi to AirOS

by Jim Bouse 15. May 2012 13:46

A person posted this tool on the UBNT.com forums.

The original host is/was http://www.voyagerwireless.com/ubnt/UniFi2AirOS.bin.  I have uploaded it here to make sure it is available when I need it.

UniFi2AirOS.bin (6.78 mb)

Tags:

0

Find Who Has Locked ArcSDE Database

by Jim Bouse 4. May 2012 14:54
select start_time, owner, nodename from SDE_process_information where sde_id in (
select sde_id from SDE_table_locks where registration_id = (
select registration_id from SDE_table_registry where table_name = 'Streets'
)
);

Tags:

0

Multiple SSID with UBNT AP's

by Jim Bouse 28. March 2012 14:00

Tags:

0

Reset UBNT Device to Default via SSH

by Jim Bouse 28. March 2012 11:28

NOTICE! This resets it to default (factory).  If you want to just reboot, use "reboot".

cp /usr/etc/system.cfg /tmp/system.cfg; save; reboot

Tags:

Ubiquiti

0

Mikrotik Simple Queue Script

by Jim Bouse 24. February 2012 11:48

I needed to be able to create simple queues for the /27 I got from my upstream provider.  I wanted to do this with a script instead of typing by hand and perhaps creating a typo.

  • /queue simple add name="Purchased Bandwith" max-limit=10M/10M
  • :for x from=130 to=158 do={/queue simple add name="216.xxx.70.$x" target-addresses="216.xxx.70.$x" parent="Purchased Bandwith" max-limit=384k/1M }

Tags:

Mikrotik

0

PowerShell - Disable user access to mailbox while still alllowing mailbox to function.

by Jim Bouse 9. November 2011 15:47

After I migrated my hundreds of users, I had some that were refusing to quit using the old webmail address.  We were retiring the URL and therefore we couldn't just stick it on the new OWA server.  To fix this, I disabled ActiveSync (for phones), OWA, and MAPI (for Outlook).

The code is as follows:

Get-Mailbox -OrganizationalUnit "Some OU" -DomainController "Some DC" | Set-CASMailbox -OWAEnable:$false -ActiveSyncEnabled:$false -MAPIEnabled:$false

A few days after this change, a couple of the stragglers relunctantly started using the new OWA.... and liked it. 

Tags: , , , ,

PowerShell

Powered by BlogEngine.NET 2.5.0.6
Original Design by Laptop Geek, Adapted by onesoft