Skip to content

Instantly share code, notes, and snippets.

View colhountech's full-sized avatar
💭
Building stuff. Follow on twitter for updates

Micheal Colhoun colhountech

💭
Building stuff. Follow on twitter for updates
View GitHub Profile
@colhountech
colhountech / add_ssh_client_feature.ps1
Created October 26, 2023 22:09
Add SSH Client feature to Windows (Powershell Script)
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
@colhountech
colhountech / compress_video.sh
Created June 8, 2022 11:04
Compress Video and Remove Silence at Start and throughout
#!/bin/bash
: << 'COPYRIGHT_NOTICE'
MIT License
Copyright (c) 2022 ColhounTech Limited
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@colhountech
colhountech / AcrylicUI_FieldsForBorderlessWindows.cs
Created May 20, 2022 09:35
Acrylic UI - Fields For Borderless Windows
#region Fields for Borderless Windows
private int borderSize = 0;
private bool _flatBorder = true;
private Size _restoreSize;
#endregion
@colhountech
colhountech / AcrylicUI_FixFormWindowState.cs
Last active May 20, 2022 09:39
AcrylicUI Fix FormWindowState changes
#region fix FormWindowState changes
private void SetupUIDefaults()
{
// Don't change this: NoBorder with Resize Hack
var designSize = this.ClientSize;
this.FormBorderStyle = FormBorderStyle.Sizable;
this.Size = designSize;
this._restoreSize = designSize; // save for restore
@colhountech
colhountech / AcrylicUI_MinMaxRestore.cs
Last active May 20, 2022 09:39
AcrylicUI Min/Max/Restore for catching resize events to adjust form
#region Min/Max/Restore for catching resize events to adjust form
private void BtnMin_Click(object sender, EventArgs e)
{
_restoreSize = ClientSize;
this.WindowState = FormWindowState.Minimized;
AdjustForm();
}
@colhountech
colhountech / AcrylicUI_NoBorderHack.cs
Last active May 21, 2022 22:19
AcrylicUI Window No Border Hack
#region Window, No Border Hacks
protected override void WndProc(ref Message message)
{
// Resize Window
if (message.Msg == WinUserH.WM_NCHITTEST)
{
@colhountech
colhountech / AcrylicUI_RoundCorners.cs
Created May 19, 2022 11:53
AcrylicUI Gist - Round Corners
#region Round Corners
private void RoundCorners(bool _isWindows11)
{
if (_isWindows11)
{
var attribute = DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE;
var preference = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND;
DwmSetWindowAttribute(this.Handle, attribute, ref preference, sizeof(uint));
@colhountech
colhountech / defluff-ubuntu-vm.sh
Created February 27, 2021 16:33
Turn off fluff on ubuntu images
sudo touch /etc/cloud/cloud-init.disabled
sudo systemctl disable lxd
sudo systemctl stop cloud-init
sudo systemctl disable cloud-init
sudo apt remove lvm2 -y --purge
sudo apt remove policykit-1 -y --purge
@colhountech
colhountech / get_short_conf.sh
Last active February 27, 2021 16:19
strip # and blank lines from conf files
grep -v "^#" $1 | grep -v "^\s*$"
# /etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
# reboot
sudo reboot
# sudo vi /etc/default/grub
# add