Thursday, September 26, 2013

ipv6 with monowall

ref: http://superuser.com/questions/317896/how-to-configure-monowall-to-use-tunnelbroker

Once you've signed up with TunnelBroker.net, their "tunnel details" page will supply you with information about your tunnel:
IPv6 Tunnel Endpoints
- Server IPv4 Address: 209.51.181.2
- Server IPv6 Address: 2001:470:1f3a:1178::1 /64
- Client IPv6 Address: 2001:470:1f3a:1178::2 /64
Routed IPv6 Prefixes
- Routed /64: 2001:470:1f3a:1178:: /64

To configure TunnelBroker in m0n0wall:

  1. By default all IPv6 support is disabled. In order for IPv6 configuration settings to appear you must enable IPv6 support. Under System -> Advanced, check Enable IPv6 support, and click Save:
    enter image description here
  2. In order to establish, or maintain a tunnel with Hurricane Electric, they must be able to ping you (over IPv4). This means that you must respond to ICMP packets on the WAN interface. UnderFirewall->IPv4 Rules, select the WAN tab. Click the add new rule button, and create the rule:
    • Action: Pass
    • Interface: WAN
    • Protocol: ICMP
    • ICMP type: any
    • Description: Allow IPv4 ICMP packets
    and click Save.
  3. Next configure the WAN interface's IPv6 settings. Click Interfaces->WAN. Under IPv6 configuration:
    • IPv6 mode: Tunnel
    • IPv6 address: 2001:470:1f3a:1178::2/64 (Client IPv6 Address from tunnel details page)
    • IPv6 tunnel endpoint: 209.51.181.2 (Server IPv4 Address from tunnel details page)
    enter image description here
    and click Save.
  4. Next configure the LAN interface's IPv6 settings. Click Interfaces->LAN:
    • IPv6 mode: static
    • IPv6 address: 2001:470:1f3a:1178::/64 (Routed /64 from tunnel details page)
    • IPv6 RA: check Send IPv6 router advertisments
    • MTU: 1280 bytes
    enter image description here
    and click Save.
  5. By default in monowall all outbound IPv4 traffic is permitted. With IPv6 we must manually create the similar rule to allow all outbound traffic. Click Firewall->IPv6 Rules and select the LAN tab, and click add new rule, and create the rule:
    • Action: Pass
    • Interface: LAN
    • Protocol: any
    • Source
      Type: LAN subnet
    • Destination
      Type: any
    • Description: IPv6 LAN -> any
    and click Save.
  6. Visit test-ipv6.com, to check that your IPv6 connectivity is working.
Tested with monowall v1.33

monowall traffic shaping

ref: http://wiki.abiquo.com/display/ABI20/How+to+Configure+a+Gateway+with+m0n0wall

8. Traffic Shaping Example

This is a simple example of how to configure traffic shaping in your firewall.

8.1. Before you begin, check the maximum download rate

In order to determine the size of the pipes, you need to know the average download rate of your WAN interface. To do so, you need to run the following command on a machine in that WAN:
$ curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
A download of a very large file will start. After some minutes, you can cancel it (by pressing Ctrl+C) and take a look at the download statistics. You'll see something like this:
The value under the Average Download column is what you need. In this network, after a 91-second test, we obtained an Average Download Rate of 211Kb/s. To make sure we're not surpassing it, we will substract 10% from this value and use it as a maximum. We'll assume we have a maximum bandwidth of 190 Kb/s.
Reliability of this value
The more time you spend testing, the more reliable the final value will be.

8.2. Setting Up the Pipes

For our example we will set up two pipes: one limited to 150 Kb/s for high-speed connections, and one limited to 40 Kb/s for low-speed connections.

8.3. Setting Up the Queues

In our high-speed connections, we want to have two queues: one for high-priority connections (weight 90) and one for low-priority connections (weight 30).

8.4. Setting Up the Rules

After defining our pipes and queues graph, we need to define the rules to filter the actual traffic:
  • SSH connections will be redirected to High-priority queue beneath High-speed pipe.
  • HTTP connections will be redirected to Low-priority queue beneath High-speed pipe.
  • All other connections will be redirected to Low-speed pipe.
Activate traffic shaping
After making all changes, make sure you check the option Enable traffic shaping in the Rules section

Thursday, July 25, 2013

google chrome desktop notification

ref: http://stackoverflow.com/questions/2271156/chrome-desktop-notification-example

 <script>  
 function notify() {  
  var havePermission = window.webkitNotifications.checkPermission();  
  if (havePermission == 0) {  
   // 0 is PERMISSION_ALLOWED  
   var notification = window.webkitNotifications.createNotification(  
    'http://i.stack.imgur.com/dmHl0.png',  
    'Chrome notification!',  
   'Here is the notification text'  
   );  
   notification.onclick = function () {  
    window.open("http://blog.apis17.info");  
    notification.close();  
   }  
   notification.show();  
  } else {  
    window.webkitNotifications.requestPermission();  
  }  
 }   
 </script>  
 <div style="width: 300px; height: 300px; background: yellow" onclick="notify()">  
 Cick here to notify  
 </div>  

view on jsfiddle

slow website respond xampp windows 8 [solved]

http://www.apachefriends.org/f/viewtopic.php?f=16&t=51152

when user click php links that not require database it respond faster. localhost web respond with delay about 300ms if i have database query page. it occur even with simple mysql query. after searching around i found that windows 8 not able to locate localhost correctly (127.0.0.1 or ::0). this is my solution:

1. edit my.cnf located in C:\xampp\mysql\bin directory
2. find bind-address and uncomment 127.0.0.1 or ::1 which your pc use to connect localhost

 # Change here for bind listening  
 # bind-address="127.0.0.1"   
  bind-address = ::1     # for ipv6  

mine using ::1 and i uncomment that line.
3. restart mysql service. use xampp control panel (xampp-control) located at C:\xampp

you will see improvement after restart mysql service.
cheers.
Related Posts Plugin for WordPress, Blogger...