working on it ...

Filters

Explore Public Snippets

Sort by

Found 3,824 snippets matching: o.o.p

    public by teslamint  234867  1  4  0

    modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html

    modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html: coova-1.3.0-custom.patch
    Index: files/chilli.init
    ===================================================================
    --- files/chilli.init   (리비전 0)
    +++ files/chilli.init   (리비전 0)
    @@ -0,0 +1,61 @@
    +#!/bin/sh /etc/rc.common
    +
    +START=30
    +STOP=90
    +
    +config_cb() {
    +    chilli_inst=$2
    +    if [ "$chilli_inst" != "" ]
    +    then
    +       rm -f /var/run/chilli_${chilli_inst}*
    +       chilli_conf=/var/run/chilli_${chilli_inst}.conf
    +       eval "start_chilli_$chilli_inst=1"
    +    fi
    +}
    +
    +option_cb() {
    +    case "$1" in
    +        # UCI settings
    +       network)
    +           . /lib/functions/network.sh
    +           local ifname
    +           network_get_device ifname $2
    +           echo "dhcpif=\"$ifname\"" >> $chilli_conf
    +           ;;
    +       disabled)
    +           eval "start_chilli_$chilli_inst=0"
    +           ;;
    +        # boolean settings
    +       dhcpbroadcast|nodynip|vlanlocation|locationstopstart|locationcopycalled|locationimmediateupdate|locationopt82|coanoipcheck|noradallow|proxymacaccept|proxyonacct|dhcpmacset|dhcpradius|noc2c|eapolenable|uamanydns|uamanyip|uamnatanyip|nouamsuccess|nowispr1|nowispr2|domaindnslocal|radsec|macauth|macreauth|macauthdeny|macallowlocal|strictmacauth|strictdhcp|ieee8021q|only8021q|radiusoriginalurl|swapoctets|statusfilesave|wpaguests|openidauth|papalwaysok|mschapv2|chillixml|acctupdate|dnsparanoia|seskeepalive|usetap|noarpentries|framedservice|scalewin|redir|injectwispr|redirurl|routeonetone|nousergardendata|uamgardendata|uamotherdata|withunixipc|uamallowpost|redirssl|uamuissl|layer3|patricia|redirdnsreq|dhcpnotidle|ipv6|ipv6only)
    +           [ "$2" = "true" -o "$2" = "1" ] && echo "$1" >> $chilli_conf
    +           ;;
    +       *)
    +           echo "$1=\"$2\"" >> $chilli_conf
    +           ;;
    +    esac
    +}
    +
    +start_chilli() {
    +    local cfg="$1"
    +    local start_chilli=$(eval "echo \$start_chilli_$cfg")
    +    [ "$start_chilli" = "0" ] && return
    +    local base=/var/run/chilli_${cfg}
    +    chilli -c ${base}.conf \
    +       --pidfile ${base}.pid \
    +       --cmdsocket ${base}.sock \
    +       --unixipc ${base}.ipc &
    +}
    +
    +start() {
    +    config_load chilli
    +    config_foreach start_chilli chilli
    +}
    +
    +stop() {
    +    ls /var/run/chilli*.pid 2>/dev/null && {
    +       kill $(cat /var/run/chilli*.pid)
    +       sleep 1
    +       killall -9 chilli &
    +       rm -f /var/run/chilli*
    +    }
    +}
    Index: files/chilli.firewall
    ===================================================================
    --- files/chilli.firewall       (리비전 0)
    +++ files/chilli.firewall       (리비전 0)
    @@ -0,0 +1,33 @@
    +#!/bin/sh
    +
    +chilli_firewall() {
    +    local cfg="$1"
    +    local tun ipup addr mask net dhcpif uamport uamuiport
    +
    +    config_get tun "$cfg" tundev
    +    config_get ipup "$cfg" ipup
    +    config_get addr "$cfg" uamlisten
    +    config_get net "$cfg" net
    +    config_get dhcpif "$cfg" dhcpif
    +    config_get uamport "$cfg" uamport
    +    config_get uamuiport "$cfg" uamuiport
    +
    +    if [ -f /var/run/chilli.$tun.sh ]; then
    +        [ "$(iptables -t filter -vL | grep $tun)" != "" ] && . /var/run/chilli.$tun.sh
    +        DEV=$tun
    +        ADDR=$addr
    +        MASK=255.255.255.0
    +        NET=$net
    +        DHCPIF=$dhcpif
    +        UAMPORT=$uamport
    +        UAMUIPORT=$uamuiport
    +        . $ipup
    +    fi
    +
    +}
    +
    +chilli_post_core_cb() {
    +    config_load chilli
    +    config_foreach chilli_firewall chilli
    +}
    +
    Index: Makefile
    ===================================================================
    --- Makefile    (리비전 37020)
    +++ Makefile    (작업 사본)
    @@ -8,16 +8,13 @@
     include $(TOPDIR)/rules.mk
    
     PKG_NAME:=coova-chilli
    -PKG_VERSION:=1.2.9
    +PKG_VERSION:=1.3.0
     PKG_RELEASE:=1
    
     PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
    -PKG_SOURCE_URL:=http://ap.coova.org/chilli
    -PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0
    +PKG_SOURCE_URL:=http://coova-chilli.s3.amazonaws.com/
    +PKG_MD5SUM:=dc0037e3cdebcb60508081b4e42e984a
    
    -PKG_FIXUP:=autoreconf
    -PKG_INSTALL:=1
    -
     include $(INCLUDE_DIR)/package.mk
    
     define Package/coova-chilli
    @@ -25,33 +22,102 @@
       SECTION:=net
       CATEGORY:=Network
       DEPENDS:=+kmod-tun +librt
    -  TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
    -  URL:=http://www.coova.org/CoovaChilli
    +  TITLE:=Wireless LAN HotSpot controller
    +  URL:=http://www.coova.org/
     endef
    
    +define Package/coova-chilli-miniportal
    +  SUBMENU:=Captive Portals
    +  SECTION:=net
    +  CATEGORY:=Network
    +  DEPENDS:=+coova-chilli
    +  TITLE:=CoovaChilli MiniPortal
    +  URL:=http://www.coova.org/
    +endef
    +
     define Package/coova-chilli/description
            CoovaChilli is an open source access controller for wireless LAN
            access points and is based on ChilliSpot. It is used for authenticating
            users of a wireless (or wired) LAN. It supports web based login (UAM)
    -       which is today's standard for public HotSpots and it supports Wireless
    -       Protected Access (WPA) which is the standard of the future.
    -       Authentication, authorization and accounting (AAA) is handled by your
    -       favorite radius server.
    +       which is today's standard for public HotSpots and it supports Wireless Protected
    +       Access (WPA) which is the standard of the future. Authentication,
    +       authorization and accounting (AAA) is handled by your favorite
    +       radius server.
     endef
    
    -define Package/coova-chilli/conffiles
    -/etc/chilli.conf
    +define Build/Configure
    +  (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
    +               $(TARGET_CONFIGURE_OPTS) \
    +                CFLAGS="$(strip $(TARGET_CFLAGS)) -DNEED_DN_SKIPNAME" \
    +                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
    +                LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
    +               ac_cv_func_malloc_0_nonnull=yes \
    +               ac_cv_func_realloc_0_nonnull=yes \
    +               ac_cv_func_memcmp_working=yes \
    +               ac_cv_func_setvbuf_reversed=no \
    +                ./configure \
    +                       --target=$(GNU_TARGET_NAME) \
    +                       --host=$(GNU_TARGET_NAME) \
    +                       --build=$(GNU_HOST_NAME) \
    +                       --program-prefix="" \
    +                       --program-suffix="" \
    +                       --prefix=/usr \
    +                       --sysconfdir=/etc \
    +                       --exec-prefix=/usr \
    +                       --bindir=/usr/bin \
    +                       --datadir=/usr/share \
    +                       --includedir=/usr/include \
    +                       --infodir=/usr/share/info \
    +                       --libdir=/usr/lib \
    +                       --libexecdir=/usr/lib \
    +                       --localstatedir=/var \
    +                       --mandir=/usr/share/man \
    +                       --sbindir=/usr/sbin \
    +                       --enable-shared \
    +                       --disable-static \
    +                       --with-gnu-ld \
    +                       --enable-miniconfig \
    +                       --enable-miniportal \
    +                       --enable-chilliredir \
    +                       --enable-chilliproxy \
    +                       --enable-binstatusfile \
    +        );
     endef
    
    +define Build/Compile
    +       $(MAKE) -C $(PKG_BUILD_DIR) \
    +               DESTDIR="$(PKG_INSTALL_DIR)" \
    +               all install
    +endef
    +
    +define Build/InstallDev
    +       $(INSTALL_DIR) $(1)/usr/include
    +       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
    +       $(INSTALL_DIR) $(1)/usr/lib
    +       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/
    +endef
    +
    +
    +define Package/coova-chilli-miniportal/install
    +       $(INSTALL_DIR) $(1)/etc/chilli
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/www $(1)/etc/chilli/
    +endef
    +
     define Package/coova-chilli/install
    -       $(INSTALL_DIR) $(1)/etc
    -       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
    -       $(INSTALL_DIR) $(1)/etc/chilli
    -       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
    +       $(INSTALL_DIR) $(1)/etc/chilli
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/up.sh $(1)/etc/chilli/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/down.sh $(1)/etc/chilli/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/wwwsh $(1)/etc/chilli/
    +       $(INSTALL_DIR) $(1)/etc/init.d
    +       $(CP) files/chilli.init $(1)/etc/init.d/chilli
    +       $(INSTALL_DIR) $(1)/lib/firewall
    +       $(CP) files/chilli.firewall $(1)/lib/firewall/chilli.sh
            $(INSTALL_DIR) $(1)/usr/sbin
    -       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
    +       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
            $(INSTALL_DIR) $(1)/usr/lib/
            $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
     endef
    
     $(eval $(call BuildPackage,coova-chilli))
    +$(eval $(call BuildPackage,coova-chilli-miniportal))
    
    

    public by sTiLL-iLL @ SniPitz-KND  2910  7  8  21

    ... it's KliKQ.js & its meh family brah......

    Functional and flexible Collection or group - type data-structure. Itsupports gets, sets, sorts, all kindz of shit. Try it just once and the Government says your as gewd as hooked for life!
    
    var KliKQ = (function () {
        
    	function KliKQ() {
    		this.mehArry = [];
    		this.dahMap = {};
    		this.length = 0;
    	}
    	
    	KliKQ.prototype.keyRoster = function () {
    		var kz = [];
    		
    		this.eachIn(function (val, k) {
    			kz.push(k);
    		});
    		
    		return kz;
    	};
    	
    	
        KliKQ.prototype.keyAssign = function (k, obj) {
    		if (obj === 'undefined') {
    			this.keyRemove(k);
    		} 
    		else if (!this.dahMap.hasOwnProperty(k)) {
    			
    			this.dahMap[k] = this.mehArry.length;
    			
    			this.mehArry.push({
    				value: obj,
    				key: k
    			});
    			
    			this.length++;
    		} 
    		else {
    			this.mehArry[this.dahMap[k]].value = obj;
    		}
    	};
    	
    	
        KliKQ.prototype.keyPull = function (k) {
    		if (this.dahMap.hasOwnProperty(k)) {
    			return this.mehArry[this.dahMap[k]].value;
    		}
    		
    		return undefined;
    	};
    	
    	
    	KliKQ.prototype.idxGet = function (idx) {
    		if (this.length <= idx) {
    			return undefined;
    		}
    		
    		return this.mehArry[idx].value;
    	};
    	
    	
        KliKQ.prototype.keyRemove = function (k) {	
    		if (this.dahMap.hasOwnProperty(k)) {
    			
    			var idx = this.dahMap[k], nam = "";
    			delete this.dahMap[k];
    			
    			for (nam in this.dahMap) {
    				if (this.dahMap.hasOwnProperty(nam) && this.dahMap[nam] >= idx) {
    					this.dahMap[nam]--;
    				}
    			}
    			
    			this.mehArry.splice(idx, 1);
    			this.length--;
    		}
    	};
    	
    	
    	KliKQ.prototype.eachIn = function (cback, slf) {
    		var i = 0, ary = this.mehArry, len = ary.length;
    		
    		if (!slf) {
    			slf = this;
    		}
    		
    		while (i < len) {	
    		    if (ary[i].value !== 'undefined') {
    				cback.call(slf, ary[i].value, i, ary[i].key, this);
    			}
    			
    		    i++;
    		}
    	};
    	
    	function kmprItems(dis, dat) {
    		return (dis == dat) ? 0 : (dis < dat) ? -1 : 1;
    	};
    	
    	KliKQ.prototype.keySort = function (xprsn) {
    		var i = 0, ary = this.mehArry, len = ary.length;
    		
    		if (!xprsn) {
    			xprsn = kmprItems;
    		}
    		
    		this.mehArry.sort(function (dis, dat) {
    			return xprsn(dis.key, dat.key);
    		});
    		
    		while (i < len) {
    			this.dahMap[ary[i].key] = i;
    			i++;
    		}
        };
    	
    	return KliKQ;
    	
    }());

    public by sTiLL-iLL @ SniPitz-KND  3722  0  7  15

    weaklings.js... a good try at creating "WeakSet" and "WeakMap" data-structures.

    go ahead, slap the map and set...
    // weak set / map
    
    var wkMap=global.WeakMap, 
        wkSet=global.WeakSet;
        
    function wkmCreate(a) {
    	if(!isCallConstruct()) {
    		throw MakeTypeError('constructor_not_function',['WkMap']);
    	}
    	var b,c;
    	if(!(a==null)){
    		b=getEnum(a);
    		c=this.set;
    		if(!(ClassIs(c)==='Function')) {
    			throw MakeTypeError('property_not_function',['set',this]);
    		}
    	}
    	cofigureGroup(this);
    	if ((b===(void 0))) {
    		return;
    	}
    	var d,g,h;
    	while(!(d=b.next()).done) {
    		if(!(isSpecial(d))) {
    			throw MakeTypeError('iterator_result_not_an_object',[d]);
    		}
    		h=d.value;
    		if(!(isSpecial(h))) {
    			throw MakeTypeError('iterator_value_not_an_object',[h]);
    		}
    		makeCall(this,h[0],h[1],c);
    	}
    }
    function wkmGet(a) {
    	if((ClassIs(this)!=='WkMap')) {
    		throw MakeTypeError('incompatible_method_receiver',	['WkMap.prototype.get', this]);
    	}
    	if(!isSpecial(a)||(typeof(a)==='symbol')) {
    		throw MakeTypeError('invalid_weakmap_key', [this,a]);
    	}
    	return wkmGet(this,a);
    }
    function wkmSet(a,b) {
    	if((ClassIs(this)!=='WkMap')) {
    		throw MakeTypeError('incompatible_method_receiver',	['WkMap.prototype.set', this]);
    	}
    	if(!((isSpecial(a))||(typeof(a)=='symbol'))) {
    		throw MakeTypeError('invalid_weakmap_key', [this,a]);
    	}
    	return wkmCollection(this,a,b);
    }
    function wkmContains(a) {
      if((ClassIs(this)!=='WkMap')) {
    		throw MakeTypeError('incompatible_method_receiver',	['WkMap.prototype.contins', this]);
    	}
    	if(!((isSpecial(a))||(typeof(a)==='symbol'))) {
    		throw MakeTypeError('invalid_weakmap_key', [this,a]);
    	}
    	return wsContains(this,a);
    }
    function WkmDelete(a) {
      if((ClassIs(this)!=='WkMap')) {
    		throw MakeTypeError('incompatible_method_receiver',	['WkMap.prototype.delete', this]);
    	}
    	if(!((isSpecial(a))||(typeof(a)==='symbol'))) {
    		throw MakeTypeError('invalid_weakmap_key', [this, a]);
    	}
    	return emptyCollection(this, a);
    }
    function wkmClear() {
    	if((ClassIs(this)!=='WkMap')) {
    		throw MakeTypeError('incompatible_method_receiver', ['WkMap.prototype.clear', this]);
    	}
    	cofigureGroup(this);
    }
    function wkmConfigure() {
    	isStrapped();
    	setCode(wkMap, wkmCreate);
    	setProto(wkMap, new genObj());
    	addName(wkMap.prototype, "constructor", wkMap, 2);
    	pinMethods(wkMap.prototype, 2, genAry(
    		"get", wkmGet,
    		"set", wkmSet,
    		"contains", wkmContains,
    		"delete", wkmDelete,
    		"clear", wkmClear
    	));
    }
    wkmConfigure();
    
    function wsConstructor(a) {
    	if(!isConstructCall()) {
    		throw MakeTypeError('constructor_not_function',['WeakSet']);
    	}
    	var b,c;
    	if(a!==null) {
    		b=getEnum(a);
    		c=this.add;
    		if(ClassIs(c)!=='Function') {
    			throw MakeTypeError('property_not_function', ['add', this]);
    		}
    	}
    	cofigureGroup(this);
    	if ((b===(void 0))) {
    		return;
    	}
    	var d,g;
    	while(!(d=b.next()).done) {
    		if(!(isSpecial(d))) {
    			throw MakeTypeError('iterator_result_not_an_object', [d]);
    		}
    		makeCall(this, d.value, c);
    	}
    }
    function addItem(a) {
    	if(ClassIs(this)!=='WkSet') {
    		throw MakeTypeError('incompatible_method_receiver',	['WkSet.prototype.addItem', this]);
    	}
    	if(!isSpecial(a)||typeof(a)==='symbol') {
    		throw MakeTypeError('invalid_weakset_value', [this,a]);
    	}
    	return wsCollection(this, a, true);
    }
    function wsContains(a) {
    	if(ClassIs(this)!=='WkSet') {
    		throw MakeTypeError('incompatible_method_receiver',	['WkSet.prototype.contains',this]);
    	}
    	if(!isSpecial(a)||typeof(a)==='symbol') {
    		throw MakeTypeError('invalid_weakset_value', [this, a]);
    	}
    	return wsContains(this, a);
    } 
    function wsDelete(a) {
    	if(ClassIs(this)!=='WkSet') {
    		throw MakeTypeError('incompatible_method_receiver',	['WkSet.prototype.delete',this]);
    	}
    	if(!(isSpecial(a)||typeof(a)==='symbol')) {
    		throw MakeTypeError('invalid_weakset_value', [this, a]);
    	}
    	return emptyCollection(this, a);
    }
    function wsClear(){
    	if(ClassIs(this)!=='WkSet') {
    		throw MakeTypeError('incompatible_method_receiver',	['WkSet.prototype.clear', this]);
    	}
    	cofigureGroup(this);
    }
    function setConfigure() {
    	isStrapped();
    	setCode(wkSet, wsConstructor);
    	setPrototype(wkSet, new genObj());
    	addName(wkSet.prototype,"constructor", wkSet, 2);
    	pinMethods(wkSet.prototype, 2, genAry(
    	"add", addItem,
    	"has", wsContains,
    	"delete",wsDelete,
    	"clear",wsClear
    	));
    }
    return setConfigure();            

    public by jaehoon  3499  0  4  0

    modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html

    modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html: coova-1.3.0-custom.patch
    Index: files/chilli.init
    ===================================================================
    --- files/chilli.init   (리비전 0)
    +++ files/chilli.init   (리비전 0)
    @@ -0,0 +1,61 @@
    +#!/bin/sh /etc/rc.common
    +
    +START=30
    +STOP=90
    +
    +config_cb() {
    +    chilli_inst=$2
    +    if [ "$chilli_inst" != "" ]
    +    then
    +       rm -f /var/run/chilli_${chilli_inst}*
    +       chilli_conf=/var/run/chilli_${chilli_inst}.conf
    +       eval "start_chilli_$chilli_inst=1"
    +    fi
    +}
    +
    +option_cb() {
    +    case "$1" in
    +        # UCI settings
    +       network)
    +           . /lib/functions/network.sh
    +           local ifname
    +           network_get_device ifname $2
    +           echo "dhcpif=\"$ifname\"" >> $chilli_conf
    +           ;;
    +       disabled)
    +           eval "start_chilli_$chilli_inst=0"
    +           ;;
    +        # boolean settings
    +       dhcpbroadcast|nodynip|vlanlocation|locationstopstart|locationcopycalled|locationimmediateupdate|locationopt82|coanoipcheck|noradallow|proxymacaccept|proxyonacct|dhcpmacset|dhcpradius|noc2c|eapolenable|uamanydns|uamanyip|uamnatanyip|nouamsuccess|nowispr1|nowispr2|domaindnslocal|radsec|macauth|macreauth|macauthdeny|macallowlocal|strictmacauth|strictdhcp|ieee8021q|only8021q|radiusoriginalurl|swapoctets|statusfilesave|wpaguests|openidauth|papalwaysok|mschapv2|chillixml|acctupdate|dnsparanoia|seskeepalive|usetap|noarpentries|framedservice|scalewin|redir|injectwispr|redirurl|routeonetone|nousergardendata|uamgardendata|uamotherdata|withunixipc|uamallowpost|redirssl|uamuissl|layer3|patricia|redirdnsreq|dhcpnotidle|ipv6|ipv6only)
    +           [ "$2" = "true" -o "$2" = "1" ] && echo "$1" >> $chilli_conf
    +           ;;
    +       *)
    +           echo "$1=\"$2\"" >> $chilli_conf
    +           ;;
    +    esac
    +}
    +
    +start_chilli() {
    +    local cfg="$1"
    +    local start_chilli=$(eval "echo \$start_chilli_$cfg")
    +    [ "$start_chilli" = "0" ] && return
    +    local base=/var/run/chilli_${cfg}
    +    chilli -c ${base}.conf \
    +       --pidfile ${base}.pid \
    +       --cmdsocket ${base}.sock \
    +       --unixipc ${base}.ipc &
    +}
    +
    +start() {
    +    config_load chilli
    +    config_foreach start_chilli chilli
    +}
    +
    +stop() {
    +    ls /var/run/chilli*.pid 2>/dev/null && {
    +       kill $(cat /var/run/chilli*.pid)
    +       sleep 1
    +       killall -9 chilli &
    +       rm -f /var/run/chilli*
    +    }
    +}
    Index: files/chilli.firewall
    ===================================================================
    --- files/chilli.firewall       (리비전 0)
    +++ files/chilli.firewall       (리비전 0)
    @@ -0,0 +1,33 @@
    +#!/bin/sh
    +
    +chilli_firewall() {
    +    local cfg="$1"
    +    local tun ipup addr mask net dhcpif uamport uamuiport
    +
    +    config_get tun "$cfg" tundev
    +    config_get ipup "$cfg" ipup
    +    config_get addr "$cfg" uamlisten
    +    config_get net "$cfg" net
    +    config_get dhcpif "$cfg" dhcpif
    +    config_get uamport "$cfg" uamport
    +    config_get uamuiport "$cfg" uamuiport
    +
    +    if [ -f /var/run/chilli.$tun.sh ]; then
    +        [ "$(iptables -t filter -vL | grep $tun)" != "" ] && . /var/run/chilli.$tun.sh
    +        DEV=$tun
    +        ADDR=$addr
    +        MASK=255.255.255.0
    +        NET=$net
    +        DHCPIF=$dhcpif
    +        UAMPORT=$uamport
    +        UAMUIPORT=$uamuiport
    +        . $ipup
    +    fi
    +
    +}
    +
    +chilli_post_core_cb() {
    +    config_load chilli
    +    config_foreach chilli_firewall chilli
    +}
    +
    Index: Makefile
    ===================================================================
    --- Makefile    (리비전 37020)
    +++ Makefile    (작업 사본)
    @@ -8,16 +8,13 @@
     include $(TOPDIR)/rules.mk
    
     PKG_NAME:=coova-chilli
    -PKG_VERSION:=1.2.9
    +PKG_VERSION:=1.3.0
     PKG_RELEASE:=1
    
     PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
    -PKG_SOURCE_URL:=http://ap.coova.org/chilli
    -PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0
    +PKG_SOURCE_URL:=http://coova-chilli.s3.amazonaws.com/
    +PKG_MD5SUM:=dc0037e3cdebcb60508081b4e42e984a
    
    -PKG_FIXUP:=autoreconf
    -PKG_INSTALL:=1
    -
     include $(INCLUDE_DIR)/package.mk
    
     define Package/coova-chilli
    @@ -25,33 +22,102 @@
       SECTION:=net
       CATEGORY:=Network
       DEPENDS:=+kmod-tun +librt
    -  TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
    -  URL:=http://www.coova.org/CoovaChilli
    +  TITLE:=Wireless LAN HotSpot controller
    +  URL:=http://www.coova.org/
     endef
    
    +define Package/coova-chilli-miniportal
    +  SUBMENU:=Captive Portals
    +  SECTION:=net
    +  CATEGORY:=Network
    +  DEPENDS:=+coova-chilli
    +  TITLE:=CoovaChilli MiniPortal
    +  URL:=http://www.coova.org/
    +endef
    +
     define Package/coova-chilli/description
            CoovaChilli is an open source access controller for wireless LAN
            access points and is based on ChilliSpot. It is used for authenticating
            users of a wireless (or wired) LAN. It supports web based login (UAM)
    -       which is today's standard for public HotSpots and it supports Wireless
    -       Protected Access (WPA) which is the standard of the future.
    -       Authentication, authorization and accounting (AAA) is handled by your
    -       favorite radius server.
    +       which is today's standard for public HotSpots and it supports Wireless Protected
    +       Access (WPA) which is the standard of the future. Authentication,
    +       authorization and accounting (AAA) is handled by your favorite
    +       radius server.
     endef
    
    -define Package/coova-chilli/conffiles
    -/etc/chilli.conf
    +define Build/Configure
    +  (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
    +               $(TARGET_CONFIGURE_OPTS) \
    +                CFLAGS="$(strip $(TARGET_CFLAGS)) -DNEED_DN_SKIPNAME" \
    +                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
    +                LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
    +               ac_cv_func_malloc_0_nonnull=yes \
    +               ac_cv_func_realloc_0_nonnull=yes \
    +               ac_cv_func_memcmp_working=yes \
    +               ac_cv_func_setvbuf_reversed=no \
    +                ./configure \
    +                       --target=$(GNU_TARGET_NAME) \
    +                       --host=$(GNU_TARGET_NAME) \
    +                       --build=$(GNU_HOST_NAME) \
    +                       --program-prefix="" \
    +                       --program-suffix="" \
    +                       --prefix=/usr \
    +                       --sysconfdir=/etc \
    +                       --exec-prefix=/usr \
    +                       --bindir=/usr/bin \
    +                       --datadir=/usr/share \
    +                       --includedir=/usr/include \
    +                       --infodir=/usr/share/info \
    +                       --libdir=/usr/lib \
    +                       --libexecdir=/usr/lib \
    +                       --localstatedir=/var \
    +                       --mandir=/usr/share/man \
    +                       --sbindir=/usr/sbin \
    +                       --enable-shared \
    +                       --disable-static \
    +                       --with-gnu-ld \
    +                       --enable-miniconfig \
    +                       --enable-miniportal \
    +                       --enable-chilliredir \
    +                       --enable-chilliproxy \
    +                       --enable-binstatusfile \
    +        );
     endef
    
    +define Build/Compile
    +       $(MAKE) -C $(PKG_BUILD_DIR) \
    +               DESTDIR="$(PKG_INSTALL_DIR)" \
    +               all install
    +endef
    +
    +define Build/InstallDev
    +       $(INSTALL_DIR) $(1)/usr/include
    +       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
    +       $(INSTALL_DIR) $(1)/usr/lib
    +       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/
    +endef
    +
    +
    +define Package/coova-chilli-miniportal/install
    +       $(INSTALL_DIR) $(1)/etc/chilli
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/www $(1)/etc/chilli/
    +endef
    +
     define Package/coova-chilli/install
    -       $(INSTALL_DIR) $(1)/etc
    -       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
    -       $(INSTALL_DIR) $(1)/etc/chilli
    -       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
    +       $(INSTALL_DIR) $(1)/etc/chilli
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/up.sh $(1)/etc/chilli/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/down.sh $(1)/etc/chilli/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/wwwsh $(1)/etc/chilli/
    +       $(INSTALL_DIR) $(1)/etc/init.d
    +       $(CP) files/chilli.init $(1)/etc/init.d/chilli
    +       $(INSTALL_DIR) $(1)/lib/firewall
    +       $(CP) files/chilli.firewall $(1)/lib/firewall/chilli.sh
            $(INSTALL_DIR) $(1)/usr/sbin
    -       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
    +       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
            $(INSTALL_DIR) $(1)/usr/lib/
            $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
     endef
    
     $(eval $(call BuildPackage,coova-chilli))
    +$(eval $(call BuildPackage,coova-chilli-miniportal))
    
    

    public by teslamint  2520  0  3  0

    OpenWrt firewall script for coova-chilli. use patch in https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html and place this chilli.sh into /lib/firewall/

    OpenWrt firewall script for coova-chilli. use patch in https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html and place this chilli.sh into /lib/firewall/: chilli.sh
    #!/bin/sh
    
    chilli_firewall() {
        local cfg="$1"
        local tun ipup addr mask net dhcpif uamport uamuiport
    
        config_get tun "$cfg" tundev
        config_get ipup "$cfg" ipup
        config_get addr "$cfg" uamlisten
        config_get net "$cfg" net
        config_get dhcpif "$cfg" dhcpif
        config_get uamport "$cfg" uamport
        config_get uamuiport "$cfg" uamuiport
    
        if [ -f /var/run/chilli.$tun.sh ]; then
            [ "$(iptables -t filter -vL | grep $tun)" != "" ] && . /var/run/chilli.$tun.sh
            DEV=$tun
            ADDR=$addr
            MASK=255.255.255.0
            NET=$net
            DHCPIF=$dhcpif
            UAMPORT=$uamport
            UAMUIPORT=$uamuiport
            . $ipup
        fi
    
    }
    
    chilli_post_core_cb() {
        config_load chilli
        config_foreach chilli_firewall chilli
    }
    
    
    

    public by jaehoon  2475  0  3  0

    OpenWrt firewall script for coova-chilli. use patch in https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html and place this chilli.sh into /lib/firewall/

    OpenWrt firewall script for coova-chilli. use patch in https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html and place this chilli.sh into /lib/firewall/: chilli.sh
    #!/bin/sh
    
    chilli_firewall() {
        local cfg="$1"
        local tun ipup addr mask net dhcpif uamport uamuiport
    
        config_get tun "$cfg" tundev
        config_get ipup "$cfg" ipup
        config_get addr "$cfg" uamlisten
        config_get net "$cfg" net
        config_get dhcpif "$cfg" dhcpif
        config_get uamport "$cfg" uamport
        config_get uamuiport "$cfg" uamuiport
    
        if [ -f /var/run/chilli.$tun.sh ]; then
            [ "$(iptables -t filter -vL | grep $tun)" != "" ] && . /var/run/chilli.$tun.sh
            DEV=$tun
            ADDR=$addr
            MASK=255.255.255.0
            NET=$net
            DHCPIF=$dhcpif
            UAMPORT=$uamport
            UAMUIPORT=$uamuiport
            . $ipup
        fi
    
    }
    
    chilli_post_core_cb() {
        config_load chilli
        config_foreach chilli_firewall chilli
    }
    
    
    

    public by johansonkatherine  6783  1  10  5

    Save Microsoft OneNote (.one) file as an image (.PNG, .BMP, .JPEG, .GIF) file in C#/.NET

    The Aspose.Note for .NET API allows developers to open files & manipulate elements of OneNote books & export them to PNG, GIF, JPEG, BMP and PDF formats. The following code sample shows developers how to save OneNote File as an image in C#/.NET
    // Load the document into Aspose.Note.
        Document oneFile = new Document(@"FullFileName.one");
        // Save the document as GIF.
        oneFile.Save("FullFileName.gif", SaveFormat.Gif);
    	
        OR
    
        // Load the document into Aspose.Note.
        Document oneFile = new Document(@"FullFileName.one");
        // Initialize ImageSaveOptions object 
        ImageSaveOptions opts = new ImageSaveOptions(SaveFormat.Png);
        // Set page index
        opts.PageIndex = 1;
        // Save the document as PNG.
        oneFile.Save(@"FullFileName.png", opts);
    

    public by Zenitram.PRO  3525  1  5  1

    How to use Prototype in Object

    It's All in the Genes In object-oriented programming, inheritance allows one class to see and use the methods and properties of another class. You can think of it as a child being able to use his or her parent's money because the child inherits the money. We will learn more about inheritance as we continue this lesson, but for now let's just
    // create your Animal class here
    function Animal(name,numLegs)
    {
        this.name = name;
        this.numLegs = numLegs;
    }
    
    
    // create the sayName method for Animal
    Animal.prototype.sayName = function () {
        console.log("Hi my name is " + this.name);
    } 
    
    // provided code to test above constructor and method
    var penguin = new Animal("Captain Cook", 2);
    penguin.sayName();            

    public by msdn  1049  1  6  0

    OverwriteFile_Gutmann: Overwrite the file based on the Peter Gutmann's algorithm.

    Overwrite the file based on the Peter Gutmann's algorithm. The file.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    using Microsoft.WinAny.Misc;
    
    private const int MAX_BUFFER_SIZE = 67108864;
    
    #endregion
    
    #region OverwriteFile_Gutmann
    
    /// <summary>
    /// Overwrite the file based on the Peter Gutmann's algorithm.
    /// </summary>
    /// <param name="file">The file.</param>
    internal static void OverwriteFile_Gutmann(FileInfo file)
    {
        byte[][] pattern = new byte[][] { 
            new byte[] {0x55, 0x55, 0x55}, new byte[] {0xAA, 0xAA, 0xAA}, new byte[] {0x92, 0x49, 0x24}, new byte[] {0x49, 0x24, 0x92}, new byte[] {0x24, 0x92, 0x49}, 
            new byte[] {0x00, 0x00, 0x00}, new byte[] {0x11, 0x11, 0x11}, new byte[] {0x22, 0x22, 0x22}, new byte[] {0x33, 0x33, 0x33}, new byte[] {0x44, 0x44, 0x44}, 
            new byte[] {0x55, 0x55, 0x55}, new byte[] {0x66, 0x66, 0x66}, new byte[] {0x77, 0x77, 0x77}, new byte[] {0x88, 0x88, 0x88}, new byte[] {0x99, 0x99, 0x99}, 
            new byte[] {0xAA, 0xAA, 0xAA}, new byte[] {0xBB, 0xBB, 0xBB}, new byte[] {0xCC, 0xCC, 0xCC}, new byte[] {0xDD, 0xDD, 0xDD}, new byte[] {0xEE, 0xEE, 0xEE}, 
            new byte[] {0xFF, 0xFF, 0xFF}, new byte[] {0x92, 0x49, 0x24}, new byte[] {0x49, 0x24, 0x92}, new byte[] {0x24, 0x92, 0x49}, new byte[] {0x6D, 0xB6, 0xDB}, 
            new byte[] {0xB6, 0xDB, 0x6D}, new byte[] {0xDB, 0x6D, 0xB6} };
    
        ThreadSafeRandom.Shuffle<byte[]>(pattern);
    
        Random random = ThreadSafeRandom.Random;
    
        FileStream fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Write, FileShare.None);
    
        for (int pass = 1; pass <= 35; ++pass)
        {
            for (int index = 0; index < 3; index++)
            {
                fs.Position = 0;
    
                for (long size = fs.Length; size > 0; size -= MAX_BUFFER_SIZE)
                {
                    long bufferSize = (size < MAX_BUFFER_SIZE) ? size : MAX_BUFFER_SIZE;
    
                    byte[] buffer = new byte[bufferSize];
    
                    if (pass > 4 && pass < 32)
                    {
                        for (int bufferIndex = 0; bufferIndex < bufferSize; ++bufferIndex)
                        {
                            buffer[bufferIndex] = pattern[pass - 5][index];
                        }
                    }
                    else
                    {
                        for (int bufferIndex = 0; bufferIndex < bufferSize; ++bufferIndex)
                        {
                            buffer[bufferIndex] = (byte)(random.Next() % 256);
                        }
                    }
    
                    fs.Write(buffer, 0, buffer.Length);
                    fs.Flush(true);
                }
            }
        }
    
        fs.Close(); fs.Dispose(); fs = null;
    }

    public by msdn  1025  0  8  0

    Map: Executes a map operation, converting an input list into an output list, in parallel.

    Executes a map operation, converting an input list into an output list, in parallel. Specifies the type of the input data. Specifies the type of the output data. The input list to be mapped used the transform function. A ParallelOptions instance that configures the behavior of this operation. The transform function to use to map the input data
    using System.Collections.Generic;
    using System.Threading.Tasks;
    
    /// <summary>Executes a map operation, converting an input list into an output list, in parallel.</summary>
    /// <typeparam name="TInput">Specifies the type of the input data.</typeparam>
    /// <typeparam name="TOutput">Specifies the type of the output data.</typeparam>
    /// <param name="input">The input list to be mapped used the transform function.</param>
    /// <param name="parallelOptions">A ParallelOptions instance that configures the behavior of this operation.</param>
    /// <param name="transform">The transform function to use to map the input data to the output data.</param>
    /// <returns>The output data, transformed using the transform function.</returns>
    public static TOutput[] Map<TInput, TOutput>(IList<TInput> input, ParallelOptions parallelOptions, Func<TInput, TOutput> transform)
    {
        if (input == null) throw new ArgumentNullException("input");
        if (parallelOptions == null) throw new ArgumentNullException("parallelOptions");
        if (transform == null) throw new ArgumentNullException("transform");
    
        var output = new TOutput[input.Count];
        Parallel.For(0, input.Count, parallelOptions, i => output[i] = transform(input[i]));
        return output;
    }
    • Public Snippets
    • Channels Snippets