Skip to content

Instantly share code, notes, and snippets.

View semenko's full-sized avatar
Thoroughly Caffeinated

Nick Semenkovich semenko

Thoroughly Caffeinated
View GitHub Profile
@semenko
semenko / generate-xbox-ntfs-offline-update.sh
Created June 12, 2022 01:22
Generate NTFS image for Xbox OSU updater
#!/bin/bash
set -x
# By Nick Semenkovich https://nick.semenkovich.com
#
# Largely derived from:
# https://gist.github.com/kumbasar/49906cb704ce9213c972a3e008c74c0c
# I found myself needing to update an Xbox S via USB (with the Offline System Update OSU1 patch)
# See: https://support.xbox.com/en-US/help/hardware-network/console/system-update-solution/offline-system-update
@semenko
semenko / process_10x_files.sh
Last active October 27, 2021 16:29
Process 10x .mtx matrix, feature, and barcode files into single CSV
#!/bin/bash
# set -x
# Inspired by https://kb.10xgenomics.com/hc/en-us/articles/360023793031-How-can-I-convert-the-feature-barcode-matrix-from-Cell-Ranger-3-to-a-CSV-file-
FILES="GSM*_barcodes.tsv"
for i in $FILES
do
filename="${i%_*}" # Extract prefix before _barcodes.txv
@semenko
semenko / tcpdump.sh
Created May 23, 2017 16:47
tcpdump on span interface
#!/bin/bash
if [ ! $(pidof tcpdump) ]; then
echo "Starting tcpdump"
/usr/sbin/tcpdump -i eth0 -n -W 1000 -G 3600 -z gzip -w /var/www/traffic-logs/%m-%d-%y-%H:00.pcap >/dev/null 2>&1 &
else
echo "already running"
fi
# That 1000 doesn't really work. Maybe gzip bug.
@semenko
semenko / build-samba.sh
Created May 23, 2017 16:46
Build samba from git
#!/bin/bash
export PATH="/usr/lib/ccache:$PATH"
die() { echo "$@" 1>&2 ; exit 1; }
if [ -z $1 ]; then
die "Run with a git tag, e.g.: $0 v4-2-test"
fi
echo "Updating samba4 to tag '$1'"
@semenko
semenko / SetupFoldersForOneDrive.ps1
Last active September 26, 2024 21:54
Powershell Redirect Folders to OneDrive Account & Sync
# Work in progress!
# Derived from http://stackoverflow.com/questions/25709398/set-location-of-special-folders-with-powershell
<#
.SYNOPSIS
Sets a known folder's path using SHSetKnownFolderPath.
.PARAMETER Folder
The known folder whose path to set.
.PARAMETER Path
The path.
@semenko
semenko / Office 365 Security and Compliance
Created January 7, 2017 20:28
Office 365 Powershell for MDM
Here is the list of largely undocumented Office 365 MDM PowerShell commands:
CommandType Name Version Source
----------- ---- ------- ------
Function Add-ComplianceCaseMember 1.0 tmp_00mf4ap5.eg0
Function Add-eDiscoveryCaseAdmin 1.0 tmp_00mf4ap5.eg0
Function Add-RoleGroupMember 1.0 tmp_00mf4ap5.eg0
Function Get-ActivityAlert 1.0 tmp_00mf4ap5.eg0
Function Get-AdminAuditLogConfig 1.0 tmp_00mf4ap5.eg
@semenko
semenko / gist:3d66de1b37beb65fc5ce48ddb893c956
Last active January 7, 2017 16:02
OnHub / Google Wifi diagnostic url notes
Onhub urls:
onhub.here internally resolves to the router (always 192.168.86.1)
http://onhub.here/api/v1/status
http://onhub.here/api/v1/welcome-mat
http://onhub.here/api/v1/connected-devices
http://onhub.here/api/v1/diagnostic-report <-- protobuf with gzipped chunks
### Keybase proof
I hereby claim:
* I am semenko on github.
* I am semenko (https://keybase.io/semenko) on keybase.
* I have a public key whose fingerprint is FF4D D3EC 3ADD 5006 6246 1007 06F5 B6F6 DBBB 3C45
To claim this, I am signing this object:
@semenko
semenko / git-status-tester.sh
Created August 25, 2015 23:24
git status tester
#!/bin/sh
# Author: Nick Semenkovich <[email protected]>
git remote update >/dev/null 2>&1
gitstatus=`git log master..origin/master`
if [ "$gitstatus" ]
then
if tty -s
@semenko
semenko / annoying-legacy-blast-wrapper.sh
Created August 25, 2015 23:23
BLAST to BLAST+ upgrade annoyer
#!/bin/sh
# Get called script name (e.g. myscript.sh)
SCRIPTNAME=$(basename $0)
if tty -s
then
USER_TTY=`tty`
# Be annoying.
echo "\a@@@ WARNING @@@:\nThe $SCRIPTNAME tool has been discontinued by the NCBI." > $USER_TTY
echo "Please consider converting your scripts to use the new BLAST+ tools.\n" > $USER_TTY
# Hide errors if they pass something incorrect to the tool.