Skip to content

Instantly share code, notes, and snippets.

{ config, pkgs, ... }:
let
busName = "nvidia.powerd.server";
userName = "messagebus";
nvidiaBlackHole = pkgs.writeTextFile {
name = "nvidiaBlackHole";
destination = "/etc/dbus-1/system.d/nvidia-fake-powerd.conf";
text = ''
<!DOCTYPE busconfig PUBLIC
@afreakk
afreakk / insertTotp.sh
Created March 30, 2021 15:02
insert pass otp using maim zbarimg & dmenu
#!/usr/bin/env bash
selected=$(find ~/.password-store/ -type f -name "*.gpg" -printf "%P\n"|awk '{print substr($1, 1, length($1)-4)}'|dmenu)
zbarimg <(maim -q --select --hidecursor /dev/stdout) --raw -q | pass otp append "$selected"

Keybase proof

I hereby claim:

  • I am afreakk on github.
  • I am afreak (https://keybase.io/afreak) on keybase.
  • I have a public key ASAIz_bz_cZjB178nbGOjAJA-iCmuum_zUaQXMzZHcq1qAo

To claim this, I am signing this object:

@afreakk
afreakk / github.less
Last active February 24, 2020 21:42
github style for qutebrowser with greasemonkey
[data-qb-domain='github.com'] {
pre,
code,
tt,
kbd:not(.badmono),
samp,
.blob-code,
.blob-code-inner,
.file-data pre,
.line-data,
@afreakk
afreakk / main.rs
Created February 16, 2020 11:13
minimal irc bot rust
use std::io::prelude::*;
use std::net::TcpStream;
use bufstream::BufStream;
fn main() {
match TcpStream::connect("irc.freenode.net:6667") {
Ok(mut tcp_stream) => {
let mut stream = BufStream::new(&tcp_stream);
let mut buffer = String::new();
@afreakk
afreakk / i3-sort-tabs.py
Last active November 19, 2019 09:12
sort tabs or windows or whatever in i3
#!/usr/bin/env python
import i3
#https://github.com/ziberna/i3-py
currentWindow = i3.filter(nodes=[], focused=True)[0]
parentContainer = i3.parent(currentWindow['id'])
if parentContainer['layout'] in ['splitv', 'stacked']:
direction = 'up'
else:
direction = 'left'
#!/bin/bash
cat $@ | sed ':a;N;$!ba;s/\n/ /g' | grep -o '\#[0-9a-fA-F]\{3\}[^0-9a-fA-F]\|\#[0-9a-fA-F]\{6\}[^0-9a-fA-F]' | sed 's/[^0-9a-fA-F#]//g' | sort -u
command! -bang -nargs=* CRg
\ call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case ".shellescape(<q-args>), 1, {'dir': expand('%:h')}, <bang>0)
@afreakk
afreakk / snapshotToFeh.sh
Created September 20, 2019 08:26
snapshot some area and show in FEH!
maim -s --format png /dev/stdout | xclip -selection clipboard -t image/png -i && xclip -selection clipboard -t image/png -o | feh -
@afreakk
afreakk / Search zsh_history from fish
Created August 19, 2019 17:14
Searches zsh history (in reverse) from fish shell using fzf, and putting result into commandline
function searchZshHistory
awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }' ~/.zsh_history | fzf --tiebreak=index --toggle-sort=ctrl-r -q (commandline) | read -l result
and commandline -- $result
commandline -f repaint
end
# bind searchZshHistory alt+r
bind \er 'searchZshHistory'
if bind -M insert >/dev/null 2>/dev/null
bind -M insert \er 'searchZshHistory'