View weztermdeps.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install libx11-xcb-dev libxcb-util libxcb-util-dev libxcb-image0-dev libxcb1-dev libxkbcommon-dev libxkbcommon-x11-dev |
View config.kdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true" | |
keybinds { | |
normal { | |
// uncomment this and adjust key if using copy_on_select=false | |
// bind "Alt c" { Copy; } | |
} | |
locked { | |
bind "Ctrl g" { SwitchToMode "Normal"; } | |
} | |
resize { |
View config.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
theme = "tokyonight" | |
[editor] | |
line-number = "relative" | |
mouse = false | |
bufferline = "multiple" | |
rulers = [80] | |
[editor.statusline] | |
right = ["diagnostics", "selections", "position", "position-percentage", "file-encoding", "file-line-ending", "file-type"] |
View .tmux.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set prefix (Ctrl+a) | |
set-option -g prefix C-a | |
unbind-key C-a | |
bind-key C-a send-prefix | |
# Use Alt-arrow keys to switch panes (Alt+left/right/up/down) | |
bind -n M-Left select-pane -L | |
bind -n M-Right select-pane -R | |
bind -n M-Up select-pane -U | |
bind -n M-Down select-pane -D |
View result-example.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation of Result<Result,Error> type a la Rust. | |
// author: Ugo Varetto | |
// License: Zero-clause BSD | |
// SPDX identifier: 0BSD | |
#include "result.h" | |
//----------------------------------------------------------------------------- | |
Result<int, std::string> Foo(int i) { | |
if (i == 0) { | |
return Err(std::string("Error")); | |
} else { |
View sha256.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sha256.c - SHA256 reference implementation | |
// | |
//----------------------------------------------------------------------------- | |
#include <assert.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
//----------------------------------------------------------------------------- |
View par-heic2jpeg.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cabal-version: 3.4 | |
-- The cabal-version field refers to the version of the .cabal specification, | |
-- and can be different from the cabal-install (the tool) version and the | |
-- Cabal (the library) version you are using. As such, the Cabal (the library) | |
-- version used must be equal or greater than the version stated in this field. | |
-- Starting from the specification version 2.2, the cabal-version field must be | |
-- the first thing in the cabal file. | |
-- Initial package description 'y' generated by | |
-- 'cabal init'. For further documentation, see: |
View heic2jpeg.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Directory | |
import System.FilePath | |
import Control.Monad | |
import System.Process | |
import Data.Char | |
main = do | |
c <- listDirectory "." | |
f <- filterM (\x -> return (map toLower (snd(splitExtension x)) == ".heic")) c | |
mapM (\x -> callProcess "convert" [x, (dropExtension x) ++ ".jpg"]) f |
View hibernate-wol-magic.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# run with sudo | |
ethtool -s enp8s0 wol g | |
systemctl hibernate |
View 50-wired.link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/etc/systemd/network/50-wired.link | |
#Make system wake up on magic packet reception | |
[Match] | |
MACAddress=80:FA:5B:78:BB:98 | |
[Link] | |
NamePolicy=kernel database onboard slot path | |
MACAddressPolicy=persistent | |
WakeOnLan=magic |
NewerOlder