Skip to content

Instantly share code, notes, and snippets.

View gwparikh's full-sized avatar

Gordon Parikh gwparikh

  • SRF Consulting Group, Inc.
  • Minneapolis, MN
View GitHub Profile

Investigating Strange Behavior on QNAP NAS Server

TL;DR - It's mining Monero (XMR), hidden under the guise of the McAfee app. Remove it (who wants McAfee anyways?).

Long Version

After a reboot, logging in over SSH and checking for active screen sessions revealed this:

[~] # screen -ls

Manual Nexus Update With TWRP, SuperSU, and ElementalX

  • (hopefully) instructions for taking OTA updates when TWRP recovery is installed

  • Will update, reflash TWRP, regain root, and (optionally) reinstall custom kernel

    1. Download these things:

    • latest factory image (what you're updating to)
    • latest TWRP
    • latest SuperSU
  • (Optional) latest ElementalX
@gwparikh
gwparikh / FlattenDirectory
Created March 26, 2016 06:46
Bash alias to flatten a directory (one level at a time, won't clobber files, gives a bit of help)
alias flatten='if dlist=`ls -d */`; then for d in $dlist; do mv -n $d/* ./; done && rmdir $dlist || echo "Error removing directories. There are probably conflicting files." ; else echo "No directories to flatten"; fi'
@gwparikh
gwparikh / Time-lapse from video files with ffmpeg.sh
Last active February 8, 2018 22:32
Time-lapse from video files with ffmpeg
# Make the images
# (used parallel to speed it up with multiple jobs, but this may not be necessary; haven't tested it)
# fps=1/60 is 1 frame per minute (1/60th frame per second)
parallel 'ffmpeg -i {} -vf fps=1/60 imgs/{.}_%03d.jpg' ::: vidfiles*.avi
# Recombine them
ffmpeg -r <fps> -pattern_type glob -i 'vidimages*.jpg' -c:v libx264 timelapse.avi
@gwparikh
gwparikh / fail_interactive.py
Last active February 8, 2018 22:33
Python - Start interactive shell on exception
#!/usr/bin/python
import sys
import os, traceback
try:
pass # put code that may fail here
except:
print traceback.format_exc() # print the exception
os.environ['PYTHONINSPECT'] = 'Y' # start interactive/inspect mode (like using the -i option)
@gwparikh
gwparikh / On-the-fly video converting and streaming with ffmpeg and netcat.md
Last active May 10, 2021 20:21
Been wanting to figure out how to do this for a while, ended up being pretty easy once I spent a few years in the shell with ffmpeg...

On-the-fly Video Converting and End-to-End Streaming With FFMPEG and netcat

Transcoding & Sending:

ssh -R <port>:localhost:<port> <host_with_content> ffmpeg -i <input_file> -c:v libx264 -q 1 -c:a libmp3lame -f avi pipe:1 | nc localhost <port>

Playing: