mitmproxy reset an option (view_filter)? - mitmproxy

I have a ~/.mitmproxy/keys.yaml hotkey config file for mitmproxy and a part of the file is as follows.
-
key: ctrl f
cmd: set view_filter '!(~t "text/html" | ~t "text/css" | ~t "image/" | ~t "/javascript")'
-
key: ctrl i
cmd: set view_filter ''
So I use often a long view_filter command so I added it to the file, as specified on "ctrl f" above.
When I hit ctrl-f I can get the filter onto the mitmproxy viewer instantly, that's great, but usually I want to revert that filter back to the default empty one.
So I added set view_filter '' command with the "ctrl i" hotkey on the file as above. But It didn't work as expected, when I hit ctrl-i, it does nothing, no error on the log.
So how can I make/reset a option (view_filter) default?

Related

nvim use defx instead of NerdTree

I would like to open nvim with defx by default instead of Nerdtree. Have no idea how to change that behaviour
I am using defx and can open it through mapping with sf custom mapping command, but for that i should be already in nvim so it takes me two steps.
vim
sf
Sf lives in maps.vim
" Description: Keymaps
" defx
nnoremap <silent>sf :<C-u>Defx -listed -resume
\ -columns=indent:mark:icon:icons:filename:git:size
\ -buffer-name=tab`tabpagenr()`
\ `expand('%:p:h')` -search=`expand('%:p')`<CR>
Can i open defx with
nvim .
I can disable nerdtree from opening in nvim/init.vim
" Disable netrw
let g:loaded_netrwPlugin = 1
but even with it I should do sf to open defx
so the answer from creator #Shougo was
https://gitter.im/Shougo/defx.nvim?at=61abfda5b5ba9e5a11ef079e
autocmd BufEnter,VimEnter,BufNew,BufWinEnter,BufRead,BufCreate
\ * if isdirectory(expand('<amatch>'))
\ | call s:browse_check(expand('<amatch>')) | endif
function! s:browse_check(path) abort
if bufnr('%') != expand('<abuf>')
return
endif
" Disable netrw.
augroup FileExplorer
autocmd!
augroup END
execute 'Defx' a:path
endfunction

What's the command that Ctrl-Q triggers on VSCode (Windows)

On Windows VSCode ctrl+q shows a menu with the items on the activity bar.
What is that command?
I switch to Linux and want to add a key binding to that command (not map by default as on Linux ctrl+q quits the program) but cannot find it and don't have a Windows machine at hand to look on the key bindings and doesn't seem to be listed here.
When we do not have access to VSC on given platform
It should be possible to sift through the sources.
In this case we are looking for Ctrl that should be CtrlCmd and Q KeyQ in KEYBINDING of some module class, so something like:
static readonly ID = 'workbench.action.quickOpenView';
static readonly KEYBINDING = {
primary: KeyMod.CtrlCmd | KeyCode.KeyQ,
mac: { primary: KeyMod.WinCtrl | KeyCode.KeyQ },
linux: { primary: 0 }
};
(Yes, that's exactly it and I've started from here backwards.)
Slightly convoluted GitHub search query *
KEYBINDING KeyMod CtrlCmd KeyCode KeyQ repo:microsoft/vscode extension:ts
should bring us there so we now have the command ID: workbench.action.quickOpenView.
When we have VSC on platform at hand
It is easy as using the 'Record keys' feature in the Keyboard Shortcuts settings pane to find this information (either clicking the "Keyboard" icon or using Alt+K) where we should find that Ctrl+Q is by default bound to View: Quick Open View:
GitHub code search sadly ignores all non-alphanumerics
. , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ] #

Auto reload file and in neovim and auto reload nerbtree

I'm using neovim for coding C++. I have some trouble when coding with it.
I often use file to read and write data. When I run C++ file by command g++ -o data data.cpp && ./data, output file don't reload in neovim.
I try use
set autoread
au CursorHold * checktime
but it doesn't work.
I don't want to type :e to reload everytime I run code
Additionally, I want to know how to set auto reload nerbtreee when I create new file or folder on Explorer.
Environment:
nvim: 0.4.3
Ubuntu 18.04 LTS
I solved it.
Thanks for spacetime-continuum on Reddit
This is how I configure for this problem:
" trigger `autoread` when files changes on disk
set autoread
autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | checktime | endif
" notification after file change
autocmd FileChangedShellPost *
\ echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl None
Here is how I auto-read buffers using lua Config
vim.o.autoread = true
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, {
command = "if mode() != 'c' | checktime | endif",
pattern = { "*" },
})

How to run 2 commands in same line in SROS?

How to run 2 commands in same line in SROS? I have tried
command1 & command2
command1 && command2
command1 | command2
command1 || command2
command1; command2
(command1 &) & (command2 &)
(command1; command2) &
(command1 &) && (command2 &)
I'm not sure that's possible, at least not with the version(s) I'm currently running. Depending on your requirements you can load your commands into a configuration file and execute it from CLI as a single entry. For example if you wanted to show the FDB of two VPLSs in a single operation you could add those show commands to a file called show.cfg on CF3 and then execute it with exec cf3:\show.cfg.
A:7705-299# file type cf3:\show.cfg
File: show.cfg
-------------------------------------------------------------------------------
show service id 7299 fdb detail
show service id 13002297 fdb detail
===============================================================================
A:7705-299# exec cf3:\show.cfg
===============================================================================
Forwarding Database, Service 7299
===============================================================================
ServId MAC Source-Identifier Type Last Change
Age
-------------------------------------------------------------------------------
7299 01:0b:20:0b:ca:d7 sap:1/1/10 L/44 03/29/20 11:23:34
7299 30:c8:98:c6:b5:47 sdp:11:7299 L/456 01/16/20 15:02:17
-------------------------------------------------------------------------------
No. of MAC Entries: 2
-------------------------------------------------------------------------------
Legend: L=Learned O=Oam P=Protected-MAC C=Conditional S=Static
===============================================================================
===============================================================================
Forwarding Database, Service 13002297
===============================================================================
ServId MAC Source-Identifier Type Last Change
Age
-------------------------------------------------------------------------------
13002297 0a:b0:02:cf:5a:f0 sap:1/1/7:200 L/117 04/09/20 11:11:20
13002297 11:a2:a8:c6:b5:47 sdp:11:13002297 L/396 02/13/20 11:13:11
13002297 3d:d0:4b:25:5c:fc sap:1/1/12 L/44 04/21/20 00:59:03
-------------------------------------------------------------------------------
No. of MAC Entries: 3
-------------------------------------------------------------------------------
Legend: L=Learned O=Oam P=Protected-MAC C=Conditional S=Static
===============================================================================
Executed 2 lines in 0.8 seconds from file cf3:\show.cfg
I also don't think it is possible to send two commands in a single line. However, I have an another workaround for you if you are using SecureCRT.
In SecureCRT, there is an option to send multiple commands in one click. I have used to send following commands in one click, please see following:
environment no more
show version
show chassis
To do this, I have opened "Button Bar" under "View" section first:
Then, it gives me a button as following:
When you right click the green button, and click on edit, you will receive following screen. You can type any command as following, and you can also change the button color.
So that you can run multiple commands in one click.

Orgmode exporting table to csv throws error

I have this code which used to work with org-table-export, but now It throws an error message at me:
'No such transformation function csv'
#+PROPERTY: table_export_file filename.csv
#+PROPERTY: TABLE_EXPORT_FORMAT csv
| 1 | 2 |
| a | b |
What could be wrong? I'm on Org 8.3.4 with ubuntu 16.04.
I figured it out by trying to change the default value for the variable with M-x customize variable RET org-table-export-.. (Tab completion), which showed me that I had apparently set it wrong to start with; my property should have looked the following way:
#+PROPERTY: TABLE_EXPORT_FORMAT orgtbl-to-csv
Mystery solved.