- A "local" variable, that will be local to the function
var=foo
value="b a r"
declare "${var}=${value}"
#!/usr/bin/env bash | |
#****f* git/submodule_diff | |
# NAME | |
# git_submodule_diff - show commit diff between expected and current submodule | |
# DESCRIPTION | |
# When changing version of a superproject, submodules will often show up as | |
# being different. Often the right answer is to run "git submodule update". | |
# However, sometimes this is not the right answer. It is tedious to switch to | |
# a submodule, look through the logs for the SHAs in question, and understand |
#!/usr/bin/env bash | |
set -eu | |
TMP_DIR="$(mktemp -d)" | |
python3 <(curl -L https://bootstrap.pypa.io/get-pip.py) --no-cache-dir -I --root "${TMP_DIR}" virtualenv | |
sudo env PYTHONPATH="$(cd "${TMP_DIR}"/usr/local/lib/python*/*-packages/; pwd)" "${TMP_DIR}/usr/local/bin/virtualenv" "/usr/local/pipenv/" | |
sudo /usr/local/pipenv/bin/pip install --no-cache-dir pipenv | |
sudo ln -s /usr/local/pipenv/bin/pipenv /usr/local/bin |
#!/usr/bin/env python | |
import os | |
import sys | |
from subprocess import Popen, PIPE | |
from socket import * | |
import atexit | |
from select import select | |
from logging import getLogger, basicConfig |
#include <unistd.h> | |
#include <stdio.h> | |
#include <time.h> | |
// This should be easy to edit in a hex editor | |
char exe[256]="/bin/ls\0HEXEDIT STRING HERE"; | |
int main(int argc, char* argv[]) | |
{ | |
FILE *fid = fopen("/tmp/rnuril_log.txt", "a"); |
While creating a git mirror is as simple as git clone --mirror
, unfortunately this git command does not support git submodules (difficult) or lfs (easier). These scripts help in creating a mirror of a project with submodule and/or git lfs.
General user case:
git_mirror https://github.com/visionsystemsinc/vsi_common.git master
, recursively create mirrors of all submodule currently in the master branch.vsi_common_prep/transfer_{date}.tgz
to your destination# Usage: | |
# Move your virtualenv, then | |
# {virtual env dir}\Scripts\python.exe relocate.py | |
# TODO: Merge with Linux script | |
# TODO: Detect and hangle GUI exes | |
import sys | |
import os | |
import glob | |
import re |
Cygwin comes with an X Server that can be useful with tools other than Cygwin itself. With a few modifications, we can add cygwin's X Server support to other shell implementations including cygwin, mingw64 (such as git for windows), msys2, WSL1, WSL2, and others.
With a few minor modifications, we can save the DISPLAY
variable to files accessible by any shell. Once the DISPLAY
value is accessible, an rc file can load it and it will automatically be used.
Optionally, we can even add a "one click" link to the start menu to start the xserver
#!/usr/bin/env bash | |
# Usage: bash <(curl -L https://git.io/Jfr1J) | |
# or: bash <(wget -O - https://git.io/Jfr1J) | |
# or: bash <(perl -MLWP::Simple -e "getprint 'https://git.io/Jfr1J'") | |
# or: bash <(python -c $'try:\n import urllib2 as u\nexcept:\n import urllib.request as u\nimport os; os.write(1,u.urlopen("https://git.io/Jfr1J").read())') | |
function gotty_main() | |
{ | |
: ${VERSION=2.0.0-alpha.3} |
apk add --no-cache readline