Skip to content

Instantly share code, notes, and snippets.

View athoik's full-sized avatar

Athanasios Oikonomou athoik

  • Future Group
  • Earth
View GitHub Profile
@athoik
athoik / test_mjd.cpp
Created January 5, 2019 16:09
POC to expose issue on parseDVBdate Enigma2 under aarch64
#include <stdio.h>
#include <ctime>
static void parseDVBdate(tm &t, int mjd)
{
int k;
printf("[eDVBLocalTimerHandler] parseDVBdate, mjd is %d\n", mjd);
t.tm_year = (int) ((mjd - 15078.2) / 365.25);
@athoik
athoik / festat.py
Created October 24, 2018 17:22
Get frontend statistics using python
import sys
import fcntl
import ctypes
_IOC_NRBITS = 8
_IOC_TYPEBITS = 8
_IOC_SIZEBITS = 14
_IOC_DIRBITS = 2
_IOC_NRSHIFT = 0
@athoik
athoik / DTV_SCRAMBLING_SEQUENCE_INDEX.patch
Last active September 12, 2018 05:12
Patch to support the new DTV_SCRAMBLING_SEQUENCE_INDEX on enigma2
diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp
index 96f52b5..30918be 100644
--- a/lib/dvb/frontend.cpp
+++ b/lib/dvb/frontend.cpp
@@ -1420,6 +1420,7 @@ void eDVBFrontend::getTransponderData(ePtr<iDVBTransponderData> &dest, bool orig
p[cmdseq.num++].cmd = DTV_FREQUENCY;
p[cmdseq.num++].cmd = DTV_INVERSION;
p[cmdseq.num++].cmd = DTV_MODULATION;
+ p[cmdseq.num++].cmd = DTV_API_VERSION;
if (type == feSatellite)
@athoik
athoik / bandwidth.py
Created August 15, 2018 16:04
Measure traffic per second using /proc/net/dev
import time
last = 0L
while True:
current = 0L
lines = open("/proc/net/dev").readlines()[3:]
for l in lines:
ll = l.split()
current += long(ll[1])+long(ll[9])
delta = current - last
@athoik
athoik / downgrade.kernel.sh
Created January 16, 2018 20:56
opkg downgrade kernel 4.8.17-r2 to 4.8.17-r1 (can be made better)
opkg list-installed | grep kernel | grep r2 | awk '{ print "opkg install " $1 "=4.8.17-r1 --force-downgrade" }' | sh
@athoik
athoik / dab_raw_record.sh
Created January 13, 2018 22:13
Record an RAW file using rtl_sdr from welle.io checked using shellcheck
#!/bin/bash
#
# Copyright (C) 2016
# Albrecht Lohofener <albrechtloh@gmx.de>
#
# dab_raw_record 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.
@athoik
athoik / SYS_ioprio.cpp
Created November 26, 2017 20:22
A sample to demonstrate the values of SYS_ioprio_get and SYS_ioprio_set when using syscall header
#include <sys/syscall.h>
#include <iostream>
int main()
{
std::cout << "SYS_ioprio_get:" << SYS_ioprio_get << " SYS_ioprio_set:" << SYS_ioprio_set << std::endl;
return 0;
}
@athoik
athoik / ci_ioctl.py
Created November 21, 2017 21:07
test ci ioctl
import os
import ctypes
libc = ctypes.cdll.LoadLibrary('libc.so.6')
ioctl = libc.ioctl
buffer = ctypes.c_char_p("\0"*256)
fd = os.open("/dev/ci0", os.O_RDWR | os.O_NONBLOCK)
ioctl(fd, 1, buffer)
@athoik
athoik / branding.cpp
Created November 4, 2017 18:21
Branding Test for E2
#include <iostream>
#include <fstream>
#include <iostream>
#include <map>
class Branding
{
std::map<std::string,std::string> m_branding;
public:
Branding();
@athoik
athoik / testapi5.cpp
Created February 8, 2017 13:19
Simple Utility to query DVB API 5 statistics (with some code borrowed from other utilities)
#include <linux/dvb/version.h>
#include <linux/dvb/frontend.h>
#include <iostream>
#include <sstream>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>