Skip to content

Instantly share code, notes, and snippets.

View Shkarlatov's full-sized avatar

Alexander Shkarlatov Shkarlatov

View GitHub Profile
@Shkarlatov
Shkarlatov / 10-resolv
Last active December 21, 2025 12:23
OpenVPN hotplug script for DNS management
ssh root@192.168.1.1 << 'SCRIPT_EOF'
cat << "EOF" > /etc/hotplug.d/openvpn/10-resolv
# /etc/hotplug.d/openvpn/10-resolv
# OpenVPN hotplug script for DNS management
LOG() {
logger -t openvpn-hotplug "$*"
}
CHANGE_DNS() {
@Shkarlatov
Shkarlatov / WinUnattend.ps1
Created July 13, 2022 14:01
Answer files (or Unattend files) can be used to modify Windows settings in your images during Setup.
@'
<?xml version="1.0" encoding="utf-8"?>
<unattend
xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
</component>
@Shkarlatov
Shkarlatov / get_cert.sh
Last active March 22, 2024 09:34
Openssl: Create Self-Sign cert with altName IP
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "Usage: $0 HOSTNAME IP (optional)"
exit 0
fi
HOST=$1
IP=$2
using SQLite;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
@Shkarlatov
Shkarlatov / main.cpp
Created December 28, 2020 17:07
C++ Integral
#include <iostream>
#include <vector>
#include <fstream>
#include <cmath>
#include <clocale>
using namespace std;
double solve_rect_l(double (*func)(double g), double x, double h)