Skip to content

Instantly share code, notes, and snippets.

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
import qualified XMonad.StackSet as W
@bitc
bitc / grafana.ini
Created July 11, 2019 08:54
metrics server
[server]
# The ip address to bind to, empty will bind to all interfaces
http_addr = 127.0.0.1
# The http port to use
http_port = 3000
# The public facing domain name used to access grafana from a browser
domain = {{ grafanaDomain }}
@bitc
bitc / ShakeFile.hs
Created March 20, 2019 19:25
messy shake
import Control.Monad (forM)
import Crypto.Hash
import Crypto.Hash.Conduit
import Data.List (intercalate)
import Data.Monoid ((<>))
import Development.Shake
import Development.Shake.FilePath
import System.Process (callProcess)
main :: IO ()
@bitc
bitc / windows_disable_win_key.txt
Created September 13, 2018 21:30
Windows Disable Win Key
Start -> Run
gpedit.msc
User Configuration -> Administrative Templates -> Windows Components -> Windows Explorer
Turn off Windows+X hotkeys ==> "Enabled"
User Configuration -> Administrative Templates -> System -> Ctrl+Alt+Del Options

IRC Setup: weechat (bouncer-like) + gotty + Glowing Bear

Abstract:

weechat IRC chat client (also acts like a bouncer) runs inside a tmux session(called weechat). This tmux session can also be accessed through any web browser via gotty. We can also connect to weechat from different clients using its "relay" feature. gotty and the weechat relay are secured with TLS behind an nginx reverse proxy(using letsencrypt).

systemd User Services

Reference: http://www.mythmon.com/posts/2015-02-15-systemd-weechat.html

@bitc
bitc / example.hs
Created December 2, 2017 23:29
Run Haskell script using stack
#!/usr/bin/env stack
{- stack
script
--resolver lts-9.14
--install-ghc
--package stm,async,shelly
-}
import System.Info
@bitc
bitc / notes.sh
Last active November 27, 2017 21:41
Haskell Install GHC via stack
$ stack path --no-system-ghc --install-ghc --compiler ghc-8.2.2 --compiler-exe
$ $(stack path --no-system-ghc --install-ghc --compiler ghc-8.2.2 --compiler-exe) --version
$ cabal new-build --with-ghc=$(stack path --no-system-ghc --install-ghc --compiler ghc-8.2.2 --compiler-exe)
#!/bin/bash
case $1 in
"--interactive")
echo $@ > /dev/stderr
;;
*)
ghc $@
;;
esac
# This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
#
# The first line enables clang-format for NORMAL and VISUAL mode, the second
# line adds support for INSERT mode. Change "C-I" to another binding if you
# need clang-format on a different key (C-I stands for Ctrl+i).