Skip to content

Instantly share code, notes, and snippets.

View David-Lor's full-sized avatar
🐍
entro.py

David Lorenzo David-Lor

🐍
entro.py
  • Vigo/Galiza/Spain
View GitHub Profile
@David-Lor
David-Lor / README.md
Last active August 14, 2017 22:04
Run Assassin's Creed II & OpenTexMod

Run AC2 + OpenTexMod

These two Batch scripts will launch OpenTexMod and, then, launch Assassin's Creed II. The script will wait until you close AC2, then it closes OpenTexMod and the script itself. This is specially useful for launching a game and, beforehand, a dependency. In this case, OpenTexMod, which is used in games like Assassin's Creed for replacing textures.

How to use

Replace the routes for the game and OpenTexMod executables on the script! This script was made for being used with the Assassin's Creed 2 Overhaul Mod, which uses OpenTexMod, but you can modify the script for any other game or dependency.

YOU MUST FOLLOW THE INSTRUCTIONS FROM THE OVERHAUL MOD. Specifically where it says to make OpenTexMod auto-load the textures for AC2! Otherwise this script will be useless!

@David-Lor
David-Lor / AsusD541S_FanControl.py
Created December 1, 2017 08:22
AsusD541S_FanControl
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import psutil
import subprocess
import atexit
from time import sleep
CMD_START = "sudo echo 1 | sudo tee /sys/class/hwmon/hwmon4/pwm1_enable"
CMD_STOP = "sudo echo 0 | sudo tee /sys/class/hwmon/hwmon4/pwm1"
@David-Lor
David-Lor / telebot_polling_template.py
Last active May 19, 2024 04:07
pyTelegramBotAPI - Never ending bot polling (recovery in failure)
"""
This is how I run my new bots created with pyTelegramBotAPI to avoid API errors,
like timeout errors or whenever my server can't reach Telegram servers (i.e. if net is down).
A while loop restarts the polling when it's ended due to an error.
A new bot object is created in each new loop execution, to avoid some errors.
We set all our message handlers in botactions() so the new bot object can use them.
Threading is not needed, but I prefer running the while True loop threaded so I can stop the bot
anytime with Ctrl+C, otherwise it can't be stopped easily. Killing the script is not nice and
I use databases in some bots, which should be closed beforehand.
@David-Lor
David-Lor / enable_i2c_openwrt_rpi1.md
Last active June 1, 2023 13:28
Enable I2C support on OpenWRT/LEDE @ Raspberry Pi (1 model B)

Enable I2C on OpenWRT/LEDE @ Raspberry Pi (1 model B)

/boot/config.txt

Edit this file on any computer, insert the SD card and create/enter the boot folder located at the FAT32 partition (it's very small, ~20MB).

Contents of the config.txt file:

@David-Lor
David-Lor / disablewupdateWatchdog.bat
Created March 7, 2018 17:50
Disable Windows Update "Watchdog"
@echo off
:loop
sc stop "wuauserv"
sc config "wuauserv" start= disabled
timeout 15
goto loop
@David-Lor
David-Lor / ACPowerAutoGovernor.sh
Created April 18, 2018 08:43
Set CPU governor depending on charge status of the laptop
#!/bin/bash
GOVERNOR_AC=performance # CPU governor when charging
GOVERNOR_DC=powersave # CPU governor when not charging
LOOP_FREQ=5 # Delay on AC status checking
function getAC { # Returns AC status (1=charging, 0=discharging)
echo $(cat /sys/class/power_supply/AC0/online)
}
@David-Lor
David-Lor / FreemodeMPCops.cs
Created May 3, 2018 19:02
GTA V Freemode MP Cops WIP
using GTA;
using GTA.Native;
using System;
using System.Windows.Forms;
using System.Collections.Generic;
public class FreemodeMP_Cops : Script
{
private int relationship_player=0, relationship_cop_wanted=0, relationship_cop_unwanted=0, prevWantedlevel = 0;
private List<Ped> cops = new List<Ped>();
@David-Lor
David-Lor / python_frases_diccionario.py
Created May 16, 2018 12:55
python frases diccionario
def contiene_hola():
print("el texto contiene 'hola'")
def contiene_que_tal():
print("el texto contiene 'que tal'")
def contiene_hasta_luego():
print("el texto contiene 'hasta luego'")
diccionario = {
@David-Lor
David-Lor / paratroopers.cs
Created June 29, 2018 13:59
gta v paratroopers wip
using GTA;
using GTA.Native;
using GTA.Math;
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
public class paracas : Script
{
@David-Lor
David-Lor / InstalarCronicleConda.md
Created October 3, 2018 18:53
Instalar Cronicle en virtualenv Conda