Citrix Receiver

# sudo dpkg -i icaclient_13.1.0.285639_amd64.deb 
# sudo apt-get -f install
# cat /var/lib/dpkg/info/icaclient.list
# cp /home/martin/Downloads/DigiCertHighAssuranceEVRootCA.crt /opt/Citrix/ICAClient/keystore/cacerts
Citrix ICA Client: SSL Error 61
You have not chosen to trust 'Digicert High Assurance CA-3'

DigiCert Trusted Root Authority Certificates
Citrix Certificate Error: How to manually upgrade your Citrix Certificate
Citrix Client SSL Error Codes

* 0 Everything is fine *
* 1 Redo handshake before other things *
* 2 Handshake loop is complete *
* 3 An error occurred that cannot be further defined *
* 4 An error occurred while reading *
* 5 An error occurred in the provider. No further information is available *
* 6 A required library is missing *
* 7 A required library has no entry point? *
* 8 Initialization (of whatever was being initialized, library) failed *
* 9 There is no memory left for the application to use *
* 10 Can’t locate your certificate. *
* 11 Your certificate isn’t in a format readable by the provider *
* 12 You do not have permission to access the specified certificate *
* 13 The SSL package isn’t there (SChannel specific) *
* 14 Can’t work to the cipher strength required *
* 15 The context has expired or isn’t properly initialized *
* 16 The buffer read isn’t a valid SSL packet *
* 17 The buffer read isn’t a valid socks 5 packet *
* 18 Your SSL packet has been modified illegally *
* 19 Your SSL packet is out of sequence *
* 20 The data received is not a complete packet *
* 21 The server response to socks hello is bad *
* 22 The server response to socks connect request is bad *
* 23 We do not support the given address type *
* 24 Send the given buffer, and terminate the communication (SChannel specific) *
* 25 Do socks 5 server side redirection before completing handshake (SChannel specific) *
* 26 Unable to open the specified keystore *
* 27 Unable to find the specified identity cert *
* 28 The socket given to a function is not of the right type (SChannel specific) *
* 29 The socks 5 handshake broke down in an unspecified manner *
* 30 The buffer supplied is not big enough for all the data *
* 31 The SDK context supplied is not valid for the function called *
* 32 The clients socks 5 hello is bad *
* 33 The clients connect request is bad *
* 34 The socks 5 command requested is not supported *
* 35 The socks 5 server refuses to redirect to the required destination *
* 36 The destination network requested is inaccessible *
* 37 The destination host requested is unreachable *
* 38 Connection to the destination host requested is refused *
* 39 The TTL on the packet sent the destination host requested expired *
* 40 The hostname could not be resolved *
* 41 A socket could not be created *
* 42 Connection to the host is refused *
* 43 A close notify alert was received *
* 44 An unexpected message alert was received *
* 45 A bad mac alert was received *
* 46 A decompression failure alert was received *
* 47 A handshake failure alert was received *
* 48 A no certificate alert was received *
* 49 A bad certificate alert was received *
* 50 An unsupported certificate alert was received *
* 51 A certificate revoked alert was received *
* 52 A certificate expired alert was received *
* 53 A certificate unknown (untrusted) alert was received *
* 54 An illegal parameter alert was received *
* 55 An unknown alert was received (probably TLS alert) *
* 56 Unable to set the CA certs verify path (OpenSSL specific) *
* 57 Unable to set identity certificate *
* 58 Unable to set private key *
* 59 The common name on the ID certificate is not what was expected *
* 60 (OpenSSL specific) a zero depth self signed cert was received *
* 61 (OpenSSL specific) a root cert to match the identity received could not be found locally *
* 62 (OpenSSL specific) a root cert to match the identity received could not be found at all *
* 63 (OpenSSL specific) a self signed cert was in the chain received *
* 64 (OpenSSL specific) unable to verify the signature on the leaf cert *
* 65 (OpenSSL specific) unable to decode the issuers public key *
* 66 (OpenSSL specific) unable to verify the signature on a cert *
* 67 (OpenSSL specific) the before field in the cert is corrupt *
* 68 (OpenSSL specific) the certificate is not yet valid *
* 69 (OpenSSL specific) the expiry field in the cert is corrupt *
* 70 (OpenSSL specific) the certificate has expired *
* 71 A method called is unimplemented *
* 72 The provider could not load any of the root certs in the keystore *
* 73 The provider could not load some of the root certs in the keystore *
* 74 Client authentication failed *
* 75 The connection timed-out *
* 76 A server certificate was revoked *
* 77 No CRL could not be retrieved for one of the certificates *
* 78 Revocation support is not available *

Additional Resources

Schengen Visa Visum

Aeroflot Pass- und Zollkontrolle

Die erste Einreise in den Schengen-Raum mit dem Multi-Visum soll nur durch das Land erfolgen, das dieses Visum erteilt hat; die weiteren Einreisen sind durch ein anderes Schengen-Land zulässig.

BFM Berechnung des kurzfristigen Aufenthalts / Aufenthaltsrechner

Ein- und Ausreiseflughafen spielen keine Rolle, so lange Sie sich maximal 90 Tage je Bezugszeitraum von 180 Tagen im Schengenraum aufhalten. Die Anzahl Einreisen bezieht sich auf das gesamte Gebiet des Schengenraums, nicht auf einen einzelnen Mitgliedstaat (wenn auf dem Visum nichts anderes vermerkt ist). Somit kann innerhalb des Schengenraums mit demselben Visum gereist werden, solange dieses noch gültig ist.

BFM Kurzfristiger Aufenthalt: Einreisevoraussetzungen in die Schweiz
BFM Visumvorschriften
BSM FAQ – Häufig gestellte Fragen
Weisungen und Kreisschreiben: Aufenthalt bis 90 Tage

Erläuterung Zweck der Visaerteilung vom polnischen Konsulat
“01” – gdy wiza jest wydawana w celu turystycznym;
“02” – gdy wiza jest wydawana w celu odwiedzin u rodziny lub przyjaciół;
“03” – gdy wiza jest wydawana w celu udziału w imprezach sportowych;
“04” – gdy wiza jest wydawana w celu prowadzenia działalności gospodarczej;
“05” – gdy wiza jest wydawana w celu wykonywania pracy przez cudzoziemca w okresie nieprzekraczającym 6 miesięcy w ciągu kolejnych 12 miesięcy, na podstawie oświadczenia o zamiarze powierzenia wykonywania pracy zarejestrowanego w powiatowym urzędzie pracy;
“06” – gdy wiza jest wydawana w celu wykonywania pracy na podstawie dokumentów innych niż określone w art. 60 ust. 1 pkt 5 ustawy;
“07” – gdy wiza jest wydawana w celu prowadzenia działalności kulturalnej lub udziału w konferencjach organizowanych w związku z prowadzeniem takiej działalności;
“08” – gdy wiza jest wydawana w celu wykonywania zadań służbowych przez przedstawicieli organu państwa obcego lub organizacji międzynarodowej;
“09” – gdy wiza jest wydawana w celu odbycia studiów pierwszego stopnia, studiów drugiego stopnia lub jednolitych studiów magisterskich albo studiów trzeciego stopnia;
“10” – gdy wiza jest wydawana w celu szkolenia zawodowego;
“11” – gdy wiza jest wydawana w celu kształcenia się lub szkolenia w innej formie niż określona w art. 60 ust. 1 pkt 9 lub 10 ustawy;
“12” – gdy wiza jest wydawana w celu dydaktycznym;
“13” – gdy wiza jest wydawana w celu prowadzenia badań naukowych lub prac rozwojowych;
“14” – gdy wiza jest wydawana w celu leczenia;
“15” – gdy wiza jest wydawana w celu dołączenia do obywatela państwa członkowskiego Unii Europejskiej, państwa członkowskiego Europejskiego Porozumienia o Wolnym Handlu (EFTA) – strony umowy o Europejskim Obszarze Gospodarczym lub Konfederacji Szwajcarskiej lub przebywania z nim;
“16” – gdy wiza jest wydawana w celu udziału w programie wymiany kulturalnej lub edukacyjnej, programie pomocy humanitarnej lub programie pracy wakacyjnej, a w przypadku gdy program jest uregulowany umową międzynarodową, której Rzeczpospolita Polska jest stroną, na naklejce wizowej zamieszcza się także nazwę programu;
“17” – gdy wiza jest wydawana w celu przybycia na terytorium Rzeczypospolitej Polskiej jako członek najbliższej rodziny repatrianta;
“18” – gdy wiza jest wydawana w celu korzystania z uprawnień wynikających z posiadania Karty Polaka;
“19” – gdy wiza jest wydawana w celu repatriacji;
“20” – gdy wiza jest wydawana w celu korzystania z ochrony czasowej;
“21” – gdy wiza jest wydawana w celu przyjazdu ze względów humanitarnych, z uwagi na interes państwa lub zobowiązania międzynarodowe;
“22” – gdy wiza jest wydawana w celu realizacji zezwolenia na pobyt czasowy w celu łączenia rodzin;
“23” – gdy wiza jest wydawana w celu innym niż określony w art. 60 ust. 1 pkt 1-24 ustawy.

Linux Network Programming

Manual Pages

getifaddrs, freeifaddrs – get interface addresses
packet – packet interface on device level

NETLINK

Generic NETLINK HowTo
Netlink Sockets in C using the 3.X linux kernel

Tutorials & Blogs

Code Snippet: getifaddrs
Get the IP address of the machine
How to get MAC address of your machine using a C program?
How to get local IP and MAC address C [duplicate]
MAC address with getifaddrs (wrong answer!!)

Code Stippet

lldpd/src/daemon/interfaces-linux.c
Get network interface’s MAC address and IP address

#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/param.h>

#include <netinet/in.h>
#include <net/ethernet.h>
#include <net/if.h>

#include <linux/if_link.h>
#include <linux/if_vlan.h>
#include <linux/sockios.h>

#include <ifaddrs.h>

bool
netif_init(netif_t *netif, const char *name)
{
    bool                        result = true;
    int                         sockfd;
    struct ifaddrs             *ifas;
    struct ifaddrs             *ifa;
    struct ifreq                ifr;
    struct rtnl_link_stats     *stats;
    struct vlan_ioctl_args      ifv;
    
    /* string copy name */
    strncpy(netif->name, name, NETIF_NAME_SIZE);
    
    /* create socket (required for ioctl) */
    if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
        LOG_ERRNO(LOG_NETWORK_INTERFACE, LOG_ERROR, errno, ("socket failed"));
        return false;
    }
    
    /* get interface addresses */
    if (getifaddrs(&ifas) != 0) {
        return false;
    }
    
    for (ifa = ifas; ifa != NULL; ifa = ifa->ifa_next) {
        if ((ifa->ifa_addr)           == NULL) continue;
        if ((ifa->ifa_flags & IFF_UP) == 0)    continue;
        
        
        /* network interface name matches */
        if (strcmp(name, ifa->ifa_name) == 0) {
            
            switch (ifa->ifa_addr->sa_family) {
                case AF_INET:   netif_add_ipv4_address(netif,      IPV4_ADDRESS(&(INADDR(ifa->ifa_addr)->sin_addr)),
                                                                   IPV4_ADDRESS(&(INADDR(ifa->ifa_netmask)->sin_addr)),
                                                                   IPV4_ADDRESS(&(INADDR(ifa->ifa_broadaddr)->sin_addr)),
                                                                   NULL);
                                break;
                
                case AF_INET6:  netif_add_ipv6_address(netif,      IPV6_ADDRESS(&(INADDR6(ifa->ifa_addr)->sin6_addr)),
                                                                   IPV6_ADDRESS(&(INADDR6(ifa->ifa_netmask)->sin6_addr)),
                                                                   IPV6_STATE_VALID);
                                break;

                case AF_PACKET: stats = ifa->ifa_data;
                                LOG_PRINTLN(LOG_NETWORK_INTERFACE, LOG_DEBUG, ("tx packet: %" PRIu32 " rx packet: %" PRIu32 " tx bytes: %" PRIu32 " rx bytes: %" PRIu32,
                                                                               stats->tx_packets, stats->rx_packets, stats->tx_bytes, stats->rx_bytes));

                                bzero((char *) &ifr, sizeof(ifr));
                                strncpy(ifr.ifr_name, netif->name, NETIF_NAME_SIZE);
                                if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) != -1) {
                                    netif_add_mac_address(netif,   MAC_ADDRESS(LLADDR(LADDR(ifr.ifr_hwaddr.sa_data))));
                                    bzero((char *) &ifv, sizeof(ifv));
                                    ifv.cmd = GET_VLAN_VID_CMD;
                                    strncpy(ifv.device1, netif->name, sizeof(ifv.device1));
                                    if (ioctl(sockfd, SIOCGIFVLAN, &ifv) != -1) {
                                        netif_add_vid(netif, ifv.u.VID);
                                    }
                                } else {
                                    LOG_PRINTLN(LOG_NETWORK_INTERFACE, LOG_ERROR, ("couldn't get MAC address"));
                                    result = false;
                                    goto netif_init_exit;
                                }
                                break;

                default:        continue;
            }
        }
    }
    
netif_init_exit:
    freeifaddrs(ifas);

    return result;
}
$ grep -r vlan_ioctl /usr/include
/usr/include/linux/if_vlan.h:/* Passed in vlan_ioctl_args structure to determine behaviour. */
/usr/include/linux/if_vlan.h:enum vlan_ioctl_cmds {
/usr/include/linux/if_vlan.h:struct vlan_ioctl_args {
/usr/include/linux/if_vlan.h:	int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */

C Macro Test with GCC

$ echo '__FreeBSD__ ' | gcc -E -
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"
__FreeBSD__    <== no replacement --> no macro defined

$ echo '__linux__ ' | gcc -E -
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"
1    <== replacement --> macro defined

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