Skip to content

Instantly share code, notes, and snippets.

View ekardon's full-sized avatar

Mümin Bilal KILIÇOĞLU ekardon

  • İstanbul, Turkey
View GitHub Profile

This data is intended to be used to analyze data for Liber Primus.

Through page 34-40 there are two numbers (1033, 3301) written in Babylonian number format, which is in base60. To able to analyze if there is any corrolation between prime numbers and bases, I calculated all possible values in different bases below 60 as in the example below. Then, I checked their primeness and related properties.

Data Dump

You can find the data dump in here!

Example

It's impossible to install PyQt5 out of the box with pip in Raspbian Buster

Here is what I did

It's quite long beat with me. (First part is from official guide with extended dependencies https://wiki.qt.io/Building_Qt_5_from_Git) First we enable source repo

sudo nano /etc/apt/sources.list

To enable it we need to uncomment in the following way

@ekardon
ekardon / barcodereader.py
Created September 23, 2020 09:32 — forked from JoachimL/barcodereader.py
Python USB barcode reader
import evdev
from evdev import *
from azure.storage.queue import QueueService, QueueMessageFormat
import threading
import time
from queue import *
import datetime
# responsible for uploading the barcodes to the azure storage queue.
class BarcodeUploader:
# get OpenCL driver automated installer (installs kernel 4.7)
curl https://software.intel.com/sites/default/files/managed/f6/77/install_OCL_driver.sh_.txt > install_OCL_driver.sh
chmod +x install_OCL_driver.sh
# install OpenCL driver
sudo ./install_OCL_driver.sh install
# check
ls /boot/vmlinuz-*intel*
# BASH ISN'T PREINSTALLED SO YOU HAVE TO MANUALLY INSTALL IT TO USE THIS SCRIPT
tce-load -iw bash
# FIX WRONG TIME TO SOLVE SSL PROBLEMS
tce-load -iw ntpclient
sudo ntpclient -s -c 1 -h pool.ntp.org
# REQUIRED PACKAGE LIST
# https://xmrig.com/docs/miner/build/ubuntu
tce-load -iw git compiletc cmake automake autoconf libtool libtool-dev
@ekardon
ekardon / ctypes_example.py
Last active May 4, 2021 18:05
This is a partial snippet, so there may be some missing/undefined parts
from ctypes import CFUNCTYPE, c_int, POINTER, byref, c_char_p, c_har, c_vooid_p, c_uint
# SOURCE: https://docs.nvidia.com/deploy/nvml-api/group__nvmlDeviceQueries.html
class nvmlPciInfo_t(Structure):
_fields_ = [
("bus", c_uint), # 0 to 0xff
("busId", c_char * NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE), # string + 0x00
("busIdLegacy", c_char * NVML_DEVICE_PCI_BUS_ID_BUFFER_V2_SIZE), # string + 0x00
("device", c_uint), # 0 to 31
@ekardon
ekardon / appx_install.ps1
Created November 27, 2021 16:41
Appx installer with dependencies
<#
Folder structure:
./
├─ Main.appxbundle
├─ Dependencies/
├─ Dependency1.appx
├─ Dependency2.appx
#>
<#
Example appxpackage manifest structure:
>(Get-Appxpackage *windowsstore* | Get-appxpackagemanifest).package
IgnorableNamespaces : uap mp rescap wincap build
xmlns : http://schemas.microsoft.com/appx/manifest/foundation/windows10
mp : http://schemas.microsoft.com/appx/2014/phone/manifest
uap : http://schemas.microsoft.com/appx/manifest/uap/windows10
rescap : http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities
@ekardon
ekardon / Introduction.md
Created January 11, 2022 13:49
Personel Workspace on Amazon EC2 instance

So I have been trying to create a workspace for myself to develop Django project using postgresql 14.1, python3.9.5 and PyCharm.

Amazon has a product for this "Amazon Workspaces" and its free ties provides 40 hours/month free usage over 1 year. However that's not enough to develop a software or whatsoever. So i wanted to figure out how I can create a workspace on my own using "Amazon EC2" instances which has 750 hours/month over a year.

Here, I will share my trial and error results.

Amazon Workspaces: What is it? Is it free?

Amazon Workspaces is a neat platform where you can use a cloud desktop instance in anywhere. There are multiple client apps for almost any platform (Windows, Linux, MacOS, Android, iOS, web client)

@ekardon
ekardon / clean_migrate.ps1
Created January 26, 2022 00:09
This script will let you easily undone migrations, remove migration files, re-migrate and createsuperuser in one go.
<#
This script will let you easily undone migrations, removing migration files, re-migrate and createsuperuser.
It's cumbursome to do this all the time by hand. Well, normally you wouldn't need to do this very frequently,
but for beginners like me, it is convinient to have a script to automate this.
#>
# Find manage.py and set project folder accordingly
$manager = Get-Item -Path ".\*", ".\*\*" | Where-Object {$_.name -match "manage.py"}