Skip to content

Instantly share code, notes, and snippets.

View aerphanas's full-sized avatar
🛑
all interaction go to codeberg

Muhammad Aviv Burhanudin aerphanas

🛑
all interaction go to codeberg
View GitHub Profile
@aerphanas
aerphanas / default.nix
Last active November 10, 2022 13:04
Python env wit nix-shell
with (import (fetchTarball https://git.io/Jf0cc) {});
let Deps = ps: with ps; [ pip wheel cython ];
Env = python3.withPackages Deps;
in mkShell {
buildInputs = [ Env ];
shellHook = ''
python -m venv env
source env/bin/activate
'';
@aerphanas
aerphanas / file.md
Last active October 21, 2022 07:26
Chroot Into ZFS partition
zpool export -a
zpool import -N -R /mnt rpool
zpool import -N -R /mnt bpool
zfs load-key -a

# Add *UUID* at the end, if appropriate; use zfs list to see your values:
zfs mount rpool/ROOT/ubuntu
zfs mount bpool/BOOT/ubuntu
zfs mount -a
@aerphanas
aerphanas / main.cpp
Created October 15, 2022 07:51
c++ and haskell Quick short
void quickSort(int arr[], int start, int end)
{
if (start >= end) return;
int p = partition(arr, start, end);
quickSort(arr, start, p - 1);
quickSort(arr, p + 1, end);
}
@aerphanas
aerphanas / fstab
Created October 7, 2022 11:32
my opensuse Default fstab with btrfs
/dev/mapper/cr_system-opensuse / btrfs defaults,ssd 0 0
/dev/mapper/cr_system-opensuse /var btrfs subvol=/@/var 0 0
/dev/mapper/cr_system-opensuse /usr/local btrfs subvol=/@/usr/local 0 0
/dev/mapper/cr_system-opensuse /tmp btrfs subvol=/@/tmp 0 0
/dev/mapper/cr_system-opensuse /srv btrfs subvol=/@/srv 0 0
/dev/mapper/cr_system-opensuse /root btrfs subvol=/@/root 0 0
/dev/mapper/cr_system-opensuse /opt btrfs subvol=/@/opt 0 0
/dev/mapper/cr_system-opensuse /home btrfs subvol=/@/home 0 0
/dev/mapper/cr_system-opensuse /.snapshots btrfs subvol=/@/.snapshots 0 0
/dev/system/swap swap swap defaults 0 0
Config { overrideRedirect = False
, font = "xft:iosevka-9"
, bgColor = "#5f5f5f"
, fgColor = "#f8f8f2"
, position = TopW L 90
, commands = [ Run Weather "EGPF"
[ "--template", "<weather> <tempC>°C"
, "-L", "0"
, "-H", "25"
, "--low" , "lightblue"
@aerphanas
aerphanas / xmonad.hs
Created October 4, 2022 03:16
xmonad default from Geting started
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Util.EZConfig
@aerphanas
aerphanas / main.rs
Created June 28, 2022 11:35
Print Num 1 to 10
fn main() {
let mut from:i32 = 0;
let to:i32 = 10;
loop {
if from != to {
print!("{},",from);
from = from + 1;
} else if from == to {
println!("{}",to);
break;
@aerphanas
aerphanas / AutoClicker.sh
Last active June 28, 2022 11:37 — forked from HaydenElza/AutoClicker.sh
Auto-Clicker using xdotool on linux
COUNTER=0
while true; do
xdotool click 1
sleep 0.001s
echo chicked $COUNTER
let COUNTER=COUNTER+1
done
@aerphanas
aerphanas / bmi.hs
Created July 13, 2021 08:14
get bmi on haskell kg and cm
bmi :: (RealFloat a) => a -> a -> String
bmi weight height
| weight / (height / 100)^2 <= 18.5 = "You're underweight, you emo, you!"
| weight / (height / 100)^2 <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
| weight / (height / 100)^2 <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
@aerphanas
aerphanas / helloworld.c
Created May 20, 2021 11:47
hello world gtk+-3.0
//compile with pkg-config --cflags gtk+-3.0 --libs gtk+-3.0
#include <gtk/gtk.h>
static void
start(GtkApplication* app, gpointer user_data);
int
main(int argc, char**argv)
{
GtkApplication *app;