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 / ubit.lua
Last active August 29, 2015 14:07
Hacky unsigned bitlib
ubit=ubit or {}
local bit=bit
local ubit=ubit
function gen(name)
local f=bit[name]
if not f then error"?!?" end
local function func(...)
local ret = f(...)
@Python1320
Python1320 / airmovehack.lua
Last active August 29, 2015 14:14
GMod Lua sv_airaccelerate 1000 un****er
-- Status: Almost working. Fork and help make it better!
-- Objective:
-- Slow down the "instant" stops considerably
-- when trying to go opposite direction
-- of current movement while airmoving
-- and do not break airmoving too much
-- Setup: sv_airaccelerate 1000
-- required inputs:
-- sv_airaccelerate, GetVelocity,
-- GetViewAngles.yaw, GetForwardMove,
@Python1320
Python1320 / player.lua
Last active June 26, 2023 16:56
[GMod] individual player metatables with __index function now only a table (performance maybe)
local entity = FindMetaTable( "Entity" )
local meta = FindMetaTable( "Player" )
local panel = CLIENT and FindMetaTable( "Panel" )
local GetEngineTable = entity.GetTable
local pltostring = FindMetaTable"Player".__tostring
local R=debug.getregistry()
local lowest = math.huge
local setted = meta
local function SetPlyMeta(t) if R[lowest]~=setted then ErrorNoHalt("1WOO".. (R[lowest]==panel and "<A>" or '<B>') .."OT\n") end setted = t R[lowest]=t end
@Python1320
Python1320 / hook_singlepcall.lua
Created March 18, 2015 23:14
An attempt to make hook.lua with a single pcall, while maintaining recursion and allowing hooks to run even after an error
local gmod = gmod
local pairs = pairs
local isfunction = isfunction
local isstring = isstring
local IsValid = IsValid
local xpcall=xpcall
local debug=debug
local error=error
local print=print
local next=next
@Python1320
Python1320 / github_stalker.js
Created March 19, 2015 21:19
An attempt at getting new github commits for any repo.
// GitHub please let us subscribe to others repos with pubsubhubbub or something. your RSS and emails are annoying.
var fs = require("fs");
var data = require("./test_storage.json");
console.log("Config: ",JSON.stringify(data, null, 2));
function data_flush() {
fs.writeFile( "test_storage.json", JSON.stringify( data ), "utf8", function(err){
if (err) throw err;
console.log("<Saved: "+JSON.stringify( data )+">");
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,
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
if SERVER then
return
end
local function MenuPopulate()
local t = file.Find("lua/sprops/spawnlist/*.lua", "GAME")
if #t == 0 then
return
end
@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 / 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)