How to select session M-a in tmux using keyboard - keyboard-shortcuts

In tmux I have multiple sessions running. To switch sessions, I hit my tmux escape sequence and then the s key. The session list appears:
Now I can hit the key 4, for example, if I want to go to session blacklist.
I want to go to session g-orchestrator. Without using the arrow keys, what key combination can I hit to enter that session?

M-a means "Meta-a", which is usually Alt-a in most terminal programs (in Apple's Terminal.app you must enable the app preference "Use option as Meta key" before this will work). So, in this case, the key combination Alt-a will take you to that session directly. Additional sessions will be reachable via Alt-b, Alt-c, Alt-d, etc.

I am using iTerm2.
What did not work for me on iTerm2
Using the "Meta" setting for the left or right option key.
What worked for me on iTerm2
Holding down the escape key and hitting "a". Although weirdly enough it doesn't work consistently. Sometimes I have to release the escape key and do it again a second time.
Using the "Esc+" setting for the left or right option key. Then for example I hold down the option key and hit "a". This seems to be working fairly reliable. The setting is under Profiles > Keys > Left Option key / Right Option key, and I include a picture below:

Related

Brightness and volume key bindings not working in dwm

I'm trying to get my volume and brrightness keys to work using dwm.
I put this into dwm/config.h: https://imgur.com/IG6Qgpb.png
And also this for the keybinds.
https://imgur.com/yWfdtfV.png
So far I've tried this in my command line
sudo make uninstall
sudo make install
Then I tried to do the same in root, but that didn't change anything either
I also killed xsessions and booted everything up again and it still doesn't seem to be changing anything.
You probably forgot to import XF86keysym. You can do that by pasting #include <X11/XF86keysym.h> on top of your file. I'm no C pro but I was able enabling my volume and brightness keys using this gist. After that import your keys will probably work.
If you are a laptop user and have no dedicated keys for sound/brightness you have to make sure your FN + F1-F12 (whatever your brightness/sound controls are) are reported as XF86XK_AudioLowerVolume, XF86XK_AudioMute, XF86XK_AudioRaiseVolume and their corresponding brightness XF86 codes. I did that myself using this post.
For checking your key clicks and what the codes are you can use utilities like showkey (hint: use showkey -a or sudo showkey -k). Or check this thread.

ttl of list is disappear when the list become empty in redis

In Redis I inserted an element into a list by using Lpush and set an expiry. During the program execution, more elements will push-in and pop-out to and from the list. But when the list become empty the settled expiry of the list will loss.
Is there any way to retain the old list even if it is empty??
As a hack I put a dummy object in Redis for persist it's ttl but that is a bad solution.
please help.
No, empty lists are being removed. See the docs where it says: the result will be an empty list (which causes key to be removed)
As an alternative you can use a separate simple key for keeping the expiration. You will have to check on every push and pop if the key has expired or not and to do this in an atomic way you can use a Lua script. I think this separation is better than a dummy object which can be confused with a real value. And your whole logic would be in the Lua script and not in your application.

How can I disable a Function-Key say F4 for a particular application

Consider a business scenario in which a third party's Window Application uses F4 key to auto-fill some inputs with previous record details; and management want to stop this. (no code access on this 3rd party application, all users are in domain, and machine is shared between shift-users)
Now, question is, what would be the best approach to disable F4 Function-Key just for this particular application? Writing a process/windows service couldn't works well. Users can kill them from task manager or services explorer.
Any suggestion/Idea ?
There are a couple of ways you could try this :
(a) enter the BIOS setting, and change the "Function Key Priority"
(b) Install a new keyboard driver and use its configuration parameters.
(c) You could map those keys to a program that does nothing. Like : "wscript //b". But, this might affect focus/active window.
(d) Use the Kid-Key-Lock feature : http://www.100dof.com/products/kid-key-lock

Multiple SSH public keys into a single file

I'm trying to sftp to a host which acts as a load balancer and routes to 3 other systems based on round robin.
Our public key is setup on their systems. Yet, when ever I try to connect, I get prompted with a "Man in Middle attack" message asking us to verify the key finger print. To over come this I tried adding their public host key into .ssh2/hostkeys/key22_22_hostname.pub file.
Problem is I can't add 3 keys into this file, it seems to accept only one key?
Any suggestions on how to overcome this issue or add 3 public keys into one key22_22_hostname.pub file?
This is on AIX system.
How about cheat and copy the one system's keys to the others? I know is sorta scummy but in this case, it might be appropriate.
I believe those keys are found in /etc or maybe /etc/ssh.

Eucalyptus: getting private key from key pair through API / or injecting custom public key to instance

I'm probably having the most simple problem, but I'm still a bit at my wits end. Basically my problems are related to this command:
euca-run-instances -k mykey emi-104915A8
As you know, when starting up instance in Eucalyptus, either through API (as I actually am) or with the command above, the key pair has to be created. If I have understood right, eucalyptus injects the public key of that key pair to the instance. Now there's a method in API (using typica, btw) for creating such a key pair, but I believe when using that it's not possible to get the private key, which I would be needing, since I'd like to do some administrative stuff from external application.
So is it possible to get private keys through eucalyptus api? Or have you managed to find a good solution for injecting externally generated key pairs to instances? I'm between just making my own images and either fooling around with custom-user parameters, or just making some general key pair and putting that straight to image.
I'm just fooling around with Eucalyptus, and trying to get a hand of it, since I think it's best to get to know this cloud concept by trying to implement something on top of it :)
There is not much that can be done in this matter using Typica. I recommend creating the keypair by ssh-ing into the Cloud Controller and creating the keypair by euca-create-keypair command (all this through JAVA). You will get the private key as the output of the command. Save it into a file and carry on.
All the best !!!