Tuesday, February 10, 2015

bsdgame trek

finally sit down to read the source and understood that the direction to move/shot is in degrees with 0 being North

here is my only session of trek that actually ended without me rage quiting.

$ trek

   * * *   S T A R   T R E K   * * *

Press return to continue.

What length game: s
What skill game: n
Enter a password: really?
5 Klingons
4 starbases at 7,0, 3,4, 6,5, 4,5
It takes 250 units to kill a Klingon

Command: lr
Long range scan for quadrant 7,0

           0     1
  -------------------
6 !  *  !   5 !   1 !
  -------------------
7 !  *  !  13 !   8 !
  -------------------
  !  *  !  *  !  *  !
  -------------------

Command: co

Request: ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ... ... ... ... ... ... ... ... 0
1 ... ... ... ... ... ... ... ... 1
2 ... ... ... ... ... ... ... ... 2
3 ... ... ... ... .1. ... ... ... 3
4 ... ... ... ... ... .1. ... ... 4
5 ... ... ... ... ... ... ... ... 5
6   5   1 ... ... ... .1. ... ... 6
7 $$$   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: m
Course: 270
Distance: 2
Computer applies full reverse power to avoid hitting the
   negative energy barrier.  A space warp was entered.

Uhura: Captain, Starfleet Command reports a supernova
  in quadrant 0,5.  Caution is advised
You are now in quadrant 2,1.  It is stardate 2200.68

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ... ... ... ... ... /// ... ... 0
1 ... ... ... ... ... ... ... ... 1
2 ... $$$ ... ... ... ... ... ... 2
3 ... ... ... ... .1. ... ... ... 3
4 ... ... ... ... ... .1. ... ... 4
5 ... ... ... ... ... ... ... ... 5
6   5   1 ... ... ... .1. ... ... 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: lr
Long range scan for quadrant 2,1

     0     1     2
  -------------------
1 !   4 !   3 !   3 !
  -------------------
2 !   4 !   7 !   1 !
  -------------------
3 !   2 !   8 !   3 !
  -------------------

Command: m
Course: 90
Distance: 1

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ... ... ... ... ... /// ... ... 0
1   4   3   3 ... ... ... ... ... 1
2   4   7 $$$ ... ... ... ... ... 2
3   2   8   3 ... .1. ... ... ... 3
4 ... ... ... ... ... .1. ... ... 4
5 ... ... ... ... ... ... ... ... 5
6   5   1 ... ... ... .1. ... ... 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: lr
Long range scan for quadrant 2,2

     1     2     3
  -------------------
1 !   3 !   3 !   5 !
  -------------------
2 !   7 !   1 !   2 !
  -------------------
3 !   8 !   3 !   7 !
  -------------------

Command: m 0 1

Command: lr
Long range scan for quadrant 1,2

     1     2     3
  -------------------
0 !   9 !   9 !   6 !
  -------------------
1 !   3 !   3 !   5 !
  -------------------
2 !   7 !   1 !   2 !
  -------------------

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ...   9   9   6 ... /// ... ... 0
1   4   3 $$$   5 ... ... ... ... 1
2   4   7   1   2 ... ... ... ... 2
3   2   8   3   7 .1. ... ... ... 3
4 ... ... ... ... ... .1. ... ... 4
5 ... ... ... ... ... ... ... ... 5
6   5   1 ... ... ... .1. ... ... 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: m 90 3

Uhura: Captain, Starfleet Command reports a supernova
  in quadrant 1,3.  Caution is advised

Command: lr
Long range scan for quadrant 1,5

     4     5     6
  -------------------
0 !   3 ! /// !   9 !
  -------------------
1 !   7 !   7 !   8 !
  -------------------
2 !   9 !   7 !   9 !
  -------------------

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ...   9   9   6   3 ///   9 ... 0
1   4   3   3 ///   7 $$$   8 ... 1
2   4   7   1   2   9   7   9 ... 2
3   2   8   3   7 .1. ... ... ... 3
4 ... ... ... ... ... .1. ... ... 4
5 ... ... ... ... ... ... ... ... 5
6   5   1 ... ... ... .1. ... ... 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: m
Course: 180
Distance: 3

Command: lr
Long range scan for quadrant 4,5

     4     5     6
  -------------------
3 !  13 !   9 !   7 !
  -------------------
4 !   1 !  12 ! 104 !
  -------------------
5 !   8 !   9 !   4 !
  -------------------

Command: m 90 1
Condition RED

Stardate 2205.08: Klingon attack:
HIT: 90 units from 2,8, shields absorb 100%, effective hit 0

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . . . . . 0   stardate      2205.08
1 . . . . . . . . . . 1   condition     RED
2 . . * @ . . . . K . 2   position      4,6/5,7
3 . . . . .   . . . . 3   warp factor   5.0
4 . . . . . . . . . . 4   total energy  3333
5 . . . . . . . E . . 5   torpedoes     10
6 . . . . . . . . . . 6   shields       up, 94%
7 . . . . . .   . * . 7   Klingons left 5
8 . . . . * . . . . . 8   time left     2.92
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9
Starsystem Arachnid I

Command: to
Torpedo course: 10
Do you want a burst: n
Torpedo track:
   5.5   7.5
   4.5   7.7
   3.5   7.9
   2.5   8.0
   *** Klingon at 2,8 destroyed ***

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . . . . . 0   stardate      2205.08
1 . . . . . . . . . . 1   condition     GREEN
2 . . * @ . . . . . . 2   position      4,6/5,7
3 . . . . .   . . . . 3   warp factor   5.0
4 . . . . . . . . . . 4   total energy  3333
5 . . . . . . . E . . 5   torpedoes     9
6 . . . . . . . . . . 6   shields       up, 94%
7 . . . . . .   . * . 7   Klingons left 4
8 . . . . * . . . . . 8   time left     3.65
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9
Starsystem Arachnid I

Command: lr
Long range scan for quadrant 4,6

     5     6     7
  -------------------
3 !   9 !   7 !   8 !
  -------------------
4 !  12 !   4 !   1 !
  -------------------
5 !   9 !   4 ! 203 !
  -------------------

Command: m 135 1
Condition RED
Klingon at 5,3 escapes to quadrant 5,6

Stardate 2205.48: Klingon attack:
HIT: 68 units from 7,7, shields absorb 94%, effective hit 4

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . . . . . 0   stardate      2205.48
1 . . . . . . . . . . 1   condition     RED
2 . . . . E . . . . . 2   position      5,7/2,4
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . . . . . . . 4   total energy  3226
5 . . . . . . . @ . . 5   torpedoes     9
6 . . . . . . . . . . 6   shields       up, 90%
7 . . . . . * . K * . 7   Klingons left 4
8 . . . . . . . . . . 8   time left     3.25
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9
Starsystem Echo IV

Command: ph
Sulu: Captain, we cannot fire through shields.

Command: sh down

Stardate 2205.48: Klingon attack:
HIT: 53 units from 7,7, shields absorb 45%, effective hit 29
Klingon at 7,7 escapes to quadrant 4,7

Command: lr
Long range scan for quadrant 5,7

     6     7     
  -------------------
4 !   4 ! 101 !  *  !
  -------------------
5 ! 104 !   3 !  *  !
  -------------------
6 !   5 !   7 !  *  !
  -------------------

Command: m 0 1
Condition RED
Shields are down.  Do you want them up: no

Stardate 2205.88: Klingon attack:
HIT: 82 units from 6,5

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . . . . . 0   stardate      2205.88
1 . . . . . . . . . . 1   condition     RED
2 . . . . E . . . . . 2   position      4,7/2,4
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . . . . . . . 4   total energy  3138
5 . . . . . . . . . . 5   torpedoes     9
6 . . . . . K . . . . 6   shields       down, 89%
7 . . . . . . . . . . 7   Klingons left 4
8 . . . . . . . * . . 8   time left     2.85
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: ph 150
invalid input; ? for valid inputs
Manual or automatic: au
Phasers locked on target.  3138 units available
Units to fire: 800

Phaser bank 0 fires:
550 unit hit on Klingon at 6,5
   *** Klingon at 6,5 destroyed ***

250 units expended on empty space

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ...   9   9   6   3 ///   9 ... 0
1   4   3   3 ///   7   7   8 ... 1
2   4   7   1   2   9   7   9 ... 2
3   2   8   3   7  13   9   7   8 3
4 ... ... ... ...   1  12   4 $$$ 4
5 ... ... ... ...   8   9 104   3 5
6   5   1 ... ... ... .1.   5   7 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: m 210 1
Condition RED
Shields are down.  Do you want them up: y

Stardate 2206.28: Klingon attack:
HIT: 41 units from 9,1, shields absorb 39%, effective hit 25

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . . . . . 0   stardate      2206.28
1 . . . . . . . . . E 1   condition     RED
2 . . . . . . . . . * 2   position      5,6/1,9
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . . * . . . . 4   total energy  2249
5 . . . . . . . . . . 5   torpedoes     9
6 . * . . . . . . . . 6   shields       up, 89%
7 . . . * . . . . . . 7   Klingons left 3
8 . . . . . . . . . . 8   time left     3.40
9 . K . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: 180+45
invalid input; ? for valid inputs

Command: to 225
Do you want a burst: y
burst angle: -1

Command: to 225
Do you want a burst: n
Torpedo track:
   1.5   9.5
   2.5   8.8
   3.5   8.0
   4.5   7.3
   5.5   6.6
   6.5   5.9
   7.5   5.1
   8.5   4.4
   9.5   3.7
Torpedo missed

Stardate 2206.28: Klingon attack:
HIT: 36 units from 9,1, shields absorb 88%, effective hit 4
Klingon at 9,1 escapes to quadrant 5,5

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . . . . . 0   stardate      2206.28
1 . . . . . . . . . E 1   condition     GREEN
2 . . . . . . . . . * 2   position      5,6/1,9
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . . * . . . . 4   total energy  2245
5 . . . . . . . . . . 5   torpedoes     8
6 . * . . . . . . . . 6   shields       up, 87%
7 . . . * . . . . . . 7   Klingons left 3
8 . . . . . . . . . . 8   time left     3.40
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ...   9   9   6   3 ///   9 ... 0
1   4   3   3 ///   7   7   8 ... 1
2   4   7   1   2   9   7   9 ... 2
3   2   8   3   7  13   9   7   8 3
4 ... ... ... ...   1  12   4   1 4
5 ... ... ... ...   8 109 $$$   3 5
6   5   1 ... ... ... .1.   5   7 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: m
Course: 270 1
Condition RED

Stardate 2206.68: Klingon attack:
HIT: 45 units from 9,3, shields absorb 86%, effective hit 6

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . * * . . . . . * . 0   stardate      2206.68
1 . . . . . . . . . E 1   condition     RED
2 . . . . . * . . . . 2   position      5,5/1,9
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . . . . . . * 4   total energy  2220
5 * . . . .   . . . * 5   torpedoes     8
6 . . . . . . . . . * 6   shields       up, 85%
7 . . . . . * . . . . 7   Klingons left 3
8 . . . . . . . . . . 8   time left     3.00
9 . . . K . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: t 225 no
Torpedo track:
   1.5   9.5
   2.5   8.5
   3.5   7.6
   4.5   6.6
   5.5   5.6
Torpedo disappears into a black hole

Stardate 2206.68: Klingon attack:
HIT: 36 units from 9,3, shields absorb 83%, effective hit 6

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . * * . . . . . * . 0   stardate      2206.68
1 . . . . . . . . . E 1   condition     RED
2 . . . . . * . . . . 2   position      5,5/1,9
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . . . . . . * 4   total energy  2214
5 * . . . .   . . . * 5   torpedoes     7
6 . . . . . . . . . * 6   shields       up, 83%
7 . . . . . * . . . . 7   Klingons left 3
8 . . . . . . . . . . 8   time left     3.00
9 . . . K . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: m 270 .6

Stardate 2206.92: Klingon attack:
HIT: 34 units from 9,3, shields absorb 82%, effective hit 6
Klingon at 9,3 moves to 1,1

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . * * . . . . . * . 0   stardate      2206.92
1 . K . E . . . . . . 1   condition     RED
2 . . . . . * . . . . 2   position      5,5/1,3
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . . . . . . * 4   total energy  2195
5 * . . . .   . . . * 5   torpedoes     7
6 . . . . . . . . . * 6   shields       up, 82%
7 . . . . . * . . . . 7   Klingons left 3
8 . . . . . . . . . . 8   time left     2.76
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: t 270
Do you want a burst: n
Torpedo track:
   1.5   3.5
   1.3   2.5
   1.1   1.5
   *** Klingon at 1,1 destroyed ***

Command: lr
Long range scan for quadrant 5,5

     4     5     6
  -------------------
4 !   1 !  12 !   4 !
  -------------------
5 !   8 !   9 !   4 !
  -------------------
6 !   6 !  13 !   5 !
  -------------------

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ...   9   9   6   3 ///   9 ... 0
1   4   3   3 ///   7   7   8 ... 1
2   4   7   1   2   9   7   9 ... 2
3   2   8   3   7  13   9   7   8 3
4 ... ... ... ...   1  12   4   1 4
5 ... ... ... ...   8 $$$   4   3 5
6   5   1 ... ...   6  13   5   7 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: m 270 2

Command: lr
Long range scan for quadrant 5,3

     2     3     4
  -------------------
4 !   9 !   9 !   1 !
  -------------------
5 !   9 !   4 !   8 !
  -------------------
6 !   6 !   4 !   6 !
  -------------------

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . . . . * 0   stardate      2207.72
1 . . . E . .   . . . 1   condition     GREEN
2 . . . . . . . . . . 2   position      5,3/1,3
3 . . . . . . . . . . 3   warp factor   5.0
4 . . . . * . . . . . 4   total energy  2183
5 . . . . . . . . . . 5   torpedoes     6
6 . . . . . . * . . . 6   shields       up, 84%
7 . . . . . . . . . * 7   Klingons left 2
8 . . . . . . . . . . 8   time left     3.34
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: co ch
Computer record of galaxy for all long range sensor scans

  -0- -1- -2- -3- -4- -5- -6- -7-
0 ...   9   9   6   3 ///   9 ... 0
1   4   3   3 ///   7   7   8 ... 1
2   4   7   1   2   9   7   9 ... 2
3   2   8   3   7  13   9   7   8 3
4 ... ...   9   9   1  12   4   1 4
5 ... ...   9 $$$   8   9   4   3 5
6   5   1   6   4   6  13   5   7 6
7  13   8 ... ... ... ... ... ... 7
  -0- -1- -2- -3- -4- -5- -6- -7-

Command: m 270 2
Condition RED

Stardate 2208.30: Klingon attack:
HIT: 100 units from 0,7, shields absorb 86%, effective hit 14
HIT: 91 units from 0,6, shields absorb 80%, effective hit 18

Command: sr

Short range sensor scan
  0 1 2 3 4 5 6 7 8 9
0 . . . . . . K K . . 0   stardate      2208.30
1 . . . . . . . . . E 1   condition     RED
2 . . . . . . . . . . 2   position      5,1/1,9
3 * . . . . . . . . . 3   warp factor   5.0
4 . . . . . . . . . . 4   total energy  2136
5 . . . . . . . . . . 5   torpedoes     6
6 . . . . . . . . . . 6   shields       up, 75%
7 . . . . . . . . . . 7   Klingons left 2
8 . . . . . . . . . . 8   time left     2.76
9 . . . . . . . . . . 9   life support  active
  0 1 2 3 4 5 6 7 8 9

Command: to
Torpedo course: 300
Do you want a burst: y
burst angle: 10
Torpedo track, torpedo number 1:
   1.5   9.5
   1.0   8.5
   0.4   7.5
   *** Klingon at 0,7 destroyed ***
Torpedo track, torpedo number 2:
   1.5   9.5
   0.7   8.5
Torpedo missed
Torpedo track, torpedo number 3:
   1.5   9.5
   1.2   8.5
   0.8   7.5
   0.5   6.5
   *** Klingon at 0,6 destroyed ***

Congratulations, you have saved the Federation

*** Your score:
5 Klingons killed                          310
Kill rate 0.60 Klingons/stardate           241
Bonus for winning a novice game            100

***  TOTAL                                 651
Another game: 

Sunday, February 24, 2013

sata UMS

have to buy some disposable HDD for my mythtv cache... with the high prices of HDD i will buy one of those fancy usb3 enclosures, use the 1TB HDD that comes inside, and keep the usb3<->sata converter to use as a sata dock.

first, is it worth?

- the cheapest 1TB 3.5" drive goes from $75 to $200.
- usb3.0 enclosures with 1TB drivers goes from $69 to $140. averaging $80.

So, Price does checkout. it's even better than buying the bulky 3.5" drive!

- all regular HDD are 7500RPM, sata2-6gb/s, and have 32Mb~64Mb or cache.
- all usb3 enclosures are 5400RPM, sata2-6gb/s (counting the internal drive) and have 8mb~16mb of cache

The cache (32 vs 8mb) may make a big difference on accessing recently written files and random access of cached data. I do not expect to have such use case using the HDD as a mythtv cache disk. Also, performance of the regular drive is around 100Mb/s on sustained read and writes. the same reported over usb3 for the other drives. in fact, the same as reported on usb2 as well. the drive is the culprit.

7kRPM vs 5kRPM may make a difference in some cases, but again, for a mythtv cache writting/reading low bandwidth MPEG2 video steams, not the case.

So, performance does checkout.


Product options

Seagate Backup Plus 1TB USB 3.0 Blue Portable Hard Drive STBU1000102

$89
sata drive inside! yes. seagate.
usb2 ready: no.
easy to open: yes/no. the sata USM connector pop's out easily and by design. but the actual HDD enclosure does not open at all.

HGST Touro Mobile 1TB USB 3.0 External Hard Drive, Black (HTOLMX3NA10001ABB)

$81 
sata drive inside! yes. Hitachi/WD
usb 2 ready? no idea.
easy to open: no.

Toshiba Canvio 1.0 TB USB 3.0 Basics Portable Hard Drive - HDTB110XK3BA

$69 (also 1.5TB $103)
sata drive inside! yes. hitachi (hitachi 2.5" are made by WD, but this is branded Toshiba, why?)

Transcend Information 1 TB USB 3.0 External Hard Drive - Military Drop Standards (TS1TSJ25M3)

is this a StoreJet model?

$90
if same as storeJet:
sata drive inside: yes! Samsung
usb2 ready? no idea
easy to open! yes! 4 screws!

Adata DashDrive

$98
sata drive inside? no idea.

slowest of the lot. 90mbps sustained write/read.
fricking water and fall proof!
it's bulkier than the rest, but the usb3 cable goes IN the design. awesome.

LaCie Rugged Hard Disk Triple 1 TB USB 3.0 Firewire 800 (2x) Portable Hard Drive 301984

$170.

sata drive inside? no idea.

usb2 ready? no idea.

very cool enclosure.

easy to open! yes

WD Elements SE Portable 1 TB USB 3.0 External Hard Drive - WDBPCK0010BBK-NESN

and

WD My Passport 1TB

$81
sata drive inside: NO. (they have a 3.5" drive with a logic board that actually only have USB3 connectors!)

Brands

brands. Previously i had nightmares with WD, and loved Hitachis. But hitachi sold in 2012 all it's SSD and 2.5" factories and brands to WD, and all it's 3.5" brands and factories to toshiba. So Hitachis are no more. Hence, i couldn't care less for brands at the moment.

Sunday, January 20, 2013

fixing dialogs in gnome

http://askubuntu.com/questions/109321/popup-dialogs-attached-to-window-title-and-not-movable

Sunday, January 6, 2013

removing Unity from Ubuntu 12.04.1 LTS

aptitude remove empathy libunity-2d-private0 libunity-core-5.0-5 libunity-misc4 unity unity-2d unity-2d-common unity-2d-panel unity-2d-shell unity-2d-spread unity-asset-pool unity-common unity-greeter unity-lens-applications unity-lens-files unity-lens-music unity-lens-video unity-scope-musicstores unity-scope-video-remote unity-services

edit: lightdm will not work at all without unity-greeter. ubuntu sucks more each day

Wednesday, March 23, 2011

simple rsync

How to use rsync logic to copy only modified/new files and not have to run any service on the other host.

basically you will have the same result/security/convenience as running scp
scp -r sourcefiles/* destination.host.com:/destination/

but with the added rsync logic:
rsync -r -v -e ssh sourcefiles/* destination.host.com:/destination/

Tuesday, December 14, 2010

simulate a distant host in localhost

simulate 200ms pings. (100ms each leg)
tc qdisc add dev lo root handle 1:0 netem delay 100msec


Restore it back to normal again with:

tc qdisc del dev lo root


TODO: script to set that every second to a random value from 10 to 100

also:
iprelay -b30000 8000:localhost:80


references
  • from http://daniel.haxx.se/blog/2010/12/14/add-latency-to-localhost/
  • also in http://news.ycombinator.com/item?id=2004790
  • docs in http://www.linuxfoundation.org/collaborate/workgroups/networking/netem

usable tackaball

got a logitec usb trackman from ergo last week. really liked the middle style trackball, but missed scroll. the solution:

wrotenote-lx$ cat logitec_usb_trackball.sh 
#!/bin/sh
# 1 2 3 4 5 6 7 8 9
#xinput set-button-map "Logitech USB Trackball" 8 9 2 4 5 6 7 1 3
xinput set-button-map "Logitech USB Trackball" 1 9 2 4 5 6 7 1 3
# LF rt lf RT
# LF = big left button
# RT = big right button
# lf = small left button
# rt = small right button

# liga emulacao do whell por movimento do mouse
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1
# diz q par de botoes o movimento no eixo X "clica"
#xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation X Axis" 8 6
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Axes" 4 5 6 7

# apertar o botao 1 ativa emulacao acima
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 1



the buttons now do:
  • Big left button:

    • click for Button 1 (left click)
    • Hold for scroll on the trackball moviment (all four directions)

  • small left button: always button 1 (so i can drag things and select text)
  • small right button: Button 3 (right click) my least used button
  • Big Right button: middle click. I used that button a lot, to paste and thown windows to the bottom of my desktop zindex.