how to install pip on windows 
As you mentioned pip doesn't include an independent installer, but you can install it easily with its predecessor easy_install.

So:

Download the last pip version from here: http://pypi.python.org/pypi/pip#downloads
Uncompress it
Download the last easy installer for Windows: (download the .exe at the bottom of http://pypi.python.org/pypi/setuptools ). Install it.
copy the uncompressed pip folder content into *C:\Python2x* folder (don't copy the whole folder into it, just the content), because python command doesn't work outside C:\Python2x folder and then : python setup.py install
Add your python c:\Python2x\Scripts to the path

You are done.

Now you can use pip install package to easily install packages as in Linux :)

http://stackoverflow.com/questions/4750 ... on-windows

[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink
iptables with mac  
Manipulace s chainy:

1.vytvořit nový chain -N
2.zrušit prázdný chain -X (INPUT, OUTPUT a FORWARD zrušit nejde)
3.změnit policy vestavěného chainu -P (uživatelské chainy policy nemají)
4.vypsat pravidla chainu -L
5.vymazat pravidla z chainu -F
6.vynulovat počítadla paketů/bajtů na všech pravidlech v chainu -Z
Implicitní policy na všech chainech je ACCEPT, ovšem u FORWARD lze změnit pomocí option 'forward=0' modulu iptable_filter. Jinak se policy mění například příkazy:
http://wiki.pvfree.net/index.php/Iptabl ... e_s_chainy


drop connections from mac
/sbin/iptables -A INPUT -m mac --mac-source 00:0F:EA:91:04:08 -j DROP


Allow port 22 from mac address 00:0F:EA:91:04:07:
/sbin/iptables -A INPUT -p tcp --destination-port 22 -m mac --mac-source 00:0F:EA:91:04:07 -j ACCEPT


You can also use FORWARD chain
/sbin/iptables -A FORWARD -i ethX -m mac --mac-source YOUR-MAC-ADDRESS-HERE -j ACCEPT


You can also use NEW and other supported states as follows so that a known MAC address can be forwarded:
/sbin/iptables -A FORWARD -m state --state NEW -m mac --mac-source YOUR-MAC-ADDRESS-HERE -j ACCEPT


How Do I Skip Certain MAC Address?
/sbin/iptables -A INPUT -p tcp --dport PORT -m mac ! --mac-source MAC-ADDRESS-HERE-TO-SKIP -j DROP
### Drop ssh access to all except our own MAC Address ###
/sbin/iptables -A INPUT -p tcp --dport 22 -m mac ! --mac-source YOUR-MAC-ADDRESS-HERE -j DROP
### Save rules ###
/sbin/service iptables save



source: http://www.cyberciti.biz/tips/iptables- ... ering.html

[ add comment ] ( 31 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
NetFlow data 
nfdump is a wonderful tool(or set of tools) for netflow data
nfdump basically used for capturing netflow data and processing them.
http://www.codedanger.com/caglar/archives/27

generate netflow data with ipt-netflow
http://sourceforge.net/projects/ipt-netflow/

get netflow data from mikrotic router
http://wh.cs.vsb.cz/sps/images/4/42/Str ... krotik.pdf


[ add comment ] ( 4 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
Caché® - fast db? should try. 
InterSystems Caché® je pokročilá objektová databáze, která poskytuje rychlost paměti zároveň s trvalostí a schopností zvládat velké objemy transakčních dat. Navíc dokáže spustit SQL dotazy rychleji než relační databáze. Caché umožňuje rychlý vývoj internetových aplikací, vysokou škálovatelnost a dotazy na transakční data v reálném čase – s minimální potřebou údržby a požadavků na hardware.

http://www.intersystems.cz/cache/index.html

[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
App warning 

/**
* The first commented line is your dabblet’s title
*/

#unsupported-browser {

padding:0.6em 2.4em;
color:#211e14;
width:70%;
background-color:#fae692;
border-bottom:1px solid #b3a569;
clear:both;
}

#unsupported-browser h4 {
font-style:italic;
}

#unsupported-browser p {
font-size: small;
}

#unsupported-browser #info-text1 {
float:left;
width:30%;
}

#unsupported-browser #info-text2 {
width:70%;
float:right;
}

#clear {
clear:both;
}



<!-- content to be placed inside <body>…</body> -->
<div id="unsupported-browser">
<div id="info-text1">
<h4>if you can't logon...</h4>
</div>
<div id="info-text2">
<h4>Application is designed to run the latest web browsers.</h4>
<p>We recommend installing the latest
<a href="http://mozilla.org/firefox/">Firefox</a>, or
<a href="http://chrome.google.com">Google Chrome</a>, or
<a href="http://ie.microsoft.com/">Internet Explorer</a>.
</p>
<p>If you are using IE 9 or later, make sure you
<a href="http://windows.microsoft.com/en-US/windows7/webpages-look-incorrect-in-Internet-Explorer">turn off
"Compatibility View"</a>.
</p>
</div>
<div id="clear">
</div>
</div>


[ add comment ] ( 2 views )   |  [ 0 trackbacks ]   |  permalink
HTML5: Doctype 
http://prohlizece.info/clanky/html5-doctype/



[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink
Change the current branch to master in git 

git checkout better_branch
git merge --strategy=ours master # keep the content of this branch, but record a merge
git checkout master
git merge better_branch # fast-forward master up to the merge


stackoverflow source

git doc on merging and branching


[ add comment ] ( 2 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
Bootstrap 
Sleek, intuitive, and powerful front-end framework for faster and easier web development


[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
Linux: tc is NOT dark magic (as i though) 
show traffic stats for pools

tc -s class show dev eth1


class htb 1:1111 parent 1:1 prio 0 rate 40000bit ceil 8152Kbit burst 1600b cburst 1598b
Sent 947099 bytes 886 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 163 borrowed: 708 giants: 0
tokens: 4750000 ctokens: 23313

class htb 1:1110 parent 1:1 prio 0 rate 40000bit ceil 8152Kbit burst 1600b cburst 1598b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 5000000 ctokens: 24531

tccs is a parser for tc statistic output. the script copy is below:


#!/usr/bin/perl -w

# copyright 2005-2008 Tomasz Pala <gotar@pld-linux.org>
# license: GPL

# usage:
# watch -d -n1 'tc -s c ls dev imq1 | tccs -f 10 2>/dev/null'

# tccs.rc file format:
# %translate = ( '1:2' => 'LAN', '1:4076' => 'pc76', '1:b238' => 'VoIP-3_29 );


#use strict;
use Getopt::Long;

#tc -s class show dev eth1 | perl -e 'undef $/; while(<>) { while (/class htb (.*?) .*?\n\s*Sent (\d+) .*?\n\s*rate (\d+)/sg) { print "Klasa: $1 Wyslano: $2 ($3bps)\n" }; };'

my $class;
my $classid;
my $parent;
my $rate;
my $ceil;
my $crate;
my $sent;
my $range;
my %tree;
my $recurse=10;
my $speedlevel=0;
my %translate;

eval `cat tccs.rc 2>/dev/null`;

GetOptions('recurse=s'=>\$recurse,
'fastest=s'=>\$speedlevel);

while(<STDIN>) {
if(/^ lended: / and $crate) {
if($rate ne $ceil) {
$range="$rate-$ceil";
} else {
$range=$rate;
}
# print "$parent: $class $classid $range $crate kb/s\n";
@{$tree{$parent}}[0]='' unless @{$tree{$parent}}[0];
push @{$tree{$parent}}, $classid;
$crate=sprintf "%8.1lf",$crate;
$sent=sprintf "%10.0lf",$sent/1024;
@{$tree{$classid}}[0]="($class) $range $crate kb/s ($sent KB)";
$crate=0;
next;
}
if(/^ Sent (\d+) bytes /) {
$sent=$1;
next;
}
if(/^ rate (\S+)(bit|bps) /) {
# print "BPS rate!\n" if $2 eq "bps";
if ($2 eq "bps") {
($crate=$1)=~s/K/*1024/;
$crate=~s/M/*1024*1024/;
$crate=eval $crate;
$crate*=8/1000;
} else {
($crate=$1)=~s/K/*1000/;
$crate=~s/M/*1000*1000/;
$crate=eval $crate;
$crate/=1000;
}
next;
}
if(/^class (\S+) (\S+:\S+) (root|parent (\S+:\S+)) .*rate (\S+) ceil (\S+)/) {
$class=$1;
$classid=$2;
$rate=$5;
$ceil=$6;
($parent=$3)=~s/parent //;
next;
}
}

my $level='';

sub my_sort {
return 0 unless $_[0];
return $_[0] cmp $_[1] unless $speedlevel;
return -1 if($a=~/^\(/);
$tree{$_[0]}[0]=~m|\(\S+\)\ \S+ \s*([\d\.]+) kb/s \(|;
my $a=$1;
$tree{$_[1]}[0]=~m|\(\S+\)\ \S+ \s*([\d\.]+) kb/s \(|;
my $b=$1;
return $b <=> $a;
}

sub list {
return if length($level)/2==$recurse;
if($_[0]) {
if(exists $translate{$_[0]}) {
printf "$level%-4s",$translate{$_[0]};
} else {
printf "$level%-4s",$_[0];
}
} else { return; }
$level.=' ';
my $rank=0;
foreach my $id (sort {my_sort($a,$b)} (@{$tree{$_[0]}})) {
if($id=~/^\(/) {
print " $id\n";
next;
} else {
$rank++;
next if $rank>$speedlevel and $speedlevel;
list($id);
}
}
$level=substr($level,2);
}

#@{$tree{'root'}}[0]="\n";
#list('root');
if(defined $tree{'root'}) {
foreach (sort {my_sort($a,$b)} (@{$tree{'root'}})) {
list($_);
}
}





htb example, htb documentation

For details refer to the HTB Home Page

#!/bin/sh
#
# Incoming traffic control
#
CT_IP1=$1
CT_IP2=$2
DEV=venet0
#
tc qdisc del dev $DEV root
#
tc qdisc add dev $DEV root handle 1: htb default 10
#
tc class add dev $DEV parent 1: classid 1:1 htb rate 100mbit burst 15k
tc class add dev $DEV parent 1:1 classid 1:10 htb rate 10mbit ceil 10mbit burst 15k
tc class add dev $DEV parent 1:1 classid 1:20 htb rate 20mbit ceil 20mbit burst 15k
tc class add dev $DEV parent 1:1 classid 1:30 htb rate 30mbit ceil 30mbit burst 15k
#
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
#
if [ ! -z $CT_IP1 ]; then
tc filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip dst "$CT_IP1" flowid 1:20
fi
if [ ! -z $CT_IP2 ]; then
tc filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip dst "$CT_IP2" flowid 1:30
fi
#
echo;echo "tc configuration for $DEV:"
tc qdisc show dev $DEV
tc class show dev $DEV
tc filter show dev $DEV
#
# Outgoing traffic control
#
DEV=eth0
#
tc qdisc del dev $DEV root
#
tc qdisc add dev $DEV root handle 1: htb default 10
#
tc class add dev $DEV parent 1: classid 1:1 htb rate 100mbit burst 15k
tc class add dev $DEV parent 1:1 classid 1:10 htb rate 10mbit ceil 10mbit burst 15k
tc class add dev $DEV parent 1:1 classid 1:20 htb rate 20mbit ceil 20mbit burst 15k
tc class add dev $DEV parent 1:1 classid 1:30 htb rate 30mbit ceil 30mbit burst 15k
#
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
#
if [ ! -z $CT_IP1 ]; then
tc filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip src "$CT_IP1" flowid 1:20
fi
if [ ! -z $CT_IP2 ]; then
tc filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip src "$CT_IP2" flowid 1:30
fi
#
echo;echo "tc configuration for $DEV:"
tc qdisc show dev $DEV
tc class show dev $DEV
tc filter show dev $DEV

Twisted is an event-driven networking engine written in Python

[ add comment ] ( 3 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
saw tooth 
the saw tooth generator with dco can be produced by connecting the tranzistor to the circuit in the video.



analog filters quick guide by ti
http://www.ti.com/lit/an/sloa093/sloa093.pdf

square wave to sine wave
http://www.electronicspoint.com/attachm ... output.jpg


[ add comment ] ( 5 views )   |  [ 0 trackbacks ]   |  permalink

<<First <Back | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | Next> Last>>