Написал скробблер для mpv: http://dump.bitcheese.net/files/utyreso/lastfm.lua
Написал скробблер для mpv: http://dump.bitcheese.net/files/utyreso/lastfm.lua
Выключаем несекурную антифичу подписывания сообщений в tkabber, оставляя возможность подписывания presence'ов: https://raw.github.com/l29ah/booboo/master/net-im/tkabber/files/tkabber-gpg-dont-sign-messages.patch
Гентушники могут emerge tkabber::booboo, as usual.
Надоело мышевозить для производства карточек. Наговнякал скрипт:
‰ cat ~/bin/longmanki
fn=/tmp/toanki
true > "$fn"
for w in "$@"; do
printf '%s,"' "$w" >> "$fn"
sdcv -u 'Longman Dictionary of Contemporary English' "$w" | tail -n +5 >> "$fn"
echo \" >> "$fn"
done
anki "$fn"
Можно ещё прикрутить автовпиливание картинок из гугла: http://nicloay.blogspot.ru/2010/09/google-images-stardict-sound-anki.html
Написал прибивалку SIGSTOP'ом firefox при переключении на другой воркспейс. Довольно криво, но работает. Очень актуально.
--{{{ Fuck firefox
myLogHook = do
wsname <- gets (currentTag . windowset)
case wsname of
"web" -> fuckFirefox False
_ -> fuckFirefox True
fuckFirefox ye = liftIO $ do
(rc, out, ) <- readProcessWithExitCode' "pgrep" ["firefox"] []
mapM fuckIt $ lines $ out
where fuckIt s = signalProcess (if ye then sigSTOP else sigCONT) (CPid $ read s)
readProcessWithExitCode'
:: FilePath -- ^ command to run
-> [String] -- ^ any arguments
-> String -- ^ standard input
-> IO (ExitCode,String,String) -- ^ exitcode, stdout, stderr
readProcessWithExitCode' cmd args input = do
(Just inh, Just outh, Just errh, pid) <-
createProcess (proc cmd args){ std_in = CreatePipe,
std_out = CreatePipe,
std_err = CreatePipe }
outMVar <- newEmptyMVar
-- fork off a thread to start consuming stdout
out <- hGetContents outh
forkIO $ C.evaluate (length out) >> putMVar outMVar ()
-- fork off a thread to start consuming stderr
err <- hGetContents errh
forkIO $ C.evaluate (length err) >> putMVar outMVar ()
-- now write and flush any input
when (not (null input)) $ do hPutStr inh input; hFlush inh
hClose inh -- done with stdin
-- wait on the output
takeMVar outMVar
takeMVar outMVar
hClose outh
-- wait on the process
ex <- C.catch (waitForProcess pid >>= return) (\e -> seq (e :: C.SomeException) $ return $ ExitSuccess)
return (ex, out, err)
--}}}
Как перестать искать красивые решения и начать писать код?