Skip to content

Instantly share code, notes, and snippets.

View Axeltherabbit's full-sized avatar
💀
dead

Axel Axeltherabbit

💀
dead
View GitHub Profile
@Axeltherabbit
Axeltherabbit / arbiter.py
Last active April 3, 2023 22:31
2 players game socket example with server as arbiter
#!/usr/bin/python # This is server.py file
import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
print(host)
port = 8085 # Reserve a port for your service.
print('Server started!')
print('Waiting for clients...')
@Axeltherabbit
Axeltherabbit / riak_install_WSL.txt
Last active October 7, 2022 10:32
Riak for WSL with systemd
# this is for WSL ubuntu 20
# enable systemd and reboot windows https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/
curl -fsSL https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/erlang.gpg
echo "deb https://packages.erlang-solutions.com/ubuntu focal contrib" | sudo tee /etc/apt/sources.list.d/erlang-solution.list
sudo apt update
sudo apt upgrade
sudo apt-get install build-essential libc6-dev-i386 git cmake make ubuntu-dev-tools erlang curl software-properties-common apt-transport-https lsb-release libpam0g-dev debhelper
#alias
alias xcopy='xclip -selection clipboard'
alias xpaste='xclip -selection clipboard -o'
alias ls='ls --color=auto'
alias vi='vim'
alias hg='history | grep'
alias replacegnome='gnome-shell --wayland --replace'
alias ssh_github_login='ssh -T git@github.com'
PS1='\[\033[01m\][ \[\033[01;34m\]\u@\h \[\033[00m\]\[\033[01m\]][\e[33m\]^_^\[\e[0m\]] \w\[\033[00m\]\n\[\033[01;34m\]$\[\033[00m\]> '
@Axeltherabbit
Axeltherabbit / Telegram-groupchat-stast.py
Last active March 31, 2022 15:56
Messy code but it creates a list with user's messages stats from a telegram group's exported json file
import json
from collections import namedtuple
class person:
def __init__(self, _id, username):
self.id = _id
self.username = username
self.msgs_len = []
from PIL import Image
# 1 is white
# 0 is black
m = [
[0],
]
print("generating")
for _ in range(10000):
@Axeltherabbit
Axeltherabbit / parser.py
Last active March 29, 2021 04:32
simple lichess puzzle database parser
from csv import reader
import sys
# puzzle database https://database.lichess.org/#puzzles
with open("lichess_db_puzzle.csv", "r") as f:
rating = int(sys.argv[1]) if len(sys.argv) > 1 else 1500
deviation = int(sys.argv[2]) if len(sys.argv) > 2 else 100
csv_reader = reader(f)
res = []
for row in csv_reader:
#!/bin/bash
#this is a custom file of the original source https://gist.github.com/hernamesbarbara/1937937
export TERM=xterm-color
export CLICOLOR=1
# export LSCOLORS=Exfxcxdxbxegedabagacad
import praw
import prawcore
import argparse
import time
from functools import wraps
from socket import error as SocketError
#######################################################################################
###the latest version is on github https://github.com/Axeltherabbit/RedditIDsGrabber###
#######################################################################################
@Axeltherabbit
Axeltherabbit / godotoldvideo.shader
Last active September 23, 2020 10:02
Old film shader for godot
shader_type canvas_item;
//original author : Wagner https://github.com/spite/Wagner/blob/master/fragment-shaders/old-video-fs.glsl
//original shader in godot2: airvikar https://www.youtube.com/watch?v=KlyTvUE2WJI
//translation from godot2 to godot3 : axeltherabbit https://gist.github.com/Axeltherabbit/f8075aba20096fd2f5b5206d97b9fc8c
float randi(vec2 co){return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);}
float rand(float c){return randi(vec2(c,1.0));}
float randomLine(float seed, vec2 uv){
float b= 0.01*rand(seed);
float a= rand(seed+1.0);
@Axeltherabbit
Axeltherabbit / YTPlaylistParser.py
Last active July 29, 2021 23:38 — forked from fffaraz/bs4.py
Python YouTube Playlist Link Collector
#regex original source http://code.activestate.com/recipes/578284-youtube-playlist-parserextractor/
#fork of https://gist.github.com/fffaraz/f3dcf48ae93b6c04adb9d74b1de711e5
#if you want to stream a yt-playlist with vlc use "python parser.py URLHERE -o playlist.m3u && cvlc --no-video playlist.m3u"
import re
import requests
import argparse