Skip to content

Instantly share code, notes, and snippets.

View malkia's full-sized avatar

Dimiter 'malkia' Stanev malkia

View GitHub Profile
@mmozeiko
mmozeiko / etw_createfile.c
Last active March 14, 2024 00:14
Monitor which files are accessed with ETW
// this code will work only when compiled as 64-bit code, and on Windows 10
// older Windows version might require different structure definitions
#define NOMINMAX
#define INITGUID
#include <windows.h>
#include <evntrace.h>
#include <evntcons.h>
#pragma comment (lib, "shell32.lib")
@jifalops
jifalops / _README.md
Last active June 30, 2019 18:53
Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3

Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3

Modify lines 20 and 21 with your gist and token for the VS Code settings-sync extension.

The script adds a symbolic link to the ChromeOS Downloads folder at ~/Downloads. For it to work, share your Downloads folder with Linux by right-clicking it in the Files app.

WARNING

  • The script appends to the PATH environment variable each time it runs (at the end).
  • settings.json for VS Code will be overwritten if it exists! (The default settings are empty and it was easier to do it this way than to use jq.)
@binshengliu
binshengliu / install-clang-8-debian.sh
Created May 14, 2019 01:58
Install Clang-8 on Debian Stretch
sudo echo -e 'deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main\ndeb-src http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main\n' >> /etc/apt/sources.list
sudo aptitude install clang-8 clang-tools-8 clang-format-8
sudo aptitude install libc++-8-dev libclang-8-dev libc++abi-8-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-8 100
@ajinasokan
ajinasokan / flutter_desktop_macos.md
Last active November 22, 2019 14:38
Run Flutter apps in MacOS with IDE support and hot reloading

This setup is only for MacOS. I don't have a windows/linux machine to test.

Clone FDE repo

cd ~
git clone https://github.com/google/flutter-desktop-embedding

Switch to flutter master

function Get-ProcessStartKey {
<#
.SYNOPSIS
Derives the process start key for one or more processes.
.DESCRIPTION
Get-ProcessStartKey derives the process start key for one or more processes. Process start keys were introduced in Win 10 1507 and are intended to serve as a locally unique identifier for a process. A process ID cannot be considered a unique identifier since process IDs are repeatable.
@mattifestation
mattifestation / TLGMetadataParser.psm1
Last active January 18, 2024 17:21
Retrieves TraceLogging metadata from a file.
#requires -version 5
<#
The things you find on Google searching for specific GUIDs...
Known Keyword friendly names:
"UTC:::CATEGORYDEFINITION.MS.CRITICALDATA":"140737488355328"
"UTC:::CATEGORYDEFINITION.MS.MEASURES":"70368744177664"
"UTC:::CATEGORYDEFINITION.MS.TELEMETRY":"35184372088832"
"UTC:::CATEGORYDEFINITION.MSWLAN.CRITICALDATA":"2147483648"
@DavidBuchanan314
DavidBuchanan314 / cursed_mandelbrot.c
Last active June 28, 2023 15:12
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout. Output can be seen at https://twitter.com/David3141593/status/1062468528115200001
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40
@bzub
bzub / 20180819-crostini_sommelier_fix.md
Last active January 24, 2024 12:15
Fix Crostini Wayland/X (sommelier) service

If you can't get X11 or Wayland GUI Linux apps to start anymore on Chrome OS, try the following.

In the Terminal app, this will show the status of your systemd user services/units:

systemctl --user

If sommelier@0.service and sommelier-x@0.service show a failed status, the following worked for me:

sudo ln -s /opt/google/cros-containers/bin/sommelier.elf /usr/bin/
@mattifestation
mattifestation / SysmonEventGUIDParser.ps1
Last active March 9, 2024 08:37
Extracts fields from sysmon process and logon GUIDs
# Author: Matthew Graeber (@mattifestation)
$Epoch = Get-Date '01/01/1970'
# Conversion trick taken from https://blogs.technet.microsoft.com/heyscriptingguy/2017/02/01/powertip-convert-from-utc-to-my-local-time-zone/
$StrCurrentTimeZone = (Get-WmiObject Win32_timezone).StandardName
$TZ = [TimeZoneInfo]::FindSystemTimeZoneById($StrCurrentTimeZone)
# Parse out all the LogonGUID fields for sysmon ProcessCreate events
Get-WinEvent -FilterHashtable @{ LogName = 'Microsoft-Windows-Sysmon/Operational'; Id = 1 } | ForEach-Object {