Skip to content

Instantly share code, notes, and snippets.

#include "stdafx.h"
#include "ConIo.h"
CConIo::CConIo(LPWSTR child) : isRunning(false)
{
lstrcpy(cmdline, child);
}
void CConIo::threadProc(void)
diff --git a/foo_output_pipe/ConIo.cpp b/foo_output_pipe/ConIo.cpp
index 16602cf..1c4533d 100644
--- a/foo_output_pipe/ConIo.cpp
+++ b/foo_output_pipe/ConIo.cpp
@@ -47,6 +47,7 @@ void CConIo::threadProc(void)
CreateProcess(NULL, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &startup_info, &process_info);
CloseHandle(child_input_read);
+#if 0
if (child_input_write != INVALID_HANDLE_VALUE) {
[root@server01][/mnt]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb libvirt_lvm lvm2 a-- 931.51g 841.51g
/dev/sdc libvirt_lvm lvm2 a-- 931.51g 911.51g
[root@server01][/mnt]# vgs
VG #PV #LV #SN Attr VSize VFree
libvirt_lvm 2 3 0 wz--n- 1.82t 1.71t
[root@server01][/mnt]# lvs -a
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
my_raid1_test libvirt_lvm rwi-a-r--- 20.00g 53.81
[Match]
Name=enp7s0
[Network]
Address=192.168.1.60/24
Gateway=192.168.1.1
DNS=192.168.1.1
Address=2a01:79d:7377:900c::2/64
Gateway=fe80::e23f:49ff:fe99:7000
@saivert
saivert / rdp-ssh.cmd
Last active November 24, 2016 20:55
RDP tunneled over SSH on bash on windows
REM Fire up bash on windows to run our ssh client with port forwarding and a master control socket
REM using /b to background the task
start /b bash.exe -c "ssh -N -L127.0.0.1:3390:10.0.0.8:3389 -M -S ~/.rdp-ssh.socket user@example.com"
REM start RDP client and wait for it to close
start /wait mstsc.exe /v:127.0.0.1:3390
REM send stop signal to our ssh client
bash.exe -c "ssh -O stop -S ~/.rdp-ssh.socket user@example.com"
@saivert
saivert / client.ovpn
Created December 7, 2016 22:46
Connect to OpenVPN server from inside LAN
client
dev tun
proto udp
.
.
.
# !! Need to use LAN address when connecting from inside the LAN using UDP
remote 192.168.1.1 1194
# !! Also need to fix route
<network trustGuestRxFilters='yes'>
<name>direct-macvtap</name>
<uuid>c3e12a99-3047-4486-9861-fa22b6c32e54</uuid>
<forward dev='enp8s0' mode='bridge'>
<interface dev='enp8s0' />
</forward>
</network>
@saivert
saivert / plugin.d
Created May 14, 2018 20:49
deadbeef plugin written in D broken sample
/*
Example misc plugin for the DeaDBeeF audio player
written using the D programming language
Copyright (C) 2017 Nicolai Syvertsen <saivert@gmail.com>
This program 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.
@saivert
saivert / deadbeef.json
Created May 18, 2019 13:36
deadbeef flatpak manifest
{
"app-id": "music.deadbeef.player",
"runtime": "org.gnome.Platform",
"runtime-version": "3.32",
"sdk": "org.gnome.Sdk",
"command": "/app/deadbeef",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--socket=wayland",
@saivert
saivert / launch.json
Created May 26, 2019 10:08
Trying to get vscode to launch flatpak with gdbserver for remote debugging of flatpaks inside vscode.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"app-id": "",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",