Skip to content

Instantly share code, notes, and snippets.

@danvy
danvy / WSL2-Net-Fix.ps1
Created September 5, 2020 21:04
Reset your WSL network connection trying to fix WSL2 media disconnected error
# Check these threads before proceeding:
# https://github.com/microsoft/WSL/discussions/5857
# https://github.com/microsoft/WSL/issues/5821
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
$CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine
Exit
}
# Restart the Host Network Service
Restart-Service -Force -Name hns
@mndambuki
mndambuki / officeActivator.bat
Created June 7, 2020 03:41
Activate Microsoft Office 2019
@echo off
title Activate Microsoft Office 2019 !
cls
echo ============================================================================
echo #Project: Activating Microsoft software products
echo ============================================================================
echo.
echo #Supported products:
echo - Microsoft Office Standard 2019
echo - Microsoft Office Professional Plus 2019
@jfcherng
jfcherng / st4-changelog.md
Last active August 18, 2024 07:25
Sublime Text 4 changelog just because it's not on the official website yet.
@mfurlend
mfurlend / composer.json
Last active September 11, 2024 13:35
composer require git repository
{
"name": "my_vendor_name/my_package",
"description": "My Package Description",
"license": "GPL-3.0",
"autoload": {
"classmap": [ // search these directories for classes
"lib/"
]
},
"repositories": {
For a linux kernel below 3.2.0-22.25
yum install kernel-devel automake autoconf gcc glib make ncurses-devel ncurses sysfsutils
yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed xmlto
yum install audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel
yum install newt-devel python-devel zlib-devel
Download sysfsutils-2.1.0.tar.gz
tar xvf sysfsutils-2.1.0.tar.gz
cd sysfsutils-2.1.0
@ousttrue
ousttrue / w32window.py
Created December 27, 2011 18:32
ctypes SetWindowLongPtr/GetWindowLongPtr sample
#!/usr/bin/env python
# coding: utf-8
import win32con
from ctypes import *
##############################################################################
# Windows types
##############################################################################
def ErrorIfZero(handle):