Skip to content

Instantly share code, notes, and snippets.

View bukowa's full-sized avatar

Buk Bukowski bukowa

View GitHub Profile
@bukowa
bukowa / appendmenu.py
Created May 11, 2024 08:18
silent hunter 3 append menu item
import configparser
import os
def replace_second_occurrence(_text, _old, _new):
first_index = _text.find(_old)
if first_index != -1: # If the substring exists
second_index = _text.find(_old, first_index + 1)
if second_index != -1: # If a second occurrence exists
# Replace the second occurrence
return _text[:second_index] + _text[second_index:].replace(_old, _new, 1)
@bukowa
bukowa / metaeditor.ini
Created December 28, 2023 20:26
mql4 darcula pitch black
[Colors]
Color0=0
Color1=14013135
Color2=14013135
Color3=8478743
Color4=0
Color5=3307724
Color6=9079434
Color7=11117660
Color8=14013135
@bukowa
bukowa / run.py
Created December 28, 2023 11:40
change visibility of all gitlab projects
import gitlab
# Replace these values with your GitLab information
gitlab_url = "https://gitlab.com"
private_token = ""
group_id = ""
# Create a GitLab API connection
gl = gitlab.Gitlab(gitlab_url, private_token=private_token)
@bukowa
bukowa / parse.py
Created December 7, 2023 23:19
rithmic connection params generator for c sharp
# loop over all files in the current folder
# and process the file if the name ends with _connection_params.txt
import os
import re
import sys
@bukowa
bukowa / ATASPythonSocket.csproj
Last active November 30, 2023 12:13
ATASPythonSocket
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="ATAS.Indicators">
@bukowa
bukowa / pycharmbug.ipynb
Last active October 22, 2023 17:29
pycharmbug.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bukowa
bukowa / main.py
Last active September 2, 2023 12:44
mt4 sync copy
import os
import shutil
from pathlib import Path
MT4_DIR = Path("C:\\Users\\buk\\AppData\\Roaming\\MetaQuotes\\Terminal\\")
MT4_MASTER = MT4_DIR / '2C68BEE3A904BDCEE3EEF5A5A77EC162'
BACKUP_DIR = MT4_DIR / 'backup'
CACHE_FILE = 'mqlcache.dat'
@bukowa
bukowa / README
Last active April 14, 2023 23:18
grafana freqtrade dashboard
its WIP but works, just
1. run grafana if u dont have it docker run --rm -it -e GF_SECURITY_ADMIN_PASSWORD=admin -p 9312:3000 --network=host grafana/grafana
2. run run.py in folder above user_data
3. in grafana install plugin simplejson
4. make new data source in grafana simplejson with url http://localhost:3004
5. place config for your strategy in user_data/configs
i think it's all its not complete but works maybe someone can pick it up from here
@bukowa
bukowa / error
Created April 14, 2023 19:50
illegal
Fatal Python error: Illegal instruction
Current thread 0x00007ff510b33740 (most recent call first):
File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 1176 in create_module
File "<frozen importlib._bootstrap>", line 571 in module_from_spec
File "<frozen importlib._bootstrap>", line 674 in _load_unlocked
File "<frozen importlib._bootstrap>", line 1006 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
File "/home/ftuser/.local/lib/python3.10/site-packages/pyarrow/__init__.py", line 65 in <module>
@bukowa
bukowa / Dockerfile
Created March 13, 2023 19:35
django Dockerfile
ARG PYTHON_VERSION="3.11"
FROM python:${PYTHON_VERSION}-slim as builder
ENV PYTHONUNBUFFERED 1
# todo HEALTHCHECK
# https://docs.docker.com/engine/reference/builder/#healthcheck
RUN apt-get update \
&& apt-get install -y \
wait-for-it \