Skip to content

Instantly share code, notes, and snippets.

View Python1320's full-sized avatar

Python1320 Python1320

  • M.Sc. (Tech.) Project Researcher
  • Finland
View GitHub Profile
@Python1320
Python1320 / gmod_altgrproblems.lua
Created September 5, 2021 16:46
Debugging altgr problems in Garry'sMod
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 100, 100 )
DermaPanel:SetSize( 500,800 )
DermaPanel:SetDraggable( true )
DermaPanel:MakePopup()
local a=vgui.Create'DHTML'
a:SetParent(DermaPanel)
a:Dock(FILL)
local strchar=string.char
local strfind=string.find
local gsub=string.gsub
local strsub=string.sub
local strlen=string.len
local tinsert=table.insert
local strlower=string.lower
local tremove=table.remove
local format=string.format
local getn=function(x) return #x end
@Python1320
Python1320 / accountage.lua
Created December 30, 2018 16:42
Steam account age estimator
local inspect = require "inspect"
local posix = require"posix"
local lfs = require'lfs'
local cjson = require'cjson.safe'
local lmfit = require 'lmfit'
function PrintTable(...)
print(inspect{...})
end
math.randomseed(os.time())
@Python1320
Python1320 / lexerglua.lua
Created December 6, 2018 12:49
GLua Lexer
-- https://raw.githubusercontent.com/LoganDark/lua-lexer/master/lexer.lua
-- MIT License
--
-- Copyright (c) 2018 LoganDark
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@Python1320
Python1320 / 0401-fix-irq-chip-for-exins.patch
Last active January 5, 2017 22:42
arv7510pw / ARV4510PW openwrt trunk linux kernel 4 pci troubles notes
--- a/arch/mips/lantiq/irq.c
+++ b/arch/mips/lantiq/irq.c
@@ -127,8 +127,8 @@ static int ltq_eiu_settype(struct irq_da
{
int i;
- for (i = 0; i < MAX_EIU; i++) {
- if (d->hwirq == ltq_eiu_irq[i]) {
+ for (i = 0; i < exin_avail; i++) {
+ if (d->irq == ltq_eiu_irq[i]) {
@Python1320
Python1320 / try_fix_spazz.lua
Last active December 18, 2015 15:09
Try to fix crouch spazzing in gmod
-- Still spazzes
--- when pushing against roof
--- When getting off grund
local ppos = Vector()
local view = { }
if GetConVar "developer":GetInt() > 0 then
RunConsoleCommand("contimes", "55")
end
@Python1320
Python1320 / dmesg_diff.patch
Created November 17, 2015 20:05
arv7510pw dmesg diff
index 505a363..9db563d 100644
--- "working.txt"
+++ "broken.txt"
@@ -1,18 +1,19 @@
-Linux version 3.10.49 (iriz@plutonium) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r43737) ) #2 Thu Dec 18 14:24:37 EET 2014
-SoC: Danube rev 1.5
+Linux version 4.1.11 (srcds@debian) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r47417) ) #1 Sat Nov 7 22:03:12 UTC 2015
+SoC: Danube rev 1.3
bootconsole [early0] enabled
-CPU revision is: 00019641 (MIPS 24KEc)
if SERVER then
return
end
local function MenuPopulate()
local t = file.Find("lua/sprops/spawnlist/*.lua", "GAME")
if #t == 0 then
return
end
diff --git a/target/linux/lantiq/patches-3.10/0153-lantiq-VPE-softdog.patch b/target/linux/lantiq/patches-3.10/0153-lantiq-VPE-softdog.patch
index d1382e7..b45ae58 100644
--- a/target/linux/lantiq/patches-3.10/0153-lantiq-VPE-softdog.patch
+++ b/target/linux/lantiq/patches-3.10/0153-lantiq-VPE-softdog.patch
@@ -158,14 +158,13 @@
+MODULE_DESCRIPTION("Software Watchdog For VPE1");
+MODULE_LICENSE("GPL");
---- a/arch/mips/lantiq/Makefile 2014-10-15 21:41:46.000000000 +0200
-+++ b/arch/mips/lantiq/Makefile 2014-10-19 22:44:44.000000000 +0200
diff --git a/target/linux/lantiq/patches-3.10/0202-owrt-lantiq-multiple-flash.patch b/target/linux/lantiq/patches-3.10/0202-owrt-lantiq-multiple-flash.patch
index 5c6d91c..1218339 100644
--- a/target/linux/lantiq/patches-3.10/0202-owrt-lantiq-multiple-flash.patch
+++ b/target/linux/lantiq/patches-3.10/0202-owrt-lantiq-multiple-flash.patch
@@ -113,7 +113,7 @@
+ else
+ ltq_mtd->map[i].phys = pdev->resource[i].start;
+ ltq_mtd->map[i].size = resource_size(&pdev->resource[i]);
-+ ltq_mtd->map[i].virt = devm_ioremap(&pdev->dev, ltq_mtd->map[i].phys,
++ ltq_mtd->map[i].virt = devm_ioremap(&pdev->dev, pdev->resource[i].start,