Skip to content

Instantly share code, notes, and snippets.

@massyah
massyah / README.md
Created July 25, 2023 20:54 — forked from nwade/README.md
Remove SentinelOne Agent - macOS High Sierra/Mojave

Warning - use at your own risk

Remove SentinelOne agent from Mac

  1. Boot into Recovery Mode by holding Cmd+R during reboot
  2. Open Terminal from top menubar
  3. Run /Applications/Utilities/Disk\ Utility.app/Contents/MacOS/Disk\ Utility to open Disk Utility
  4. If your startup disk is encrypted, use Disk Utility to mount it
  5. In Terminal, run chroot /Volumes/Macintosh\ HD
  6. Execute the deletion commands or script
@massyah
massyah / subprocess_pipe.md
Created October 18, 2021 16:46 — forked from waylan/subprocess_pipe.md
Writing to a python subprocess pipe

Here's a few things I tried to write output to a python subprocess pipe.

from subprocess import Popen, PIPE

p = Popen('less', stdin=PIPE)
for x in xrange(100):
    p.communicate('Line number %d.\n' % x)
@massyah
massyah / convert.py
Created May 3, 2017 20:41
Split a pdf by page, rasterise and downsample each page
import os
from subprocess import call
input_pdf = "plotCGHAnnexe.pdf"
for n_p in range(1, 23):
tgt_file = "plot_%d.pdf" % (n_p)
cropped_file = os.path.splitext(tgt_file)[0] + "-crop" + ".pdf"
downsampled = "lq_" + os.path.splitext(cropped_file)[0] + ".pdf"
midsampled = "hq_" + os.path.splitext(cropped_file)[0] + ".pdf"
call(args=["pdfjam", "plotCGHAnnexe.pdf", str(n_p), "--outfile", tgt_file])
#!/usr/bin/env node
var WebSocketClient = require('websocket').client;
var client = new WebSocketClient();
client.on('connectFailed', function(error) {
console.log('Connect Error: ' + error.toString());
});
client.on('connect', function(connection) {
#!/usr/bin/env node
var WebSocketServer = require('websocket').server;
var http = require('http');
var server = http.createServer(function(request, response) {
console.log((new Date()) + ' Received request for ' + request.url);
response.writeHead(404);
response.end();
});
server.listen(8080, function() {
@massyah
massyah / example_go_annotations.R
Last active December 19, 2015 22:48
R code to annotate genes (specified by their official symbol) with GO terms, as well as example usage.
source("go_annotations.R")
# Get the GO BP/MF/CC terms ids associated with STAT3
gene2gos("STAT3")
# Get the GO BP/MF/CC terms description associated with STAT3
go2terms(gene2gos("STAT3"))
# union of go terms for a list of genes
go2terms(gene2gos(c("STAT3","STAT2")))