Month: May 2020

Forward the $term variable to debian the xshell-way

Xshell is yet another putty-like terminal client for windows that features a couple of nice extensions. See the net for a multitude of alike “top-10 terminal clients for windows” posts. Among the features, Xshell does not only provide a raw terminal pane but also runs a so called local shell that actually embeds remote shells. In other words, initially (standard configuration) you get your xshell window, running the Xshell shell and offering a number of internal commands to act in the realm of Xshell by means of simple keystrokes. If you’re addicted to the keyboard, like me, this is a very pleasent way to go. For example, see the help output, a list of available sessions (connect profiles already configured) and an open to eventually connect to the remote host:

Anything keyed and, by the way, the session name even tab-expanded after a few characters. Cool, right?

Ok, that much for the preface, important to understand what followes next, the forwarding of a dedicated environment setting, namely TERM=xterm-256color with this terminal client (see why e.g.: https://fedoraproject.org/wiki/Features/256_Color_Terminals#Caveats, see others e.g.: https://codeyarns.github.io/tech/2015-03-18-how-to-set-term-to-xterm-256color.html).

The point is, based on the local shell, Xshell is able to inject/communicate code the the remote shell in an after-login but pre-(final-)prompt fashion. All you need to do is to code a snippet to call some member functions of the current local shell Screen object. Three language binding are possible so far: js, py and vbs. Examples are given in AppData\Local\NetSarang Computer\6\Xshell\Scripts\ScriptSample, documentation resides as https://netsarang.atlassian.net/wiki/spaces/ENSUP/pages/135136512/Using+Scripts . In order to achive the forward, the following code is sufficient (don’t ask my why a sleep is needed here):

def Main():
	xsh.Screen.Synchronous = True  # True or False
	xsh.Screen.Send("export TERM=xterm-256color\r")
	xsh.Session.Sleep(1000)

The file location can be configured in the sessions connect profile dialog like so. Done!

After all, the tiled and full screen view modes are also worth a try. Like it.

Enjoy

Remove a user id from a pgp key along gpg4win

Gpg4win, we’re speaking Windows here, comes with Kleopatra, a Qt-App from the KDE realm, to manage keys, called certificates, encrypt/decrypt/verify files and mails and so forth. Kleopatra is a nice piece of software and supplies almost any functionality you need in the branch. However, concerning certificate user id’s, mostly names and email-adresses in this context, Kleopatra does yet only provide adding. A delete or update (delete/insert) has not yet been instrumented (*1).
Fortunately, Gpg4win does include a full distrubution of GnuPG located as c:\Program Files (x86)\GnuPG, such that we have the full toolset of the used-to gpg command line at our disposal. According to https://crypto.stackexchange.com/questions/9403/how-can-i-remove-my-personal-data-from-my-pgp-public-key , we just need a couple of commands to delete user id #1 as follows:

C:\Windows\System32>gpg -k
C:/Users/???/AppData/Roaming/gnupg/pubring.kbx
-----------------------------------------------
pub   ??? ??? [SC]
      ???
uid        [ ultimativ ] ??? <???>
uid        [ ultimativ ] ??? <???>
sub   ??? ??? [E]

C:\Windows\System32>gpg --edit-key ???
Geheimer Schlüssel ist vorhanden.
sec ...
[ ultimativ ] (1). ??? <???>
[ ultimativ ] (2)  ??? <???>

gpg> uid 1
sec ...
[ ultimativ ] (1)* ??? <???>
[ ultimativ ] (2)  ??? <???>

gpg> deluid
Diese User-ID wirklich entfernen? (j/N) j
sec ...
[ ultimativ ] (1)  ??? <???>

gpg> save

Kleopatra will notice ad hoc, cool. Enigmail does only show the primary user id anyway, so it might change in view, depending on the level of the user id deleted.

Have fun

(*1) If you’re with key servers, you should better think of revoking user id’s because in a key server environment, key metadata will always be merged to a set union. That is, nothing will be deleted really.

Ps. If you’re also suprised to find Kleopatra running in german but by principle prefer english for efficient wording, do find the language settings NOT Settings BUT with the Help main menu item 😉