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 / 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 / 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)
@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 / 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 / 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 / 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())