Skip to content

Instantly share code, notes, and snippets.

View Gonzih's full-sized avatar
🤠
ATX

Max Soltan Gonzih

🤠
ATX
View GitHub Profile
@Gonzih
Gonzih / main.zig
Last active January 13, 2023 00:26
Zig fat pointer example
const std = @import("std");
const testing = std.testing;
const assert = std.debug.assert;
pub const Runner = struct {
const Self = @This();
const VTable = struct { add: *const fn (*anyopaque, *usize) void };
vtable: *const VTable,
ptr: *anyopaque,
@Gonzih
Gonzih / emu.sh
Created November 15, 2022 20:41
linux kernel development qemu script
sudo qemu-system-x86_64 \
-kernel arch/x86_64/boot/bzImage \
-initrd ramdisk.img \
-display none \
-serial stdio \
-append "root=/dev/vda console=ttyS0 nokaslr" \
-drive format=raw,file=/home/gnzh/mydev/linsicles/buildroot/output/images/rootfs.ext4,if=virtio
@Gonzih
Gonzih / main.rs
Created November 14, 2022 19:05
zkdoc
extern crate libspartan;
extern crate merlin;
use libspartan::{Instance, SNARKGens, SNARK};
use merlin::Transcript;
use std::io::prelude::*;
// read file into Transcript
fn file_transcript(filename: &str) -> Transcript {
let mut transcript = Transcript::new(b"spartan");
let mut file = std::fs::File::open(filename).unwrap();
@Gonzih
Gonzih / default.nix
Last active December 30, 2022 23:06
Unreal Engine 4 nix-shell config
let
pkgs = import <nixpkgs> {};
in pkgs.clangStdenv.mkDerivation rec {
name = "unreal-engine-build";
# UE4_LINUX_USE_LIBCXX = "0";
UE_USE_SYSTEM_MONO = "1";
# SDL_VIDEO_X11_VISUALID = "";
common = with pkgs; [
@Gonzih
Gonzih / main.rs
Last active February 26, 2020 18:05
Optional arguments in Rust
type Links = Vec<String>;
type Proxies = Vec<String>;
#[derive(Clone, Debug)]
struct Opts {
links: Option<Links>,
proxies: Option<Proxies>,
}
impl Opts {
@Gonzih
Gonzih / wireguard.nix
Last active February 1, 2020 16:33
NixOs WIREGUARD full traffic forwarding config
{ config, pkgs, ... }:
let
secrets = import /opt/nix/secrets.nix;
externalInterface = "enp2s0";
internalInterface = "wg0";
externalPort = 51820;
externalNetMask = "10.200.200.1/24";
in
{
@Gonzih
Gonzih / keybase.md
Created August 3, 2018 18:45
keybase.md

Keybase proof

I hereby claim:

  • I am gonzih on github.
  • I am gonzih (https://keybase.io/gonzih) on keybase.
  • I have a public key ASDuSCBmos0345fAhkjGxVRvU8p40Ikp8RGA5wu5UxdTLQo

To claim this, I am signing this object:

@Gonzih
Gonzih / README.md
Last active May 11, 2018 17:51
Go workshop
@Gonzih
Gonzih / etc-iptables-iptables.rules
Last active April 10, 2018 22:07
PIA/Privateinternetaccess iptables kill switch with enabled incoming SSH
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:10]
-A FORWARD -i tun+ -j ACCEPT
-A FORWARD -j DROP
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i tun+ -j ACCEPT
@Gonzih
Gonzih / PKGBUILD
Last active March 17, 2019 20:07
CUDNN9 aur PKGBUILD
pkgname=cudnn9
pkgver=7
pkgrel=4
pkgdesc="NVIDIA CUDA Deep Neural Network library (version 9)"
arch=('x86_64')
url="https://developer.nvidia.com/cuDNN"
license=('proprietary')
depends=('cuda-sdk')
source=("http://files.fast.ai/files/cudnn-9.1-linux-x64-v7.tgz")
sha512sums=('7eadb64a3d5e49aec2761e6f7dc0295c1d356910b114eed450c47081fc81b6e3b7748f3a4153f6a9d957691e3689cd52823bfa12816b1950dfc8794d6f332749')