Skip to content

Instantly share code, notes, and snippets.

@technoscavenger
technoscavenger / qt-console.cpp
Created September 22, 2025 01:55
Qt Console app
#include <QCoreApplication>
#include <QTextStream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QTextStream(stdout) << "Hello, world\n";
return a.exec();
}
@technoscavenger
technoscavenger / highlight-sample.html
Created September 10, 2025 06:18
highlight sample code
<pre><code class="language-bash">netsh advfirewall firewall add rule name="RPC Endpoint Mapper" dir=in action=allow protocol=TCP localport=135
</code></pre>
@technoscavenger
technoscavenger / highlight-blogger.html
Last active September 10, 2025 06:15
Highlight.js Blogger modification
<link href='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css' rel='stylesheet'/>
<script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js'/>
<script type='text/javascript'>
hljs.configure({cssSelector: &quot;code&quot;});
hljs.highlightAll();
</script>
<script type='text/javascript'>
//<![CDATA[
@technoscavenger
technoscavenger / _etc_netplan_01-netcfg.yaml
Created May 8, 2025 03:07
netplan yaml for configuring bridge and tap0
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: no
dhcp6: no
tap0:
optional: true
bridges:
@technoscavenger
technoscavenger / tap0.service
Created May 8, 2025 03:00
systemd unit for creating tap0
[Unit]
Description=Create TAP interface tap0
Before=network-pre.target
Wants=network-pre.target
DefaultDependencies=no
[Service]
Type=oneshot
ExecStart=/sbin/ip tuntap add dev tap0 mode tap user u1
ExecStartPost=/sbin/ip link set tap0 up
@technoscavenger
technoscavenger / .config
Created April 30, 2025 01:10
.config for u-boot
#
# Automatically generated file; DO NOT EDIT.
# U-Boot 2025.04 Configuration
#
#
# Compiler: arm-linux-gnueabihf-gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
#
CONFIG_CREATE_ARCH_SYMLINK=y
CONFIG_HAVE_SETJMP=y
# local/snippets/post_start.custom
# Commands executed from post_startup.sh. Executed at the end of system startup whether slm is in use
# or not
#
# To allow resource managers to be run properly with and without security policies, command lines
# should be written in one of the following forms:
#
# START(resmgr_t) resmgr DROPROOT(resmgr_uid)
# STARTU(resmgr_t, resmgr_uid) resmgr
# Where resmgr_t is the security type name (arbitrary but usually the name of the resmgr with _t appended),
# local/snippets/ifs_files.custom
# Placeholder for local list of files to add to ifs
[+script] .script = {
procmgr_symlink /system/xbin/login /bin/login
}
# local/snippets/system_files.custom
# Placeholder for local list of files to add to system partition
lib/libpci.so.2.3=lib/libpci.so.2.3
lib/libpci.so.3.0=lib/libpci.so.3.0
xbin/inetd=usr/sbin/inetd
xbin/telnetd=usr/sbin/telnetd
xbin/ftpd=usr/sbin/ftpd
etc/inetd.conf={
telnet stream tcp nowait root /system/xbin/telnetd in.telnetd
ftp stream tcp nowait root /system/xbin/ftpd in.ftpd -c /system/etc
@technoscavenger
technoscavenger / GetVNCClientDimension.ps1
Last active November 27, 2025 21:09
Get geometry for VNC session
Add-Type -AssemblyName System.Windows.Forms;
$wa = [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea
$titleBarHeight = [System.Windows.Forms.SystemInformation]::CaptionHeight
#$offset = 16 #VNC
$offset = 0 #RPD
$w = $wa.Height - $titleBarHeight - $offset
$h = $wa.Width - $offset
Write-Host "$($h)x$($w)"