Skip to content

Instantly share code, notes, and snippets.

Avatar
😑
po koleno v kode

Terenty Rezman terenty-rezman

😑
po koleno v kode
View GitHub Profile
@terenty-rezman
terenty-rezman / serialize.cpp
Created Mar 3, 2021
Qt serialization example
View serialize.cpp
#include <QtCore/QCoreApplication>
#include <qdatastream.h>
#include <qvector3d.h>
#include <qdebug.h>
#include <qtcpserver.h>
#include <qtcpsocket.h>
int main(int argc, char* argv[])
{
@terenty-rezman
terenty-rezman / build-linux-img.sh
Created Feb 2, 2021
build bootable linux.img from linux kernel image and initrd image
View build-linux-img.sh
#!/usr/bin/env bash
# creates bootable disk image as file (e.g. linux.img)
# places kernel image and initrd image on this disk
# and uses grub install to make it bootable
# then you can test it with smthng like 'qemu-system-x86_64 linux.img'
echo
set -e # terminate script on error
@terenty-rezman
terenty-rezman / logger.py
Created Oct 12, 2020
linux 'logger' command in python
View logger.py
#!/usr/bin/env python3
"""
does the same as linux 'logger' command (on a basic level)
writes msg to rsyslog from current user
linux 'logg
@terenty-rezman
terenty-rezman / openvpn_clients.py
Created Jul 23, 2020
print currently connected OpenVPN clients to console
View openvpn_clients.py
#!/usr/bin/env python3
from telnetlib import Telnet
import telnetlib
import re
# openvpn managment address and port
HOST = "localhost"
PORT = 9969
@terenty-rezman
terenty-rezman / mobaxterm_wrapper.bat
Last active Jul 23, 2020
EVE-NG mobaXterm wrapper Windows
View mobaxterm_wrapper.bat
python "C:\Program Files\EVE-NG\mobaxterm_wrapper.py" %1
@terenty-rezman
terenty-rezman / scrollbar.py
Last active Jul 2, 2020
QScrollBar over content
View scrollbar.py
# to have fancy transparent scrollbars over your content
# all you need is to adjust viewport margins with negative values like this:
# scroll_area = QScrollArea()
scroll_area.setViewportMargins(0, 0, -8, -8)
# also here are some styles to make your scrolbars even fancier:
QScrollBar:vertical {
border: none;
background-color: transparent;