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 / SetupFoldersForOneDrive.ps1
Last active December 20, 2023 01:07
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 / 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 / dmidecode
Last active October 26, 2021 02:57
Dell XPS 13 2015 model 9343 on Ubuntu 15.04, dmidecode, lsusb, lspci
$ sudo dmidecode
# dmidecode 2.12
# SMBIOS entry point at 0x000f0000
SMBIOS 2.8 present.
<SNIP>
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
@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 / 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 / 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
@semenko
semenko / git-status-tester.sh
Created August 25, 2015 23:24
git status tester
#!/bin/sh
# Author: Nick Semenkovich <semenko@alum.mit.edu>
git remote update >/dev/null 2>&1
gitstatus=`git log master..origin/master`
if [ "$gitstatus" ]
then
if tty -s
### 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: