Skip to main content

Posts

Archlinux package SQLite

I want to store my installed packages to SQLite This is mostly useless for most of people on the world, and this blog post is more a note to myself. sqlite> CREATE TABLE packages (id INTEGER PRIMARY KEY, package TEXT); sqlite> INSERT INTO packages (package) VALUES ('test'); sqlite> INSERT INTO packages (package) VALUES ('test'); sqlite> SELECT * FROM packages ; 1|test 2|test Well, I solved the "SQLIte Auto increment" question! pacman -Q \ | awk '{print "INSERT INTO packages (package) VALUES (\x27"$1"\x27);"; }' \ | sqlite3 packages.sqlite
Recent posts

php datetime offset

  With PHP I always forget how to get this date format: "2021-02-09T19:04:10+01:00" It is called the ISO 8601 format. And to have it in PHP: php > $date = Date("Y-m-d\TH:i:sP"); php > echo $date; 2021-02-09T19:04:10+01:00 Note about the Z ( reference ) The Z got its letter initial from "zero UTC offset". Letter Z is referred to as "Zulu" in the NATO phonetic alphabet . In turns, the military approach to refer to the zero UTC offset is anchored on letter Z which they identify as Zulu, earning it their coded name: Zulu time zone. It is important to note that the Z has not lost its meaning and still is the zone designator for the zero UTC offset as Zulu time zone (from Z) is simply an inherited coded language to refer to it.  So, "2021-02-09T19:04:10+00:00" is the equivalent of "2021-02-09T19:04:10Z".

usr bin env node

  /usr/bin/env: node: No such file or directory I installed my Node in "$HOME/Apps/node" and also performed local install ("npm install" things without "-g"). This leads me to the "node"  and "npm" binaries to be in  "$HOME/Apps/node/bin" and the packages binaries to be symlinked from "$HOME/node_modules/.bin". Adding  "$HOME/Apps/node/bin" and  "$HOME/node_modules/.bin" to the PATH allows me calling "node" or "npm" from a terminal, but when comes the time that my Emacs-GTK needs to call "node" or "npm", I get "/usr/bin/env: node: No such file or directory" dispit ethe fact I already made this: (add-to-list 'exec-path "/home/mihamina/Apps/node/bin") (add-to-list 'exec-path "/home/mihamina/node_modules/.bin")  For information, this is happening when it tries to launch "iph" from Intelephense .   So this basic

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": "172.18.0.0/16", "Gateway": "172.18.0.1" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, &

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")