This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# malloc_wsl_interop_socket synopsis | |
# stdout: absolute path to valid interop socket | |
function malloc_wsl_interop_socket { | |
local INTEROP_PARENT_PID=0 | |
local INTEROP_SOCKET_PID=0 | |
local INTEROP_BAIT_PROCESS='sleep infinity' | |
pushd / >/dev/null | |
(/mnt/c/Windows/system32/wsl.exe ${INTEROP_BAIT_PROCESS[@]} >/dev/null) & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.6 | |
import requests | |
import json | |
import re | |
from datetime import datetime | |
from datetime import timedelta | |
def token(): | |
headers = { | |
'Accept': 'application/json', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SCRIPT_NAME="$(basename "${0}")" | |
FALLOUT4_EXECUTABLE="Fallout4.exe" | |
WINE_REGISTRY_KEY="HKEY_CURRENT_USER\\Software\\Wine" | |
FALLOUT4_APPDEFAULTS_REGISTRY_KEY="HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\${FALLOUT4_EXECUTABLE}" | |
FALLOUT4_INSTALL_REGISTRY_KEY='HKEY_LOCAL_MACHINE\Software\Bethesda Softworks\Fallout4' | |
USER_SHELL_FOLDERS_REGISTRY_KEY='HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
function disable_pa { | |
if [ $(sudo grep ^autospawn /etc/pulse/client.conf | wc -l) -ne 0 ]; then | |
sudo sed 's/^autospawn\ =\ yes/autospawn\ =\ no/g' -i /etc/pulse/client.conf | |
else | |
sudo su - -c "echo 'autospawn = no' >> /etc/pulse/client.conf" | |
fi | |
echo "Disabled Pulseaudio" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function internal_rtfm { | |
echo "Draw squares in bash, with different sides and corners" | |
echo "Usage: $0 x y z" | |
echo " x - size of the square to draw" | |
echo " y - character for sides" | |
echo " z - character for corners" | |
exit | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function fix_qt4_ebuilds { | |
pushd /usr/portage/dev-qt | |
ELEMENT=(core dbus gui script svg) | |
JOB_PID=$$ | |
for((COUNTER=0, ARRAY_SIZE=${#ELEMENT[*]}; COUNTER < ARRAY_SIZE; ++COUNTER)) do | |
CCURRENT_ELEMENT=${ELEMENT[COUNTER]} | |
EBUILD=`ls qt$CURRENT_ELEMENT/qt$CURRENT_ELEMENT-4*.ebuild | tail -n1` | |
if [ "`grep ^IUSE $EBUILD | grep c\+\+0x | wc -l`" -eq "0" ]; then | |
cat $EBUILD | sed 's/^IUSE=\"/IUSE=\"c\+\+0x\ /' > ebuild.$JOB_PID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess, shutil, os, sqlite3, re, sys | |
import utils | |
def validate_email(email, mode=None): | |
# There are a lot of characters permitted in email addresses, but | |
# Dovecot's sqlite driver seems to get confused if there are any | |
# unusual characters in the address. Bah. Also note that since | |
# the mailbox path name is based on the email address, the address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Before running this script | |
RUNLEVELS="235" | |
HAVE_PASS=0 | |
FEEDED_KEY="" | |
ROLE="" | |
JOB_PID=$$ | |
NAN=1 | |
NUMREGEX='^[0-9]+$' | |
DEPS="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Getopt::Std; | |
use HTTP::Request; | |
use LWP::UserAgent; | |
use Net::SSLeay; | |
use IO::Socket::SSL; | |
my $options=(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# Tough skin and sharp criticism ahead | |
use strict; | |
use warnings; | |
# Dependencies | |
use File::Slurp; | |
use Getopt::Std; | |
require RPC::XML; | |
require RPC::XML::Client; |
NewerOlder