Saturday, May 28, 2016

Cheatsheet: Linux video conversion with avconv

Case: you have a "vertical video" from a phone and want to transpose it. To transpose a video:
avconv -i input-video.mp4 -vf "transpose=1" output-video.mp4

Tuesday, February 23, 2016

Youtube fullscreen with xmonad

Source
import XMonad.Hooks.EwmhDesktops

main = do
    xmonad $ ewmh defaultConfig
        ...
        , handleEventHook = fullscreenEventHook <+> handleEventHook defaultConfig

Toggle layout with X Window System

setxkbmap -option "ctrl:nocaps"
setxkbmap -layout "us,ru" -option "grp:lalt_lshift_toggle"
Where to place the code

Caps Lock as Ctrl with X Window System

First way

 setxkbmap -option "ctrl:nocaps"

Second way

 xmodmap -e "remove Lock = Caps_Lock"
 xmodmap -e "keysym Caps_Lock = Control_L"
 xmodmap -e "add Control = Control_L"

Where to place the code

The code is to be placed in ~/.xsession. If a login manager is used, it should call XSession. For example,
$ cat /usr/share/xsessions/xmonad.desktop
[Desktop Entry]
Name=XMonad
Comment=Lightweight tiling window manager
Exec=/etc/X11/Xsession
Icon=
Type=XSession

Tuesday, October 14, 2014

How to paste into vim from external buffer without broking formatting

When I paste to vim some text from external buffer, e.g. using Ctrl-Shift-V in a terminal, the formatting is often broken. Use:
:set paste
Then paste the text. When you are done:
:set nopaste

Thursday, May 22, 2014

Changing Firefox Tab Cycle Order

  1. about:config in address bar
  2. Set "browser.ctrlTab.previews" to "true" (double-click)
Source