Skip to main content


docker network address

How to programmatically get a Docker network address [mihamina@ATS ~]$ docker network inspect [ { "Name": " ", "Id": "41d400c7e989ff6eadc051d71b6bd9f2b29a6b4549d6abec", "Created": "2021-01-19T12:39:01.579234574+03:00", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": {}, "Config": [ { "Subnet": "", "Gateway": "" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, &
Recent posts

Archlinux UK keyboard

How to setup UK keyboard on Archlinux I recently switched from an US to an UK keyboard. The US one is the default for install, almost nothing has to be done for setting it up. But once you get out of that default setup, it is easy to deal with, but you must know that: In console, UK is "uk" In Xorg / X11, UK is "gb" Then, in /etc/vconsole.conf : KEYMAP=uk And in /etc/X11/xorg.conf.d/00-keyboard.conf : Section "InputClass"         Identifier "system-keyboard"         MatchIsKeyboard "on"         Option "XkbLayout" "gb"         Option "XkbModel" "pc105" EndSection

Emacs TypeScript Development

Emacs Configuration for Typescript In order to comfortably develop on Node, React or Angular projects with Emacs, TIDE is a good solution. We have TypeScript code highlight (that is the minimum!) and code completion based on the codebase (not only on locally defined and builtins) In order to achieve that: Install Emacs (24+) Install Node Install Typescript (which will provide "tsserver") Install TIDE and some usefull dependencies Configure Emacs to use all those Node is then installed in " /home/mihamina/Apps/node-v12.18.0-linux-x64/bin ": you should add it to your PATH. Installing Typescript is done with: npm install --save typescript @types/browserify After that, "tsserver" will be in " /home/mihamina/node_modules/.bin " Then comes the installation of TIDE: With the Emacs package manager, M-x package-install , install "tide". Do the same for "web-mode", "flycheck", "company" "js2-mode" and "

Emacs append PATH

We sometimes need to add node, yarn and some other binaries to the PATH. Of course, it is possible to do it with the PATH environment variable. But to have it just inside Emacs: (add-to-list 'exec-path "/home/mihamina/.config/yarn/global/node_modules/.bin")

Jenkins invalid privatekey

Publish over SSH, Message "invalid privatekey:" With quite recent (June-July 2020) installations of Jenkins and OpenSSH, I have the following error message when using the "Deploy overs SSH" Jenkins plug-in and publishing artifacts to the target overs SSH: jenkins.plugins.publish_over.BapPublisherException: Failed to add SSH key. Message [invalid privatekey: [B@d8d395a] This problem seems to be referenced here: Just regenerate a key with the right parameters To solve it: ssh-keygen -t rsa -b 4096 Or ssh-keygen -t rsa -b 4096 -m PEM

CSharp Parse JSON

How to Parse a JSON with C# Let a JSON be: { "access_token": "2564231sdfsdf1sd", "expires_in": 3600, "token_type": "Bearer" } There are at least two ways I know to access to the values with C#: With the Deserialization way With the JSON PAth Query way Both of them requires you to install and reference The Deserialization way With this method, you have to define a class that match the JSON and then perform the deserialisation: using Newtonsoft.Json; using Newtonsoft.Json.Serialization; // You probably need more namespace SSFS { public class Token{ public string access_token {get; set;} public int expires_in {get; set;} public string token_type {get; set;} } public class Utils { string jsonString = @"{ "access_token": "2564231sdfsdf1sd", "expires_in": 3600, "token_type&

CSharp Http Custom Headers

How to send custom HTTP headers in C# I use Ranorex in order to perform UI Tests, and there went the time to mimic some Postman queries to WebServices. The Postman queries has been configured to add custom headers to some GET and POST ones. This is one of the possible ways to to that. First you need to install System.Net.Http Then, this is the code sample to do the trick is: using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using System.Net.Http; using System.Net.Http.Headers; using Newtonsoft.Json; // Depending on your use case, you might need more namespace RKTMB { public class Utils { public static HttpClient client = new HttpClient(); public static async Task PostRequest() { string p = ""; string payload = "{\"CustomerId\": 5,\"CustomerName\": \"Pepsi\"}"; HttpContent c = new StringContent(payload,Encoding.UTF8, "text/plain" );