Monthly Archives: July 2015

TigerVNC with CentOS

VNC (Virtual Network Computing)
How to install VNC server on CentOS 6

# yum install vnc-server
or
# yum install tigervnc-server
$ su -
# useradd larry
# useradd moe
# useradd curly
# passwd larry
# passwd moe
# passwd curly
VNCSERVERS="1:larry 2:moe 3:curly"
VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 640x480"
VNCSERVERARGS[3]="-geometry 800x600"

Recovery from a logout (Not implemented for CentOS 6)

If you logout of your desktop manager, it is gone!

$ ps aux | grep andreas
andreas    446  0.0  0.0  20040   636 ?        S    May06   0:00 dbus-launch --sh-syntax --exit-with-session
andreas    447  0.0  0.0  36544  1684 ?        Ssl  May06   0:07 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
andreas    560  0.0  0.2 581832 84144 ?        Ssl  May06  10:20 /usr/libexec/gnome-settings-daemon
andreas    564  0.0  0.0 293540  7976 ?        Ss   May06   0:00 seahorse-daemon
andreas    568  0.0  0.0 137216  2072 ?        S    May06   0:00 /usr/libexec/gvfsd
andreas    595  0.0  0.0 255504  6740 ?        S    May06   0:00 /usr/libexec/gdu-notification-daemon
andreas    597  0.0  0.0 485748 11608 ?        Sl   May06   0:15 gpk-update-icon
andreas    599  0.0  0.0 363212  3760 ?        Ssl  May06   0:00 /usr/bin/pulseaudio --start --log-target=syslog
andreas    601  0.0  0.0 235732  5344 ?        S    May06   0:02 abrt-applet
andreas    605  0.0  0.0 364236  7724 ?        S    May06   0:10 /usr/libexec/evolution/2.32/evolution-alarm-notify
andreas    608  0.0  0.0 276476  8148 ?        S    May06   0:03 bluetooth-applet
andreas    617  0.0  0.0 470144 11232 ?        S    May06   0:00 gnome-volume-control-applet
andreas    619  0.0  0.0 146232  3124 ?        S    May06   0:00 /usr/libexec/gvfs-gdu-volume-monitor
andreas    620  0.0  0.0  30164  5216 ?        S    May06   0:00 /usr/sbin/restorecond -u
andreas    622  0.0  0.0 299516 11792 ?        Sl   May06   0:11 /usr/libexec/polkit-gnome-authentication-agent-1
andreas    629  0.0  0.0 324324 19408 ?        S    May06   0:01 python /usr/share/system-config-printer/applet.py
andreas    636  0.0  0.0 115100  3964 ?        S    May06   0:00 /usr/libexec/im-settings-daemon
andreas    648  0.0  0.0 148232  3152 ?        S    May06   0:00 /usr/libexec/gvfsd-trash --spawner :1.8 /org/gtk/gvfs/exec_spaw/0
andreas    687  0.0  0.0 264788  6504 ?        Ss   May06   1:57 gnome-screensaver
andreas    707  0.0  0.0 232444  2064 ?        Sl   May06   4:20 /usr/libexec/gvfs-afc-volume-monitor
andreas    711  0.0  0.0 150896  2192 ?        S    May06   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
andreas    807  0.0  0.0  95228  2628 ?        S    May06   0:00 /usr/libexec/pulse/gconf-helper
andreas    822  0.0  0.0  40900  2252 ?        S    May06   0:00 /usr/libexec/gconf-im-settings-daemon
andreas    839  0.0  0.0 135096  1800 ?        S    May06   0:00 /usr/libexec/gvfsd-metadata
andreas    841  0.0  0.0 141484  2336 ?        S    May06   0:00 /usr/libexec/gvfsd-burn --spawner :1.8 /org/gtk/gvfs/exec_spaw/1
andreas  16254  0.2  0.0 633208 24604 ?        Sl   17:30   0:04 nautilus
andreas  16260  0.0  0.0 451640 13056 ?        Sl   17:30   0:00 metacity
root     16426  0.8  0.0 102460  4316 ?        Ss   17:56   0:00 sshd: andreas [priv]
andreas  16430  0.1  0.0 102460  2000 ?        S    17:56   0:00 sshd: andreas@pts/8
andreas  16431  0.2  0.0 108340  1796 pts/8    Ss   17:56   0:00 -bash
andreas  16461  0.0  0.0 110240  1160 pts/8    R+   17:56   0:00 ps aux
andreas  16462  0.0  0.0 103256   852 pts/8    S+   17:56   0:00 grep andreas
andreas  51516  0.0  0.0 133476  5540 ?        S    Jul22   0:14 /usr/libexec/gconfd-2
andreas  65244  0.0  0.1 126628 50508 ?        S    May06   1:17 /usr/bin/Xvnc :21 -desktop srv-fpga:21 (andreas) -auth /home/andreas/.Xauthority -geometry 1280x1024 -rfbwait 30000 -rfbauth /home/andreas/.vnc/passwd -rfbport 5921 -fp catalogue:/etc/X11/fontpath.d -pn
#!/usr/bin/env bash

if [ -z "${USER}" ]; then
    echo "no environment variable USER set"
    exit -1
fi

PID=

pid() {
    PID=$(ps aux | grep ${USER} | grep Xvnc | grep -v grep | awk '{print $2}')
}

start() {
    echo "==> Start vncserver"
    DISPLAY=$(cat /etc/sysconfig/vncservers | grep ${USER} | awk -v display="[0-9]+" -v user=":${USER}" '{ if (match($0, display user)) { print substr($0, RSTART, RLENGTH - length(user)); } }')
    ARGS=$(cat /etc/sysconfig/vncservers | grep "VNCSERVERARGS\[${DISPLAY}\]" | cut -d '"' -f2)
    echo "    display=${DISPLAY}"
    echo "    arguments=${ARGS}"
    vncserver :${DISPLAY} ${ARGS}
}

stop() {
    echo "==> Stop vncserver"
    kill ${PID}
}

pid

case "$1" in
    start)
        if [ -n "${PID}" ]; then
            echo "vncserver (pid=${PID}) is already running"
            exit -2
        fi
        start
        ;;
        
    stop)
        if [ -z "${PID}" ]; then
            echo "vncserver is not running"
            exit -3
        fi
        stop
        ;;
        
    restart)
        if [ -n "${PID}" ]; then
            echo "vncserver (pid=${PID}) is running. Stopping"
            stop
            sleep 3
        else
            echo "vncserver is already stopped"
        fi
        start
        ;;
        
    status)
        if [ -n "${PID}" ]; then
            echo "vncserver (pid=${PID}) is running"
        else
            echo "vncserver is stopped"
        fi
        ;;
        
    *)
        echo "$0 (start|stop|restart|status)"
        ;;
        
esac

Apple Swift 2.0

Swift. Eine neue Sprache, mit der jeder fantastische Apps entwickeln kann.
Swift. A modern programming language that is safe, fast, and interactive.
Swift 5 Released!

Qt Language Bindings (Swift _NOT_ included!)

Swift: Die Rückkehr der Referenz-Zähler
Über Premature Optimization
Why Premature Optimization Is the Root of All Evil
SWIFT – DIE EINE PROGRAMMIERSPRACHE FÜR „ALLES“ ?! – TEIL1
Can I use swift code to create a Desktop Linux App?
Swift Development with Visual Studio Code — On Linux!
Swift unter Ubuntu Linux verwenden

github.com/msorvig/qt-and-swift, Qt and Swift interop research
github.com/Longhanks/qlift, Swift library to use Qt
github.com/Longhanks/swiftmine, Example using Qlift to consume Qt APIs from Swift
github.com/TomasLinhart/SwiftGtk, SwiftGtk is an experimental Gtk+ binding for Swift that tries to make usage of Gtk+ pleasant and “Swifty” as much as possible.

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

Problems with Citrix Client on Linux?
[ubuntu] HowTo Install the Citrix ICA client
CitrixICAClientHowTo

* 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.