Skip to content

Instantly share code, notes, and snippets.

View AOx0's full-sized avatar
:shipit:
School

Alejandro Osornio AOx0

:shipit:
School
View GitHub Profile
@AOx0
AOx0 / mount_qcow2.md
Created May 26, 2024 01:49 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
# Completions for `zig` (https://ziglang.org/)
# Based on version 0.9.1
# This function is based on the `__fish_complete_clang` function.
function __fish_complete_zig_cc_and_cpp
# If the result is for a value, clang only prints the value, so completions
# for `-std=` print `c++11` and not `-std=c++11` like we need. See #4174.
set -l prefix (commandline -ct | string replace -fr -- '^(.*=)[^=]*' '$1')
# first get the completions from clang, with the prefix separated from the value by a comma
@AOx0
AOx0 / A.conf
Last active March 1, 2024 18:04
# This is an example Hyprland config file.
#
# Refer to the wiki for more information.
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
DROP SCHEMA IF EXISTS company CASCADE;
CREATE SCHEMA company;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SET search_path TO company;
CREATE TABLE job (
id_job UUID NOT NULL DEFAULT gen_random_uuid(),
issue_date DATE NOT NULL DEFAULT date(now()),
name VARCHAR(50) NOT NULL DEFAULT '',
begin
wget https://raw.githubusercontent.com/alacritty/alacritty/master/extra/alacritty.info
sudo tic -xe alacritty,alacritty-direct alacritty.info
end
function set-sleep --argument-names on
if [ "$on" = "on" ]
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0;
echo "Enabled sleep";
else if [ "$on" = "off" ]
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1;
echo "Disabled sleep";
else
echo "Invalid first argument. Should be 'on' or 'off'"
end
#!/bin/zsh
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title kitty
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🖥️
@AOx0
AOx0 / ksh.fish
Created December 4, 2022 21:11
kitty ssh
function ksh --argument-names args
kitty +kitten ssh -Cx $args
end
@AOx0
AOx0 / set-analyzer.fish
Created December 4, 2022 06:53
fish function to create symbolic links to rust-analyzer components for a given toolchain
function set-analyzer --argument toolchain
echo "INFO :: Adding rust-analyzer for $toolchain"
rustup component add rust-analyzer --toolchain $toolchain
set analyzer_path (rustup which rust-analyzer --toolchain $toolchain)
echo "INFO :: rust-analyzer for $toolchain at $analyzer_path"
echo "INFO :: Adding symbolic link to $HOME/.cargo/bin/rust-analyzer"
ln -fP $analyzer_path $HOME/.cargo/bin/rust-analyzer
end
@AOx0
AOx0 / justfile
Created July 22, 2022 18:35
Zip all folders in dir
zip:
for i in */; do zip -9 -r "${i%/}.zip" "$i" -x ".DS_Store" -x "__MACOSX"; done