Skip to content

Instantly share code, notes, and snippets.

View tomkinsc's full-sized avatar

Chris Tomkins-Tinch tomkinsc

View GitHub Profile
@jasmas
jasmas / acdisable
Created January 26, 2022 17:29
Enable/Disable Cisco AnyConnect Socket Filter Extension on MacOS
#!/bin/sh
echo Disabling vpnagentd...
sudo launchctl disable system/com.cisco.anyconnect.vpnagentd
echo Tearing down vpnagentd...
sudo launchctl bootout system /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist
echo Deactivating Cisco AnyConnect Socket Filter Extension...
/Applications/Cisco/Cisco\ AnyConnect\ Socket\ Filter.app/Contents/MacOS/Cisco\ AnyConnect\ Socket\ Filter -deactivateExt
@flaviut
flaviut / Setting up Emporia Vue 2 with ESPHome.md
Last active June 6, 2024 06:00
Setting up Emporia Vue 2 with ESPHome
@nitheeshkl
nitheeshkl / gige_gst_v4l.md
Last active May 2, 2024 08:02
Gstreamer pipelines to use GigE cams as webcam for Zoom/Teams/Skype

Using GigE cam as webcam for Zoom/Skype/Teams

TL;DR: Creates a Gstreamer pipeline to read camera frames from a GigE camera, using Aravis library, and publish them as V4l2 camera source, using V4l2loopback, that can be read by video conferencing programs like Zoom/Skype/Teams.

gst-launch-1.0 aravissrc blocksize=5013504 h-binning=1 v-binning=1 ! video/x-bayer,format=rggb,framerate=100/5,width=2448,height=2048 ! bayer2rgb ! video/x-raw,format=RGBx ! videoconvert ! video/x-raw,format=YUY2 !  aspectratiocrop aspect-ratio=16/9 ! videoscale ! video/x-raw,width=1280,height=720 ! queue ! v4l2sink device=/dev/video0

The Basics

@tomkinsc
tomkinsc / msa_fasta_to_popart_nexus.py
Last active March 18, 2021 01:05
Python script to create nexus input for PopART ( http://popart.otago.ac.nz/ ) from a multiple alignment fasta file and metadata file with boolean columns. Requires biopython, and the input fasta should be cleaned of as much noise as possible.
#!/usr/bin/env python
import sys,os,hashlib,csv
from collections import defaultdict, OrderedDict
import argparse
#import shelve
from Bio import SeqIO
from Bio.SeqIO import FastaIO
# requirements: biopython
@Natay
Natay / pavian_report.R
Last active June 19, 2024 15:44
Generate a pavian report given a directory of files
# Load pavion
library(pavian)
# Load the command line arguments
args = commandArgs(trailingOnly=TRUE)
# Directory containing input data files.
INPUT_DIR = args[1]
# Directory to store the final HTML report.
@lcarsos
lcarsos / restore_functionality.sh
Last active June 26, 2024 09:15
Repeatedly kill sentinelone so you can actually use the processor and ram on your mac
#!/usr/bin/env bash
# Usage: sudo ./restore_functionality.sh
#ps aux | grep sentinel | awk -F " +" '{print $2}' | xargs kill
while true; do
launchctl kill SIGKILL system/com.crowdstrike.falcond
launchctl kill SIGKILL system/com.crowdstrike.userdaemon
launchctl kill SIGKILL system/com.sentinelone.sentineld
launchctl kill SIGKILL system/com.sentinelone.sentineld-helper
@elowy01
elowy01 / BCFtools cheat sheet
Last active June 29, 2024 05:24
BCFtools cheat sheet
*bcftools filter
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2)
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz
*printing out info for only 2 samples:
bcftools view -s NA20818,NA20819 filename.vcf.gz
*printing stats only for variants passing the filter:
bcftools view -f PASS filename.vcf.gz
@jhcepas
jhcepas / plot_mutations.py
Last active August 30, 2019 12:05
given a tree and its associated alignment, plot column changes for each internal branch
from collections import defaultdict
from ete3 import PhyloTree, TreeStyle, SeqMotifFace, TextFace, RectFace
alg = """
>Dme_001
MAEIPDETIQQFMALT---HNIAVQYLSEFGDLNEAL--YYASQTDDIKDRREEAH
>Dme_002
MAEIPDATIQQFMALTNVSHNIAVQY--EFGDLNEALNSYYAYQTDDQKDRREEAH
>Cfa_001
MAEIPDATIQ---ALTNVSHNIAVQYLSEFGDLNEALNSYYASQTDDQPDRREEAH
@crmackay
crmackay / illumina-bcl-description.md
Last active May 7, 2021 16:27
description of illumina's bcl file format
@tomkinsc
tomkinsc / ssh_tunnel_cheatsheet.md
Last active January 17, 2017 16:59
SSH tunnel cheatsheat

SSH tunnel cheatsheet

SSH Reverse tunnel

                                            ┌─┐                      
                                            │ │                      
                                            │ │                      
┌─────────────┐        ┌─────────────┐      │ │       ┌─────────────┐
│ local │ │ relay │ │ │ │ remote │