Skip to content

Instantly share code, notes, and snippets.

View inequation's full-sized avatar
🤔

Leszek Godlewski inequation

🤔
View GitHub Profile
#!/usr/bin/python
points = range(700)
def dispatch(packet):
global markings, packet_count, pair_count
if 'markings' not in globals():
markings = [[i == j for j in xrange(len(points))] for i in xrange(len(points))]
for pair in packet:
if pair[1] < pair[0]:
@inequation
inequation / profile after.log
Created June 5, 2016 12:34
GPU profiling log from The Vanishing of Ethan Carter, as of the VR version. How to interpret: https://docs.unrealengine.com/latest/INT/Engine/Performance/GPU/
[2016.06.05-12.06.33:539][ 89]LogRHI:Warning: Perf marker hierarchy, total GPU time 8.82ms
[2016.06.05-12.06.33:539][ 89]LogRHI:Warning: Profiled range was continuous.
[2016.06.05-12.06.33:540][ 89]LogRHI:Warning: 100.0% 8.82ms FRAME 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:540][ 89]LogRHI:Warning: 98.5% 8.68ms Scene 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:540][ 89]LogRHI:Warning: 4.2% 0.37ms PrePass 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:541][ 89]LogRHI:Warning: 0.0% 0.00ms BeginRenderingPrePass 1 draws 0 prims 0 verts
[2016.06.05-12.06.33:541][ 89]LogRHI:Warning: 2.4% 0.21ms View0 131 draws 466492 prims 351827 verts
[2016.06.05-12.06.33:541][ 89]LogRHI:Warning: 1.8% 0.16ms View1 125 draws 441944 prims 334610 verts
[2016.06.05-12.06.33:542][ 89]LogRHI:Warning: 0.1% 0.00ms BeginOcclusionTests 0 draws 0 prims 0 verts
[2016.06.05-12.06.33:542][ 89]LogRHI:Warning: 0.0% 0.00ms IndividualQueries 67 draws 804 prims 536 verts
@inequation
inequation / profile before.log
Last active June 5, 2016 11:53
GPU profiling log from The Vanishing of Ethan Carter, as of the PS4/Redux version. How to interpret: https://docs.unrealengine.com/latest/INT/Engine/Performance/GPU/
[2016.06.05-11.45.31:060][817]LogRHI:Warning: Perf marker hierarchy, total GPU time 13.91ms
[2016.06.05-11.45.31:061][817]LogRHI:Warning: Profiled range was continuous.
[2016.06.05-11.45.31:061][817]LogRHI:Warning: 100.0%13.91ms FRAME 2 draws 4 prims 8 verts
[2016.06.05-11.45.31:062][817]LogRHI:Warning: 98.9%13.76ms Scene 0 draws 0 prims 0 verts
[2016.06.05-11.45.31:063][817]LogRHI:Warning: 17.2% 2.39ms PrePass 0 draws 0 prims 0 verts
[2016.06.05-11.45.31:063][817]LogRHI:Warning: 0.0% 0.00ms BeginRenderingPrePass 1 draws 0 prims 0 verts
[2016.06.05-11.45.31:063][817]LogRHI:Warning: 11.9% 1.65ms View0 19 draws 38570 prims 83739 verts
[2016.06.05-11.45.31:064][817]LogRHI:Warning: 9.1% 1.27ms PosOnlyOpaque 302 draws 1484593 prims 1029830 verts
[2016.06.05-11.45.31:064][817]LogRHI:Warning: 0.5% 0.08ms Opaque 27 draws 142381 prims 142652 verts
[2016.06.05-11.45.31:064][817]LogRHI:Warning: 2.1% 0.29ms Masked 244 draws 325710 prims 313311 verts
@inequation
inequation / Declutter.ps1
Last active April 22, 2017 18:19
Simple script to remove all the Windows 10 default useless apps bovine feces, with a few exceptions for the useful ones.
taskkill /f /im OneDrive.exe
& "$env:SystemRoot\SysWOW64\OneDriveSetup.exe" /uninstall
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
#Get-AppxPackage *windowscalculator* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
#Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
@inequation
inequation / wusb54gc-v2-on-windows-8.md
Created December 22, 2015 14:36
Short guide to installing Linksys WUSB54GC v2 drivers on Windows 8

I haven't been able to find a working, pre-packaged driver for this WiFi stick at all. It seems that this revision (v2) was short-lived and its support was likewise. One can only find support articles for the original device revision ("v1") and the final one (v3), but not for v2. To add insult to injury, all revisions use different chipsets, which makes them totally different devices, not just "revisions", and -- by extension -- their drivers cannot be used interchangeably.

For tl;dr just scroll down to solution.

Why doesn't it work?!

There are quite a few links on the net that advertise as drivers for this particular model, but none of them worked for me. And in fact, the majority of them were in fact mislabeled v1 or v3 drivers.

Knowing, however, that what really matters is the chipset, I established that this particular device sports a Realtek RTL8187B chipset and went over to Realtek's website (RTL8187B

@inequation
inequation / hdd2ssd-dualboot.md
Last active December 9, 2022 00:58
Guide to migrating a dual-boot Linux/Windows system to an SSD

Having painstakingly performed the operation of migrating dual-boot systems to SSDs (without a fresh install of any of the systems) twice in the recent days, I've decided to write the steps down in case I ever need to repeat it. It may also benefit someone else on the internet. This is the most efficient and least error-prone workflow to the best of my knowledge, and discovering it was not as easy as it may seem.

Please excuse the somewhat short-hand form of this guide; I take the liberty to assume the reader is a power-user and is at least familiar with Linux.

The scenario

Here are the specific conditions I worked under:

  • Dual-boot, Linux/Windows system.
  • MBR partition tables.
@inequation
inequation / gist:8708932
Created January 30, 2014 14:01
Casting madness
// g++ test.cpp -o test -m32
#include <stdint.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
void *foo = (void *)0xF0000000;
int bar = 0;
int64_t x = reinterpret_cast<int32_t>(foo) | (static_cast<int64_t>(bar) << 32);
@inequation
inequation / extract-file-list.py
Last active December 23, 2015 08:09
A tool to extract file names from Visual Studio project files to makefile includes
#!/usr/bin/python
import sys
import os
if (len(sys.argv) < 3):
print("Usage: {0} <VC++ project file> <output directory>".format(sys.argv[0]))
exit()
f = open(sys.argv[1], 'r')
@inequation
inequation / gist:3034800
Created July 2, 2012 18:36
Drawer models
std::queue< std::pair<int, int> * > task_queue;
void draw_pooled(int w, int h, const char *fname) {
unsigned char *buf;
buf = new unsigned char[w * h * 3];
Scene::GetInstance().PrepareRender(w, h);
bool tasks_issued = false;
@inequation
inequation / hello.c
Created June 26, 2012 12:10
Lab AK - PVM
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pvm3.h>
#define BUFSIZE 256
int parent(int argc, char *argv[]);
int child();