This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DecimalFormat; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Random; | |
public class RotationCalcs { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FWD_CMD="ssh -f -N -o Compression=no -L $LOCAL_PORT:$REMOTE_HOST:$REMOTE_PORT $FWD_USER@$FWD_HOST" | |
function sshpid { | |
SSH_PID=$(ps aux | grep "$FWD_CMD" | grep -v 'grep' | awk '{print $2}') | |
} | |
function fwdrunning { | |
sshpid | |
if [[ -n $SSH_PID ]];then | |
echo "ssh tunnel is running with PID $SSH_PID" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasklist /FI "IMAGENAME eq vcxsrv.exe" 2>NUL | find /I /N "vcxsrv.exe">NUL | |
if "%ERRORLEVEL%"=="0" echo X server is running | |
if not "%ERRORLEVEL%"=="0" start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -ac -terminate -lesspointer -multiwindow -clipboard -dpi auto | |
chcp utf8 | |
ubuntu run "sh -ic 'if [ -z \"$(pidof dbus-launch)\" ]; then export DISPLAY=127.0.0.1:0.0; dbus-launch --exit-with-x11; fi;'" | |
ubuntu run "DISPLAY=:0 gnome-terminal --working-directory=/home/kevin; sleep 1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.Enumeration; | |
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; | |
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; | |
import org.apache.commons.compress.archivers.zip.ZipFile; | |
public class ZipEntryCopy { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Synology Surveillance Station doesn't let you store recordings on USB storage, which means that you must | |
# use the internal (often mirrored) disks. This is less than ideal. Unfortunately, just symbolically | |
# linking the surveillance store directory to one on USB storage causes surveillance station to fail after | |
# a day or so. This workaround still uses your main storage for recording, but moves older files to USB storage | |
# for archival. The moved files themselves are symbolically linked back to the original storage location. | |
# | |
# Script should be run regularly, either by editing /etc/crontab or through Synology's built in script scheduling. | |
# Be sure to edit the user inputs below, and set up SS to keep recordings for longer than the external archive period. |