- a simple url encoder/decoder

 a simple url encoder/decoder


Wirtschaft (139) Österreich (108) Pressefreiheit (94) IT (74) code (45) Staatsschulden (37) EZB (27) Pensionssystem (15) music (3) France (1) Israel (1)
Posts mit dem Label code werden angezeigt. Alle Posts anzeigen
Posts mit dem Label code werden angezeigt. Alle Posts anzeigen


A crazy example of a Lazy singleton as strangest singelton pattern ever

A crazy example of a Lazy<T> Singelton with privat constructor 
inherited form
an protected DoubleLockInstance singelton with private empty and protected parameter constructor
inherited form
an abstract singelton template with protected constructor

Application settings example:

BaseSets for basic settings as abstract singelton base

using System;using System.Reflection;
namespace{    /// <summary>    /// abstract class BaseSets     /// </summary>    [Serializable]    public abstract class BaseSets    {        public string AssemblyName { get => Assembly.GetExecutingAssembly().GetName().ToString(); }        public string Copyright { get => "GNU LIGHT GENERAL PUBLIC LICENSE 2.0 LGPL"; }        public virtual string AssemblyCom { get => ""; }
        public virtual int AppId { get; protected set; }        public virtual string AppName { get; protected set; }        /// <summary>        /// protected empty constructor for inheritable singelton        /// </summary>        protected BaseSets() { }         /// <summary>        /// protected parameterized constructor for inheritable singelton        /// </summary>        protected BaseSets(int appId, string appName)        {            AppId = appId;  AppName = appName;        }    }}

AppSets for application settings as instancable singelton default app sets (settings):

using Microsoft.Win32;
using System;
using System.Reflection;
using System.Windows.Forms;

    public interface IAppSetsDomain : IAppDomainSetup    {        System.AppDomain AppCurrentDomain { get; }    }    /// <summary>
    /// application settings singelton    /// </summary>
    [Serializable]    public class AppSets : BaseSets, IAppDomainSetup
private static AppSets _appSets;
        private static object  _initLock, _sndLock;
        protected static AppSets DoubleLockInstance {            get {                _sndLock = new System.Object();                lock (_sndLock)  {                    if (_initLock != null) _initLock = null;
                    if (_initLock == null) _initLock = new System.Object();                    lock (_initLock) {                       if (_appSets == null)                            _appSets = new AppSets();                    }                    return _appSets;                }            }        }        public string CodeBase { get => Assembly.GetExecutingAssembly().CodeBase; }
        public string BaseDirectory { get => AppDomain.CurrentDomain.BaseDirectory; }        public string AppDataPath { get => Application.CommonAppDataPath; }        public RegistryKey AppDataRegistry { get => Application.CommonAppDataRegistry; }

        #region implementing interface IAppSetsDomain, IAppDomainSetup        
        public AppDomain AppCurrentDomain { get => AppDomain.CurrentDomain; }
        public string ApplicationBase get set; }
        public string ApplicationNameget set; }
        public string CachePathget set; }
        public string ConfigurationFileget set; }
        public string DynamicBase get set; }
        public string LicenseFile get set; }
        public string PrivateBinPath get set; }
        public string PrivateBinPathProbe get set; }
        public string ShadowCopyDirectories get set; }
        public string [] ShadowCopyDirectoryArray { 
                get => ShadowCopyDirectories.Split(';'); }
        public bool FilesShadowCopy { get set; }
        public string ShadowCopyFiles { 
            get => FilesShadowCopy.ToString().ToLower();
            set { FilesShadowCopy = Boolean.Parse(value); }
        public bool FilesShadowCopyget set; }
        public string ShadowCopyFilesget => FilesShadowCopy.ToString() set; }
        #endregion implementing interface IAppSetsDomain, IAppDomainSetup        

        /// <summary>        /// static constructor         /// </summary>        static AppSets() {
_initLock = new System.Object();
lock (_initLock) { _appSets = new AppSets(); }
        /// <summary>        /// private empty constructor         /// </summary>        private AppSets() {            AppId = AppDomain.CurrentDomain.Id;            AppName = Assembly.GetExecutingAssembly().FullName;                      }
        /// <summary>        /// protected parameter constructor         /// </summary>        protected AppSets(int appId, string appName) : base(appId, appName) { }

Sealed MyAppSets for application specialized appSets as Lazy<T> singelton:

using System;
using System.IO; using System.Security;
/* ... */using Microsoft.Win32;/* ... */using Windows.Forms; namespace { /// <summary> /// my application settings singelton /// </summary> [Serializable] public sealed class MyAppSets : AppSets { /// <summary> /// private static readonly Lazy<T> self containing private real singelton unique instance /// </summary> private static readonly Lazy<MyAppSets> _instance = new Lazy<MyAppSets>(() => new MyAppSets(AppDomain.CurrentDomain.Id, "LazyApp")); /// <summary> /// static instance getter for Singeltion /// </summary> public static MyAppSets Instance { get => _instance.Value; } public string UserAppDataPath { get => Application.UserAppDataPath; } public RegistryKey UserAppDataRegistry { get => Application.UserAppDataRegistry; } /// <summary> /// private constructor with partameters for sealed unique singelton /// </summary> private MyAppSets(int appId, string appName) : base(appId, appName) { } /// <summary> /// Gets name value pair for application registry key saved in registry scope for current user /// </summary> /// <param name="regName">registry name identifier</param> /// <param name="subKey">subKey in scope of current user</param> /// <returns>object value</returns> /// <exception cref="ApplicationException">application exception with detailed inner exception</exception> public object GetUserRegValuey(string regName, string subKey = null) { object o = null; RegistryKey key = null; Exception ex = null; try { key = (subKey == null) ? UserAppDataRegistry : UserAppDataRegistry.OpenSubKey(subKey, false); o = key.GetValue(regName); } catch (SecurityException sex) { ex = sex; } catch (ObjectDisposedException odEx) { ex = odEx; } catch (UnauthorizedAccessException uaEx) { ex = uaEx; } catch (IOException ioeEx) { ex = ioeEx; } finally { if (key != null && subKey != null) key.Close(); if (ex != null) throw (new ApplicationException("Error accessing registy key: " + $"{UserAppDataRegistry}\t name: {regName}\t subkey: {subKey}", ex)); } return o; } /// <summary> /// Set Value for UserAppDataRegistry /// </summary> /// <param name="regName">registry name </param> /// <param name="value"value to set></param> /// <param name="subKey">subKey</param> /// <returns>void means nothing</returns> /// <exception cref="ApplicationException">application exception with detailed inner exception</exception> public void SetUserReg(string regName, object value, string subKey = null) { RegistryKey key = null; Exception ex = null; try { key = (subKey == null) ? UserAppDataRegistry : UserAppDataRegistry.OpenSubKey(subKey, true); key.SetValue(regName, value); } catch (Exception anyEx) { ex = new ApplicationException($"Error setting value=" + $"{value} for name={regName} inside registry key: {key.Name}", anyEx); } finally { if (key != null && subKey != null) key.Close(); if (ex != null) throw ex; } } } }

Accessing MyAppSets singelton inside any entity, framework,  helper, [...] class

using System;/*  */using;
public class MyEntity : IAppSetsDomain {
  /* ... */
  /* [Inject*/  /* ... */  public AppDomain AppCurrentDomain     get => MyAppSets.Instance.AppCurrentDomain;     set => MyAppSets.Instance.AppCurrentDomain = value;  }  /* ... */  }


some ideas to Azure & Microsoft SQL Servers [Draft]

What is missing?

It's missing, that we have unfortunatley no consistently implementation for Active Directory (see also: LDAPS, X.500) on Micrsoft SQL-Server.

How fast are Linked Servers & Distributed Transaction coordinator

Trust me, they are really fast and OAUTH and Azure Auth would be implemented in some weeks, if MS put some lower evangelists at work!

To be continued ...



Most bogus random generator service for linux

on PasteBin:


nanos=`date +%N`;
secIGSO=`date +%s` 

urandomseek=`echo "$secIGSO  - $nanos" |bc` 

echo "\tsince1970-01-01.secs:\t$secIGSO - current.nanos:\t$nanos = urandomseek:\t$urandomseek" ;
echo "exec od -j $urandomseek -N `date +%S` /dev/urandom " ;

od -j $randomseek -N `date +%S` /dev/urandom 

Urandom service


How to install LineageOS on Alcatel1 (5033D)

0. Attention: You can destroy or brick your phone totally, if something went wrong.
Unless you don't exactly know all fundamentals about android adb, fastboot, boot process and slot A/B, please don't do this:

1. install adb and fastboot on your linux or windows system

2. Enable developer options by clicking 5x times on build number in system settings

3. enable USB debugging and unlock OEM in developer options and debugging options after you became a developer

4. follow now the instructions here to unlock your phone:

5. Download LineageOS either from:

5.1 Andy Yan's personal builds, e.g.: LineageOS16 OR

5.2 github phhusson    OR

5.3 My Google Drive (You can find all diskdump images directly here)

6. connect your Alcatel1 to your PC

7. now use "adb devices -l" to see, if android Alcatel1 is present 

7.1 if you use Andy Yan's personal builds or phhusson github, then "adb reboot recovery"
      Wait until recovery mode is ready, then

  • Wipe cache first
  • Wipe data / factory reset next
  • enable adb next
  • load image from adb
  • Under Windows or Linux type "adb sideload lineage-1*.img" 
7.2 if you are using my img files from diskdump folder, you can
  • modify the images by mounting them with 'mount -o loop path2image/file.img /mnt' under linux
  • now you can modify e.g. the loopback mounted system.img for your own purpose.
  • flush, sync and then 'mount -o remount,ro  /mnt
  • look if all modifications are done well and then 'umount  /mnt
  • now use adb shell to reboot to bootloader by "adb reboot bootloader"
  • yet use "fastboot flash system path2image/system.img


Draft: Idea a multiple device dark net (.onion) cloud

 We've Azure Cloud with microservices, we have amazon cloud, with finest virtualization, but both are companies under patriot act and safe habor agreement. Some months / years ago, there where a lot of tor (dark net) bridges and endpoints in both of those clouds, but if the stock owners decide to prevent TOR in future, you're totally pissed on and you have no legal ability against that.

So lets build a onion scalable cloud, that uses each device with less CPU load and some SSD or similiar fast disk, to build a docker / virtual machine dark net cloud.


Heinrich Elsigan AGB


Heinrich Georg Elsigan




Theresianumgasse 6/28, 1040 Wien








  1. Umfang der Allgemeinen Geschäftsbedingungen

    1. Die Allgemeinen Geschäftsbedingungen unterliegen der EU-Grundrechte Charta und der Gewerbeordnung.

    2. Jede einzelne Leistungserbringung muss in einem neuen dafür vorgesehen Vertrag vereinbart werden, Ausnahmen gelten hierfür nur für 10 Stammkunden innerhalb der Europäischen Union und des Vereinigten Königreichs (UK).

    3. Weitergabe der Leistungen an dritte oder vervielfältigen der auftragsgefertigten Software des Unternehmens erfordern eine explizite Klausel in einem schriftlichen Vertrag, sofern sie per GPL (Gnu General Public License), Apache License oder einer anderen üblichen Open Software Lizenz lizenziert wurden.

    4. Der Unternehmer bevorzugt per se Open Source und die GPL und öffentliche GIT Source Verwaltung Repositories, einige seiner Kunden haben explizit bei Auftragserteilung auf © (Copy Right) und Closed Source bestanden.

    5. Sollten Bibliotheken. Funktionen, Text- und Bildelemente aus bestehender unter der GPL lizenzierten Software in ein neues Projekt unter einer nicht offenen Lizenz wiederverwendet werden oder aus anderen Projekten einer Open Source lizenzierten Quelle stammen, bleiben diese Komponenten natürlich weiterhin Open Source und müssen vertragsgemäß nach GNU General Public License verwendet und  bei Anfrage darüber Auskunft erteilt werden. Bei einem gerichtlichen Streitfall hat die Open Software Foundation und andere GNU Institutionen hier möglicherweise Rechtsansprüche.

  1. Spezielle Konditionen

    1. Da der Unternehmer seit 2008 an einer schizoaffektiven Störung leidet und dadurch partiell gehandicapt ist, bedarf es einer expliziten Vereinbarung, sollte die Leistungserbringung außerhalb der gewohnten Umgebung oder des Standorts Europa, bzw. Vereinigtes Königreich und beauftragt werden.

    2. Jegliche Ton- und Bildaufnahmen von der Arbeit des Unternehmers erfordern explizite notariell beglaubigte Verträge aufgrund des Handicaps des Unternehmers.

    3. Anwendung oder Installation von Filtern bei der elektronische Kommunikation (TCPIP z.B. http Filter) oder in das OS eingebaute Anzeigefilter, die ohne rechtliche schriftliche Verträge, mit Heinrich Elsigan Einzelunternehmer durch Dritte (Internet Service Provider oder Betriebssystem Hersteller) sind per se nicht erlaubt.

    4. Direkte Überwachung des Bildschirms, jeglicher anderer Ausgabegeräte, sowie der Tastatur, Maus und anderer Eingabegeräte während der Arbeit des Unternehmers durch Auftraggeber. Internationale Organisationen erfordern notariell beglaubigte Verträge.