Skip to content

Instantly share code, notes, and snippets.

View EricsonWillians's full-sized avatar

Ericson Willians EricsonWillians

View GitHub Profile
@EricsonWillians
EricsonWillians / pylazy.py
Last active October 16, 2015 02:06
Pylazy is a script that changes in the PATH windows environment variable from python 2.x to python 3.x or vice-versa.
#
# pylazy.py
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This script recursively searches for python.exe in the C partition of the system,
# And adds its path to the system's PATH environment variable to help new users.
# It also considers some basic common softwares that uses Python, such as GIMP, and ignores them.
#
# This program is free software; you can redistribute it and/or modify
@EricsonWillians
EricsonWillians / luciano_silva_simulator.py
Created October 18, 2015 17:03
A Luciano Silva Simulator implemented in Python 3.x.
# -*- coding: utf-8 -*-
#
# luciano_silva_simulator.py
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@EricsonWillians
EricsonWillians / super_pylogin_3000.py
Created October 21, 2015 00:37
An example for someone in a facebook group.
# Super PyLogin 3000
import sys
USERS = {}
def create_account(username, password):
if not username in USERS:
USERS[username] = password
print("Account created")
@EricsonWillians
EricsonWillians / main.py
Last active November 6, 2015 18:30
Pyglet Game App Template
# main.py
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@EricsonWillians
EricsonWillians / insane_sorcerer.py
Last active March 15, 2016 06:58
Python script for sorcerers that use Tibia Auto.
"""
Insane Sorcerer Script for Tibia Auto (Tested with 8.6 client) and for http://tibiaauto.net/forum/,
By Ericson Willians (Rederick Deathwill): https://github.com/EricsonWillians
Instructions:
You just have to activate it and it will throw exori morts and frigos in all the visible targets,
The target on the battle may change, so don't be scared if the target changes suddenly,
Just be cautious and use it in relatively safe spawns (Since it can be too dangerous, due to the target change).
The script uses Utamo Vita and Utani Gran Hur constantly, so that you can forget about it.
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
public class Estabelecimento<T> {
final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
final String DB_URL = "jdbc:mysql://localhost/bd_gopg"; // Mudar o host / endereço do banco de dados aqui.
final String USER = "root"; // Mudar o usuário do banco de dados aqui.
final String PASS = ""; // Mudar a senha do banco de dados aqui.
T input = null;
@EricsonWillians
EricsonWillians / latest_dscovr.py
Last active October 7, 2018 00:46
Script to open on the web browser the latest image of Earth taken by NASA/DSCOVR's Earth Polychromatic Imaging Camera.
"""
Copyright (C) <2018> <Ericson Willians>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@EricsonWillians
EricsonWillians / custom_import.py
Created January 11, 2019 12:41
Custom module import example using AWS Lambda Layers (Python)
"""
When a custom lambda layer (zipped folder) is added, all lambda functions that use it put it on "/opt/LAYER".
In theory, "/opt/LAYER" should be added to the $PATH environment variable, but that didn't happen.
In any case, this is an example of how to import in an "absolute" fashion.
sample_lib/layer_test.py (That's the structure of the layer, which has a class named X.)
"""
import json
import os
import importlib.util
@EricsonWillians
EricsonWillians / clear_log_groups.py
Created March 18, 2022 15:39
Delete all cloudwatch log groups from all regions
import boto3
if __name__ == "__main__":
s = boto3.session.Session()
dynamodb_regions = s.get_available_regions('dynamodb')
for region in dynamodb_regions:
try:
logs = boto3.client('logs', region_name=region)
@EricsonWillians
EricsonWillians / compressor.py
Created August 31, 2023 14:45
Compressor Example
import numpy as np
from scipy.io import wavfile
from math import pow
def dB_to_ratio(dB):
return pow(10, dB / 20)
def compress_audio(sample_rate, audio, threshold, ratio, attack_time, release_time):
compressed_audio = np.zeros_like(audio, dtype=np.float32)
gain_reduction = 0