Skip to content

Instantly share code, notes, and snippets.

View gema-arta's full-sized avatar
:octocat:
Octocating

gema-arta gema-arta

:octocat:
Octocating
View GitHub Profile

Faking DNS from userland

To give false DNS responses from userland we need to handle different type of syscalls : gethostbyname(), gethostbyname2(), getaddrinfo(), getnameinfo(), etc. To cover all these cases, and to prevent leaks to real dns servers, we will use two libraries : libresolv_wrapper and libnss_wrapper.

Installation

Install resolv_wrapper and nss_wrapper, either from sources or from your favorite Linux distribution.

@gema-arta
gema-arta / mpv.conf
Created January 17, 2022 21:46 — forked from shabbir-hasan/mpv.conf
MPV Configuration (mpv.conf) on Windows 10 Pro
# vim: syntax=config
###########
# General #
###########
priority=high
input-ipc-server=/tmp/mpvsocket # listen for IPC on this socket
load-stats-overlay=yes # use local stats.lua
@gema-arta
gema-arta / fsr_easu_expanded.comp
Created December 10, 2021 13:26 — forked from BreadFish64/fsr_easu_expanded.comp
AMD FSR mpv shaders
//!DESC FSR_EASU
//!HOOK MAINPRESUB
//!BIND HOOKED
//!WIDTH OUTPUT.w
//!HEIGHT OUTPUT.h
//!COMPUTE 8 8
#extension GL_GOOGLE_include_directive : enable
#define SAMPLE_EASU 1
@gema-arta
gema-arta / idea.md
Created November 20, 2021 18:10 — forked from motorailgun/idea.md
Installing Windows and Linux into the same partition

Installing Windows and Linux into the same partition

But WHY?

There was a reddit post about installing Arch on NTFS3 partition. Since Windows and Linux doesn't have directories with same names under the /(C:\), I thought it's possible, and turned out it was actually possible.
If you are not familiar to Linux, for example you've searched on Google "how to dualboot Linux and Windos" or brbrbr... you mustn't try this. This is not practical.

Pre-requirements

  • UEFI system
  • Any Linux live-boot CD/DVD/USB... with Linux kernel newer than 5.15
  • Windows installer USB
#!/usr/bin/python3.8
# This script manages 5 related tasks.
# 1. creating, setting up, and mounting a new zram device
# 2. Creating, and setting up a new cgroup
# 3. Creating a detached screen instance in the cgroup (the lifetime of the script is tied to this screen instance)
# 4. Flushing idle and incompressible pages to a zram backing device, suspending the screen process as needed.
# 5. Cleanly closing down the above if zram has an issue or when the screen terminates on its own.
__license__="""
@gema-arta
gema-arta / zswap.sh
Created October 12, 2021 19:15 — forked from Trucido/zswap.sh
#!/bin/sh
# -*- mode:shell-script sh-basic-offset:4 indent-tabs-mode:nil -*-
########################################################################################################################
# zswap.sh - Activate and tune Zswap compressed cache for swap pages.
#
# Enables/Renables/tunes zswap without the need for initramfs/dracut/modprobe/modules-load hackery.
#
# Author : <REDACTED>
# Copyright: 2018 <REDACTED> <########@####.com>
#
@gema-arta
gema-arta / !readme.md
Created October 12, 2021 19:14 — forked from TBog/!readme.md
Chage Garuda Arch linux distribution zram configuration
@gema-arta
gema-arta / vpn.sh
Created August 31, 2021 19:20 — forked from bigonese/vpn.sh
Script to start sstp-client on a Mac, connecting to Microsoft VPN, with ability to use Apple's KeyChain
#!/bin/bash
SERVICE_NAME='my-example-vpn'
SERVICE_URL='my-example-vpn.com'
if [[ ${#USER} > 1 ]]
then
read -p "Log in as ${USER}? [y/n] " LIA
else
LIA = 'n'
@gema-arta
gema-arta / operate-chefdk.sh
Created June 1, 2021 11:40 — forked from aravindkumarsvg/operate-chefdk.sh
Shell Script to install, uninstall ChefDK
#!/bin/bash
# =============================================
# Installs and Uninstalls the ChefDK
# =============================================
#
# -i Install ChefDK
# -u Uninstall ChefDK
# -c Verify ChefDK
# -h Show Help