Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🀇🀇🀊🀋🀇🀊🀙🀡🀙🀡🀗🀐🀆

dantmnf

💭
🀇🀇🀊🀋🀇🀊🀙🀡🀙🀡🀗🀐🀆
View GitHub Profile
@dantmnf
dantmnf / stm.c
Last active Dec 17, 2015
a small program to show the time spent from Windows startup
View stm.c
#define UNICODE
#include <windows.h>
#ifdef __GNUC__
#define wWinMain WinMain //MinGW does not support wWinMain
#define WINMAIN_CMDLINE_TYPE LPSTR
#else
#define WINMAIN_CMDLINE_TYPE LPWSTR
#endif
@dantmnf
dantmnf / local.conf.xml
Last active Dec 24, 2015
fontconfig configuration file
View local.conf.xml
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="hinting"><bool>false</bool></edit>
<edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
<edit mode="assign" name="rgba"><const>rgb</const></edit>
<edit mode="assign" name="antialias"><bool>true</bool></edit>
<edit mode="assign" name="lcdfilter"><const>lcddefault</const></edit>
@dantmnf
dantmnf / duppkt.rb
Created Dec 20, 2014
script to duplicate outgoing TCP packets
View duppkt.rb
#!/usr/bin/env ruby
require 'socket'
require 'pcaprub'
require 'packetfu'
IDENTIFY_TTL = 105
interface = 'eth0'
DUPS = 1 # number of duplicated packet(s)
SIOCGIFINDEX = 0x8933
@dantmnf
dantmnf / chnips.list
Last active Apr 21, 2016
Global proxy using badvpn-tun2socks
View chnips.list
1.0.1.0/24
1.0.2.0/23
1.0.8.0/21
1.0.32.0/19
1.1.0.0/24
1.1.2.0/23
1.1.4.0/22
1.1.8.0/21
1.1.16.0/20
1.1.32.0/19
@dantmnf
dantmnf / fonts.sh
Last active Apr 18, 2019
one-key script to set correct font family fallbacks on Arch Linux (and maybe other distros)
View fonts.sh
#!/bin/bash
if (( EUID != 0 ))
then
echo "I need root!"
exit 1
fi
echo "writing /etc/fonts/conf.d/79-order.conf"
cat > /etc/fonts/conf.d/79-order.conf <<EOFC
<?xml version='1.0'?>
@dantmnf
dantmnf / gitwrapper.bat
Last active Nov 4, 2017
use cygwin git in vscode
View gitwrapper.bat
@D:/cygwin64/bin/bash.exe /usr/bin/gitwrapper.sh "%*"
@dantmnf
dantmnf / winocr.py
Last active Jun 4, 2021
WinRT OcrEngine from Python
View winocr.py
import sys
import asyncio
import base64
import copy
import pprint
# pip3 install winrt
from winrt.windows.media.ocr import OcrEngine
from winrt.windows.globalization import Language
from winrt.windows.graphics.imaging import *
from winrt.windows.security.cryptography import CryptographicBuffer
View Setup-VMGpuPartitionAdapter.ps1
$ErrorActionPreference = "Stop"
$vmobject = Get-VM | Out-GridView -Title "Select VM to setup GPU-P" -OutputMode Single
$vmid = $vmobject.VMId
Write-Host "Stopping VM"
$vmobject | Stop-VM
Write-Host "Disabling checkpoints for VM"
$vmobject | Set-VM -CheckpointType Disabled
Write-Host "Enabling heartbeat service for VM"
$vmobject | Enable-VMIntegrationService -Name Heartbeat