Skip to content

Instantly share code, notes, and snippets.

View Adhjie's full-sized avatar
🎯
Focusing

Adi Adhjie

🎯
Focusing
View GitHub Profile
class PipeServer
{
static
int
Main(string[] args)
{
if(args.Length < 2
||(System.String.Compare(args[0], "in") != 0
&& System.String.Compare(args[0], "out") != 0)) {
System.Console.WriteLine("Usage: PipeServer <in | out> <process> <args>");
@kohnakagawa
kohnakagawa / check_cet_supported.c
Created March 27, 2021 07:53
Checks whether your cpu supports Intel CET or not (Linux).
#include <stdio.h>
#include <cpuid.h>
#include <stdint.h>
int cpu_supports_cet_shadow_stack() {
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
__cpuid_count(7, 0, eax, ebx, ecx, edx);
return (ecx & (1 << 7)) != 0;
}
// Package librclone exports shims for C library use
//
// This directory contains code to build rclone as a C library and the
// shims for accessing rclone from C.
//
// The shims are a thin wrapper over the rclone RPC.
//
// Build a shared library like this:
//
// go build --buildmode=c-shared -o librclone.so github.com/rclone/rclone/librclone
@oleksis
oleksis / Compile Mainline Kernel (5.15.0) from WSL2.md
Last active July 4, 2025 01:24
Steps for compile Mainline Kernel Linux using WSL2

Compile Mainline Kernel for WSL2

Steps for compile Kernel Linux 5.15.0

Actual Kernel

$ uname -a
Linux DESKTOP-ID 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 GNU/Linux

Work Dir linux

@xitongsys
xitongsys / WSL 2 GNOME Desktop.md
Created January 12, 2021 23:51
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure out how [to](https://www.reddit.

@scudette
scudette / pipe_client.ps1
Created December 12, 2020 12:18
A named pipe client in powershell
$npipeClient = new-object System.IO.Pipes.NamedPipeClientStream(".", 'BlackJack', [System.IO.Pipes.PipeDirection]::InOut,
[System.IO.Pipes.PipeOptions]::None,
[System.Security.Principal.TokenImpersonationLevel]::Impersonation)
$npipeClient.Connect()
$script:pipeWriter = new-object System.IO.StreamWriter($npipeClient)
$pipeWriter.AutoFlush = $true
while (1) {
$pipeWriter.WriteLine("hello")
Sleep 1
@dahlsailrunner
dahlsailrunner / SSL-nginx-Docker.md
Last active June 30, 2025 18:16
SSL with Docker images using nginx as reverse proxy

Docker with SSL and an nginx reverse proxy

Running your ASP.NET Core (or other) application in Docker using SSL should not be an overwhelming task. These steps should do the trick.

Run the following steps from a Linux terminal (I used WSL or WSL2 on Windows from the Windows Terminal).

1. Create a conf file with information about the cert you'll be creating

It should look something like the content below; call it my-site.conf or something like that.

@probonopd
probonopd / Wayland.md
Last active July 4, 2025 16:27
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

image

Source: https://x.com/LundukeJournal/status/1940441670098809093

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

@kamysheblid
kamysheblid / stopmediumpaywall.txt
Created August 25, 2020 16:48
Bypass the annoying paywall on Medium.com and DataScience.com
// ==UserScript==
// @name Stop the Medium The Pay Wall
// @namespace StopThePayWall
// @version 1
// @include *medium*
// @include *datascience*
// ==/UserScript==
async function abc () {
var resp = (await fetch(location, { "credentials": "omit", "headers": { "Accept": "text/html,text/xhtml,text/xml,*/*", "Connection": "keep-alive", }, "method": "GET", "mode": "cors" }));