Skip to content

Instantly share code, notes, and snippets.

@sergshabal
sergshabal / k780.md
Created October 10, 2017 18:53 — forked from andrejcremoznik/k780.md
Logitech K780 switch media and function keys on linux

Media/function keys on K780

K780 doesn't have a hard switch to lock the function keys. Logitech provides a utility to do this on Windows and iOS but not on Linux. You need to manually remap the keys.

Below works for Arch Linux, other systemd based distros should be about the same.

There's a problem with the F1-F3 keys as they're hardware specific and don't emit an event if pressed on their own and therefore can't be remapped. I might be wrong as I haven't spend any time on researching that.

Create file /usr/lib/udev/hwdb.d/95-k780.hwdb

@sergshabal
sergshabal / Euler12.hs
Created October 5, 2016 12:30 — forked from isomorphism/Euler12.hs
quick and stupid benchmarking example
import Data.List
import System.Environment
{- RE: http://stackoverflow.com/q/6964392/157360
cam@atomos:~/scraps/SO/euler$ ghc -O2 --make Euler12.hs
cam@atomos:~/scraps/SO/euler$ time ./Euler12 1000
842161320
real 0m12.892s
its ok
I set keyboard in paired mod
then in terminal:
$ bluetoothctl
[NEW] Controller 00:02:72:DE:1E:41 debi [default]
[NEW] Device 00:1F:20:EC:A5:DD Logitech Keyboard K480
[NEW] Device 00:1A:7D:55:02:06 BS-55
[NEW] Device A0:8D:16:86:81:C1 CHM-U01
[bluetooth]# connect 00:1F:20:EC:A5:DD
open System
let callPayoff strike spot = max (spot - strike) 0.0
let putPayoff strike spot = max (strike - spot) 0.0
let triplewise (source: seq<_>) =
source
|> Seq.windowed 3
|> Seq.map (fun triple -> (triple.[0], triple.[1], triple.[2]))
###############################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

Create Github/Bitbucket Mirror

Create SSH key and configure

Create Key (no passphrase and name mirror the key)

ssh-keygen -t rsa -N "" -f ~/.ssh/mirror