Skip to content

Instantly share code, notes, and snippets.

# Invoke MSYS bash directly without msys2_shell.cmd
function mbash {
param(
[Parameter(ValueFromRemainingArguments=$true)]
[string[]]$RemainingArgs
)
$msysArgs = @(
'MSYSTEM=MSYS' , 'MSYS2_PATH_TYPE=' ,
'MSYSCON=' , 'MSYS=winsymlinks:nativestrict',
'LOGINSHELL=bash', '/usr/bin/bash' ,
# Update-MSYS2.ps1
<#
.SYNOPSIS
Updates MSYS2 from a powershell terminal.
.DESCRIPTION
Updates an MSYS2 installation from a powershell terminal via pacman according to MSYS2's installation and update guidelines.
.PARAMETER Path
The full path to MSYS2 installation root (optional).
.NOTES
No parameters are necessary unless the installation is not in one of the common directories.
<#
.Synopsis
Enumerates the parameters of one or more commands.
.Description
Lists all the parameters of a command, by ParameterSet, including their aliases, type, etc.
By default, formats the output to tables grouped by command and parameter set.
.Parameter CommandName
The name of the command to get parameters for.
.Parameter ParameterName
Wilcard-enabled filter for parameter names.
@Trucido
Trucido / Invoke-WmiMonitorBrightness.ps1
Last active March 16, 2019 07:30
Stupid wmi backlight control script
<#
Invoke-WmiMonitorBrightness.ps1 - Backlight control for screen brightness (Note: Does not work with ALS enabled)
#>
function Invoke-WmiMonitorBrightness() {
Set-StrictMode -Version Latest
[scriptblock] $GetMonitorBrightness = {
(Get-Ciminstance -Namespace ROOT/wmi -ClassName WmiMonitorBrightness).CurrentBrightness
}
@Trucido
Trucido / title.zsh
Last active December 14, 2018 23:30
########################################
# __vte_osc7() vte support
########################################
if [[ ${VTE_VERSION:-0} -ge 3405
&& -z ${precmd_functions[(r)__vte_osc7]}
&& ( -o interactive || $- == *i* )
&& $TERM == (xterm*|[Vv][Tt][Ee]*) ]]
then
__vte_urlencode() (
emulate -L zsh
@Trucido
Trucido / Pscx.Vhd.psm1
Created November 4, 2018 03:31
Description for Pscx.Vhd.psm1
<#
#>
function ScriptDiskPart($script)
{
$file = [io.path]::GetTempFileName()
try
{
Set-Content $file $script -Encoding utf8
& diskpart /s $file > $null
fish_path() {
setopt localoptions rcquotes nullglob
local result part; local -a tree expn; local -i i
(
tree=(${(s:/:)${1-${PWD/#$HOME/\~}}})
if [[ $tree[1] == \~* ]] {
cd -q ${~tree[1]}
result=$tree[1]; shift tree
} else { cd -q / }
for dir in $tree; {
#! /usr/bin/perl -w
#
# Copyright (c) 2000-2014 SUSE Linux AG, Nuernberg, Germany.
# All rights reserved.
########################################################################
# create a man-page with:
#
# pod2man --section 1 --center=" " fonts-config | gzip -9 -c > fonts-config.1.gz
# cp fonts-config.1.gz /usr/share/man/man1/fonts-config.1.gz
# /etc/profile.d/freetype2.sh
# FreeType configuration file
# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
# version. FreeType must be compiled with 'FT_CONFIG_OPTION_SUBPIXEL_HINTING',
# otherwise these options are not available for configuration during runtime.
# Currently, three versions are available:
#
# truetype:interpreter-version=35 # Classic mode (default in 2.6)
# truetype:interpreter-version=38 # Infinality mode
diff -uNr freetype-2.9.orig/include/freetype/config/ftoption.h freetype-2.9/include/freetype/config/ftoption.h
--- freetype-2.9.orig/include/freetype/config/ftoption.h 2018-05-02 00:28:16.964364890 -0400
+++ freetype-2.9/include/freetype/config/ftoption.h 2018-05-02 00:29:51.040464644 -0400
@@ -118,7 +118,7 @@
/* rendering technology that produces excellent output without LCD */
/* filtering. */
/* */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING