Skip to content

Instantly share code, notes, and snippets.

@ggets
ggets / composer.json
Created February 12, 2022 07:41 — forked from mfurlend/composer.json
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": {
@ggets
ggets / WSL2-Net-Fix.ps1
Created November 3, 2021 23:57 — forked from danvy/WSL2-Net-Fix.ps1
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
@ggets
ggets / w32window.py
Created June 2, 2021 08:04 — forked from ousttrue/w32window.py
ctypes SetWindowLongPtr/GetWindowLongPtr sample
#!/usr/bin/env python
# coding: utf-8
import win32con
from ctypes import *
##############################################################################
# Windows types
##############################################################################
def ErrorIfZero(handle):
@ggets
ggets / git_cheat-sheet.md
Created April 28, 2021 08:04 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet
@ggets
ggets / tbw.sh
Created February 14, 2021 15:00
Read TBW script for Samsung 860 Evo (and Pro) drives for Windows and Linux
#!/bin/bash
################################################################################
### TBW for Samsung SSD ###
### -by GGetsov ###
### ------------------------------------------------------------------------ ###
### Requires: Cygwin, bash (with arrays support), bc, smartctl ###
################################################################################
arrtest[0]="1"||(echo "Failure: arrays not supported in this version of bash."&&exit 2)
#var
ver="0.2.4"
@ggets
ggets / tbw.sh
Last active June 22, 2019 13:21
Check/Get TBW Live of a Samsung SSD
#!/bin/bash
################################################################################
### TBW for Samsung SSD ###
### -by GGetsov ###
### ------------------------------------------------------------------------ ###
### Requires: Cygwin, bash (with arrays support), bc, smartctl ###
################################################################################
arrtest[0]="1"||(echo "Failure: arrays not supported in this version of bash."&&exit 2)
#var
ver="0.0.4"
@ggets
ggets / sshmount.sh
Last active June 22, 2019 13:20
SSHFS Mount script for winfsp implementation of sshfs
#!/bin/bash
################################################################################
### SSHFS Mount script for winfsp implementation of sshfs ###
### -by GGetsov ###
### ------------------------------------------------------------------------ ###
### Requires: Cygwin, bash (with arrays support), Powershell, expect ###
### sshfs (WinFSP), jq, procps, grep and find (both preferably GNU) ###
################################################################################
arrtest[0]="1"||(echo "Failure: arrays not supported in this version of bash."&&exit 2)
#var
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