libpcap Tutorial

$ sudo apt-get install libpcap-dev
$ cat /var/lib/dpkg/info/libpcap-dev.list 
$ cat /var/lib/dpkg/info/libpcap0.8-dev.list 

Manual Pages

pcap_dump_open
pcap_next
pcap_open_dead

Live Capture

Programming with pcap
The Sniffer’s Guide to Raw Traffic
Capturing Our First Packet

Offline Processing

Writing pcap files with fake headers?
PCAP Offline Parsing Example
Handling offline dump files

    pcap_t *pd;
    pcap_dumper_t *pdumper;

    pd = pcap_open_dead(DLT_RAW, 65535 /* snaplen */);

    /* Create the output file. */
    pdumper = pcap_dump_open(pd, "/tmp/capture.pcap");

    while (1) {
        /*
         * Create fake IP header and put UDP header
         * and payload in place
         */
        ...

        /* write packet to savefile */
        pcap_dump(pdumper, xxxx, yyyy);
    }

    pcap_close(pd);
    pcap_dump_close(pdumper);

Java jNetPCAP

API Examples
Tutorials
Offline Capture
The Main libpcap API Overview

DotNet / .NET

Pcap.Net
Handling offline dump files

Scheme pcap.egg

Schemers.org
CHICKEN Scheme
pcap.egg

Go programming language

The Go Programming Language
package pcap

PostgreSQL

Show databases

$ psql -l
or
$ psql MyDB
MyDB-# \l

                         List of databases
   Name    | Owner | Encoding | Collate | Ctype | Access privileges
-----------+-------+----------+---------+-------+-------------------
 openerp   | pgsql | UTF8     | C       | C     |
 postgres  | pgsql | UTF8     | C       | C     |
 template0 | pgsql | UTF8     | C       | C     | =c/pgsql         +
           |       |          |         |       | pgsql=CTc/pgsql
 template1 | pgsql | UTF8     | C       | C     | =c/pgsql         +
           |       |          |         |       | pgsql=CTc/pgsql
(4 rows)

Show roles/user

MyDB-# \du
                             List of roles
 Role name |                   Attributes                   | Member of
-----------+------------------------------------------------+-----------
 openerp   |                                                | {}
 pgsql     | Superuser, Create role, Create DB, Replication | {}

Change role/user

MyDB-# alter role openerp CREATEDB;
ALTER ROLE

FreeBSD pkg Package Manager

pkg = pkgng

Using pkg for Binary Package Management
PkgPrimer

Manage Packages

How To Manage Packages on FreeBSD 10.1 with Pkg


Ports vs. Binary Packages

How to update a mix of packages and ports on FreeBSD
Exclude packages from pkg upgrade

$ pkg lock <package>

poudriere

Building Packages with Poudriere
How To Set Up a Poudriere Build System to Create Packages for your FreeBSD Servers


Clean the Database

pkg clean                    # cleans /var/cache/pkg/
rm -rf /var/cache/pkg/*      # just remove it all
pkg update -f                # forces update  of repository catalog
rm /var/db/pkg/repo-*.sqlite # removes all remote repository catalogs
pkg bootstrap -f             # forces reinstall of pkg

Altera MAX II CPLD

Perfect Altera MAX II EPM240 CPLD Development Board Learn Board
1PCS NEW EPM240 Altera MAX II CPLD Development Board
1PCS New MAXII EPM570 CPLD FPGA Mini Development Board Red JTAG
CPLD core board Altera EPM240 EPM570
ALTERA Cyclone FPGA Development Board JTAG AS SPI Flash EP1C3 Quartus II CPLD
EPM570 Core Board ALTERA MAX II CPLD EPM570T100C5N Replace EPM240 FPGA DEV Board
MAX II EPM240 CPLD Development board ALTERA
Core Board ALTERA MAX FPGA CPLD Development Kits Learning Programmable Logic PLD
OpenEPM1270-S EPM1270T144C5N EPM1270 Altera CPLD MAX II Development Board Kit

FreeBSD VLAN

# ifconfig {vlan-name} create

To associate the VLAN interface with a physical interface and assign a VLAN ID, IP address, and netmask:
# ifconfig {vlan-name} {ip-address} netmask {subnet-mask} vlan {vlan-id} vlandev {physical-interface}

The following examples, all packets will be marked on egress with 802.1Q VLAN tags, specifying a VLAN ID of 5:
# ifconfig vlan5 10.0.0.1 netmask 255.255.255.0 vlan 5 vlandev em0

To remove a VLAN interface, enter:
# ifconfig {vlan-name} destroy