TMUX - entering vi mode key binding - configuration

I want to change entering vi mode key-set to prefix + v or prefix + C-v.
By default tmux uses prefix + [ to enter vi mode. I tried to send-prefix + send-keys with bind but it didn't work.
I don't know if tmux allows such operations, but I think prefix + [ is not very useful.

If you would like VI mode to be permanently enabled, add this line to your ~/.tmux.conf:
set-window-option -g mode-keys vi
Restart tmux or run Ctrl+B+: then source-file ~/.tmux.conf inside of tmux.
source

Putting this in your .tmux.conf will do it:
bind 'v' copy-mode
You can find what keys are bound to what commands with:
tmux list-keys

Related

Shell variable is not being seen/used in Tmux configuration

I'm trying to use a shell variable in Tmux to configure some settings for the venerable powerline. The line of interest in my .tmux.config is:
run-shell "powerline-daemon -q"
source-file $POWERLINE_ROOT/powerline/bindings/tmux/powerline.conf
I get the following error :
/Users/myname/.tmux.conf:47: /powerline/bindings/tmux/powerline.conf: No such file or directory
It seems that the value of the environment variable $POWERLINE_ROOT is not being seen by Tmux. (I can confirm that $POWERLINE_ROOT does have a non-empty value.)
You can see my complete Tmux configuration if needed
Here's all I know:
I have the following in my .bashrc:
export __tmux_bg_inactive='234'
export __tmux_bg_active='233'
export __tmux_fg_inactive='245'
export __tmux_fg_active='248'
I have the following in my .tmux.conf:
set -g window-style "fg=colour${__tmux_fg_inactive},bg=colour${__tmux_bg_inactive}"
set -g window-active-style "fg=colour${__tmux_fg_active},bg=colour${__tmux_bg_active}"
set -g pane-active-border-style "fg=colour$__green, bg=colour$__tmux_bg_active"
set -g pane-border-style "fg=colour$__tmux_fg_inactive, bg=colour$__tmux_bg_inactive"
This works for me. Maybe the fact that I've export'd the variable is what did it, or maybe it's that it's in my .bashrc so it gets set everywhere tmux could possibly need it?
Let me know if that doesn't work.

Mysql database restoring with fab and curses in django

#hosts(['localhost'])
def start():
import curses
screen = curses.initscr()
backup_file = db_backup.sql
local("mysql -u %s -p %s < " % (
db_username,db_name) + backup_file)
now I run this with fab start
it asks for a password, after I entered the password the screen is not responding.
Can anyone know what's happening here? if I remove curses it is working fine.
The local command is doing the prompt for the password. That expects that the terminal modes are set normally, so that if you press Enter (which sends a ^M) it is mapped into a newline (^J).
When you initialized curses using curses.initscr, that changes the terminal modes so that the mapping is not done. The curses library does its own mapping when you call getch.
If you press controlJ rather than Enter, that should appease the password prompt in the local command.
Since your example is not using curses (perhaps it does later) you can either omit it, or move the initialization down to the place where you need to use it.
In any case, you probably cannot make the local command use a password prompt in the script via curses (without assuming and relying upon special devices).
By suspending the curses, it will return to the terminal. where we can complete the restore database task.

JMeter 2.1.13 not loading properties file

I'm running a test with JMeter 2.1.13 on Ubuntu 14.04, getting the output as csv. I use the following command line in Ubuntu 14.04 to try to get it to read the properties file to add fields to the CSV output
./jmeter -n -p /opt/apache-jmeter-2.13/bin/jmeter.properties -l n1.csv -t Apache-DB.jmx
With the following in the properties file
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.print_field_names=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.connect_time=true
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.default_delimiter=,
It doesn't seem to pick it up, as no field headers are printed. Here's an example from the first line of the csv file
1448233211742,313,HTTP Request,200,OK,Thread Group 1-1,text,false,209666,1,1,96
I've also tried --propfile instead of -p, which didn't work. Am I doing something wrong or does JMeter not read those configuration options like it should?
Background information / helpful information for others
I have managed to turn on a couple of extra fields using command line switches (just in case anyone finds this on Google). This at puts field labels on the JMeter CSV output.
./jmeter -n -Jjmeter.save.saveservice.print_field_names=true -Jjmeter.save.saveservice.connect_time=true -l n1.csv -t Apache-DB.jmx
For reference here are the JMeter default csv fields
timeStamp,elapsed,label,responseCode,responseMessage, threadName,dataType,success,bytes,grpThreads,allThreads,Latency
The header at the top of jmeter.properties advices:
################################################################################
#
# THIS FILE SHOULD NOT BE MODIFIED
#
# This avoids having to re-apply the modifications when upgrading JMeter
# Instead only user.properties should be modified:
# 1/ copy the property you want to modify to user.properties from jmeter.properties
# 2/ Change its value there
#
################################################################################
Your settings are likely being overridden when default saveservice properties are loaded afterjmeter.properties.
Try putting your properties in user.properties.

How do I disable the "octave:#>" echo?

Octave shows echo "octave:#>" before command line in interactive mode where # is the order of the entry. I want to use a program that uses it so I want to cancel that echo. How can I do this?
This is called command prompt. You can set the PS1 to the empty string with:
PS1("")
For more info: https://www.gnu.org/software/octave/doc/interpreter/Customizing-the-Prompt.html

How do I set user level flags for Grid Engine bsub command?

I am running GridEngine (GE 6.2u5) jobs from a command line. For example,
qsub echo "Hello"
But I get this error,
Unable to read script file because of error: error opening echo: No such file or directory
The workaround is easy, use the -b y flag. I'd like to create an SGE properties file in my home directory which will set '-y' to be the default. How do I do this?
If you want to add your option, you can edit the file "sge_request". It allows you to set the default options that will be added to any requests you will submit.
This file is situated in : SGE_ROOT/CELL_NAME/common/sge_request
For more information, check the documentation : http://gridscheduler.sourceforge.net/htmlman/htmlman5/sge_request.html