Skip to content

Instantly share code, notes, and snippets.

View griels's full-sized avatar

Ellis Breen griels

View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
# --- Config (override via env vars if you want) ---
ENV_NAME="${ENV_NAME:-mlc-chat-venv}"
PORT="${PORT:-10000}"
PLIST="${HOME}/Library/LaunchAgents/com.user.openwebui.plist"
LOGDIR="${HOME}/Library/Logs"
LABEL="com.user.openwebui"
@griels
griels / osx-vnc-hidden-options.md
Created May 21, 2021 09:35 — forked from jabenninghoff/osx-vnc-hidden-options.md
RemoteManagement "hidden" options

macOS Sierra (and possibly earlier) has some "hidden" screen sharing options:

If you're connecting to VNC using ssh tunneling, you can force macOS to listen only on localhost:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement.plist VNCOnlyLocalConnections -bool yes

In newer versions of macOS, screen sharing will automatically re-lock the screen when you disconnect if it was locked when you first connected. To change this behavior, use:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement RestoreMachineState -bool NO

@griels
griels / chamber.sh
Created October 3, 2020 10:30 — forked from fkorotkov/chamber.sh
Script to run a command in an isolation
#!/usr/bin/env bash
set -e
# list of Nix packages to install
NIX_PACKAGES="darwin.shell_cmds"
XCODE_DERIVED_DATA="$HOME/Library/Developer/Xcode/DerivedData"
WORKING_DIRECTORY=$PWD
@griels
griels / pep484transform.py
Created February 20, 2020 16:37 — forked from davidhalter/pep484transform.py
Jedi generates Pep 484 type annotations.
"""
Transforms a normal Python file to pep484 annotations using Jedi.
Usage:
pep484transform.py <file> [-d]
Options:
-d, --debug Show Jedi's debug output.
"""
from os.path import abspath
# install section, need permissions/virtualenv activated
export PYCBC_DEBUG=TRUE
pip uninstall --yes couchbase
pip install couchbase
#run section
export LCB_LOGLEVEL=5
@griels
griels / pipeline.gdsl
Created April 26, 2019 13:22 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
#!/bin/sh -xe
export CB_ROOT=/opt/couchbase
export CB_ROOT=/home/avsej/code/couchbase/server/install
# Create environment variables for the naming of a directory-structure, within
# which will reside the certificates you create for root, intermediate, and
# node.
#
# Note that in cases where multiple intermediate and/or node certificates are
#!/bin/sh -xe
export PORT=8091
export SCP_USER=vagrant
mkdir_remote()
{
DIR=$1
ssh ${SCP_USER}@${ip} -c 'mkdir -p ${DIR}'
}
cmd_remote()
VER=2.3.1
PYMAJ=3
PYMIN=4
PYVER_SHORT=$PYMAJ$PYMIN
PYVER_LONG=$PYMAJ.$PYMIN
mkdir $PYVER_LONG
cd $PYVER_LONG
wget http://sdkbuilds.sc.couchbase.com/job/pycbc-win/label=all-pythons,pyarch=x64,pyversion=$PYVER_SHORT/ws/dist/couchbase-$VER.win-amd64.zip \
http://sdkbuilds.sc.couchbase.com/job/pycbc-win/label=all-pythons,pyarch=x64,pyversion=$PYVER_SHORT/ws/dist/couchbase-$VER.win-amd64-py$PYVER_LONG.exe \
http://sdkbuilds.sc.couchbase.com/job/pycbc-win/label=all-pythons,pyarch=x86,pyversion=$PYVER_SHORT/ws/dist/couchbase-$VER.win32.zip \
@griels
griels / pycbc-winbuild.py
Last active November 6, 2018 22:29 — forked from mnunberg/pycbc-winbuild.py
Build script for Python couchbase client.
#!/usr/bin/env python
import os
import os.path
import sys
import argparse
import urllib2
import zipfile
import shutil
import glob
import subprocess