Skip to content

Instantly share code, notes, and snippets.

View axonxorz's full-sized avatar

Brendan Zerr axonxorz

View GitHub Profile
@axonxorz
axonxorz / cb.zsh
Created November 18, 2022 14:57
cb shell function
# A shortcut function that simplifies usage of xclip.
# - Accepts input from either stdin (pipe), or params.
# - If the input is a filename that exists, then it
# uses the contents of that file.
# ------------------------------------------------
cb() {
emulate bash
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
# Check that xclip is installed.
if ! which xclip | grep xclip -q; then
(system-config) root@controller-unconfigured:/opt/python-pam# python
Python 3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
(system-config) root@controller-unconfigured:/opt/python-pam# ls
ChangeLog CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE Makefile MANIFEST.in PKGBUILD pyproject.toml python-pam.sublime-project README.md requirements.txt setup.cfg src tests
(system-config) root@controller-unconfigured:/opt/python-pam# pip install -e ./
Obtaining file:///opt/python-pam
Installing build dependencies ... done
def do_hash(session_id, track_number):
a = 1234554321
b = 305419896
c = 7
d = track_number + session_id[8:]
for e in range(len(d)):
f = ord(d[e:e+1]) & 255
a = a ^ ((a & 63) + c) * f + (a << 8)
b = b + (b << 8 ^ a)
# [CONFIGURATION]
# Ensure WSL2 container is started and SSH is running
wsl sudo /etc/init.d/ssh start
# Ports to be forwarded
$ports = @(22) + @(6543,6544) + @(6800..6810);
# Change $addr to restrict connections to a particular interface IP
$listen_addr = '0.0.0.0';
# These module alos are used by protection code, so that protection
# code needn't import anything
import os
import platform
import sys
import struct
# Because ctypes is new from Python 2.5, so pytransform doesn't work
# before Python 2.5
#
#!/bin/bash
usage() {
echo "Usage: virt-vnc <SERVER> <VM_NAME>"
}
USER=itadmin
SERVER=$1
VMNAME=$2