Skip to content

Instantly share code, notes, and snippets.

View usvi's full-sized avatar

Janne Paalijarvi usvi

View GitHub Profile
@usvi
usvi / epoll_test.c
Last active August 15, 2023 15:42
Epoll test with arbitrary event data fd
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <semaphore.h>
#include <pthread.h>
#include <sys/epoll.h>
// gcc -Wall epoll_test.c -o epoll_test -lpthread
// ./epoll_test
#include <windows.h>
LRESULT CALLBACK HelloWndProc (HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCMLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("HelloApplication");
HWND hwnd,hwnd2;
MSG msg;
@usvi
usvi / TemporaryResearchMib.txt
Created December 4, 2021 14:10
SNMP MIB definition demonstrating proper use of OBJECT-GROUP, NOTIFICATION-GROUP, MODULE-COMPLIANCE (according to smilint)
TEMPORARY-RESEARCH-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, enterprises, Integer32, NOTIFICATION-TYPE FROM SNMPv2-SMI
OBJECT-GROUP, NOTIFICATION-GROUP, MODULE-COMPLIANCE FROM SNMPv2-CONF;
exampleCorp MODULE-IDENTITY
LAST-UPDATED "202111241500Z"
@usvi
usvi / RemoveOSCHeck.vbs
Created December 1, 2020 18:25
RemoveOSCHeck.vbs
' name this file as RemoveOSCHeck.vbs
' This script can be used to remove operating system version checks (2000, xp, vista, 7)
' or architecture checks used for (32-bit x86 or 64-bit x64 systems)
' that are part of an MSI installer. To use drag an MSI file to RemoveOSCHeck.vbs icon.
Option Explicit
Const msiOpenDatabaseModeReadOnly = 0
Const msiOpenDatabaseModeTransact = 1
Dim argNum, argCount:argCount = Wscript.Arguments.Count
[Unit]
# Put this file as (chmod 644) /etc/systemd/system/simple-nat.service
# Then systemctl start simple-nat
# Finally systemctl enable simple-nat
# Reboot to see it works
# Public if = enp1s0
# Private if = enp2s0
Description=Simple NAT
Before=network-pre.target
Wants=network-pre.target
@usvi
usvi / APKBUILD
Last active October 12, 2020 21:43
Alpine Linux APKBUILD for Samsung splix drivers
# Contributor: Aurelien Crock
# Contributor: Till Kamppeter
# Maintainer: Janne Paalijarvi <jpaalija@gmail.remove.com>
pkgname=splix
pkgver=2.0.0
pkgrel=2
pkgdesc="Samsung printers CUPS support files"
url="http://splix.ap2c.org/"
arch="all"
license="GPL"
[ 95.746248] usb 1-1: new high-speed USB device number 2 using ehci-pci
[ 96.745865] usb 1-1: New USB device found, idVendor=046d, idProduct=0809, bcdDevice= 0.10
[ 96.745867] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
[ 96.745872] usb 1-1: SerialNumber: B5908D8C
[ 96.774296] type=1400 audit(1589753654.797:484): avc: denied { write } for pid=2065 comm="Binder:2065_D" name="timerslack_ns"\
dev="proc" ino=14995 scontext=u:r:system_server:s0 tcontext=u:r:mediaprovider:s0:c512,c768 tclass=file permissive=1
[ 96.774299] type=1400 audit(1589753679.963:485): avc: denied { sys_module } for pid=1880 comm="ueventd" capability=16 scontex\
t=u:r:ueventd:s0 tcontext=u:r:ueventd:s0 tclass=capability permissive=1
[ 96.774323] type=1400 audit(1589753679.963:485): avc: denied { sys_module } for pid=1880 comm="ueventd" capability=16 scontex\
t=u:r:ueventd:s0 tcontext=u:r:ueventd:s0 tclass=capability permissive=1
test complete
test reset
test define
test add 400ms pwm2.0 monitor
test add 1s end
test commit
test run
ok
ok
ok