Skip to content

Instantly share code, notes, and snippets.

Antonios Hadjigeorgalis AntoniosHadji

View GitHub Profile
@AntoniosHadji
AntoniosHadji / main.c
Created Apr 11, 2019
test c program for testing python subprocess
View main.c
#define _POSIX_C_SOURCE 199309L
#include <stdio.h>
#include <time.h>
int main(int argc,char* argv[])
{
time_t now;
time(&now);
printf("Today is: %s", ctime(&now));
@AntoniosHadji
AntoniosHadji / log_path.py
Last active Apr 11, 2019
archive log files
View log_path.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from pathlib import Path
import datetime
import time
print(os.path.dirname(__file__))
print(type(os.path.dirname(__file__)))
print(os.path.dirname(os.path.abspath(__file__)))
@AntoniosHadji
AntoniosHadji / benchmark.py
Created Mar 8, 2019
Using timeit as library
View benchmark.py
import timeit
import random
def test(setup, cmd):
repeat = 3
precision = 3
t = timeit.Timer(stmt=cmd, setup=setup)
number, _ = t.autorange()
r = t.repeat(repeat, number)
@AntoniosHadji
AntoniosHadji / cli.py
Created Feb 20, 2019
python cli option parser with logging
View cli.py
#!/usr/bin/env python3
import argparse
import logging
import os
import pathlib
import sys
from datetime import date, timedelta
# create logger
@AntoniosHadji
AntoniosHadji / gnucash.trace
Created Dec 31, 2018
gnucash --debug --extra plus files for version 3.4 build
View gnucash.trace
* 14:19:42 DEBUG <gnc.module> module_name: gnucash/app-utils
* 14:19:42 WARN <gnc.module> Could not locate module gnucash/app-utils interface v.0
* 14:19:42 DEBUG <gnc.module> module_name: gnucash/gnome-utils
* 14:19:42 WARN <gnc.module> Could not locate module gnucash/gnome-utils interface v.0
* 14:19:42 DEBUG <gnc.module> module_name: gnucash/gnome-search
* 14:19:42 WARN <gnc.module> Could not locate module gnucash/gnome-search interface v.0
* 14:19:42 DEBUG <gnc.module> module_name: gnucash/register/ledger-core
* 14:19:42 WARN <gnc.module> Could not locate module gnucash/register/ledger-core interface v.0
* 14:19:42 DEBUG <gnc.module> module_name: gnucash/register/register-core
* 14:19:42 WARN <gnc.module> Could not locate module gnucash/register/register-core interface v.0
@AntoniosHadji
AntoniosHadji / Dockerfile
Last active Nov 24, 2018
Dockerfile to create Centos Latest with Python 3.7.1 (working as of 11/24/2018)
View Dockerfile
FROM centos:latest
# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG en_US.utf8
RUN yum -y update && yum -y groupinstall development
@AntoniosHadji
AntoniosHadji / update.R
Created Nov 1, 2018
update R to 3.5 and reinstall packages for jupyter notebook kernel on Ubuntu 18.04
View update.R
install.packages('base64enc')
install.packages('rprojroot')
install.packages('backports')
install.packages('rprojroot')
install.packages('rlang')
install.packages('digest')
install.packages('Rcpp')
install.packages('jsonlite')
install.packages('glue')
install.packages('devtools')
View gist:a87bab0026cd85c101a44185b7f3d3bb
Verifying my Blockstack ID is secured with the address 1CAQpfwPf5wtQ514LN4NsgvH1TXsd1gZkb https://explorer.blockstack.org/address/1CAQpfwPf5wtQ514LN4NsgvH1TXsd1gZkb
@AntoniosHadji
AntoniosHadji / parity.service
Created Sep 25, 2017
systemd unit file for parity with clean exits
View parity.service
[Unit]
Description=Parity Daemon
After=network.target
[Service]
# https://www.freedesktop.org/software/systemd/man/systemd.service.html#Command%20lines
ExecStart=/usr/bin/parity --config /etc/parity/config.toml
# Specifies how processes of this unit shall be killed.
# One of control-group, process, mixed, none.
View ethminer.txt
ethminer -G -M -v 9
ℹ 19:46:47|ethminer Found suitable OpenCL device [ Ellesmere ] with 6200512512 bytes of GPU memory
Benchmarking on platform: CL
Preparing DAG for block #0
cl 19:46:47|cl-0 No work. Pause for 3 s.
Warming up...
cl 19:46:50|cl-0 New work: header #50c856ae… target 0000000000000002000000000000000000000000000000000000000000000000
cl 19:46:50|cl-0 New seed #00000000…
cl 19:46:51|cl-0 Platform: AMD Accelerated Parallel Processing
cl 19:46:51|cl-0 Device: Ellesmere / OpenCL 1.2 AMD-APP (2442.7)
You can’t perform that action at this time.