Skip to content

Instantly share code, notes, and snippets.

View hectormethod's full-sized avatar

Scott K. hectormethod

View GitHub Profile
@hectormethod
hectormethod / 0_reuse_code.js
Last active September 11, 2017 21:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hectormethod
hectormethod / spotifyHijack.scpt
Last active December 19, 2019 15:57 — forked from himenlinamarbric/spotifyHijack.scpt
Audio Hijack Pro & Spotify -- No Polling #audio #mac #applescript
-- Usage
-- 1. Edit the settings (see below). This step is NECESSARY the first time you use it!
-- 2. Run this script (this should open Audio Hijack Pro and Spotify)
--
-- NOTE: the script assumes that each track is played entirely. You CANNOT skip tracks in Spotify.
-- If you do so the script will get out of sync and the resulting files contain partial or multiple songs.
-- You can abort a recordig session by stopping this script and ending (manually) the recording
-- in Audio Hijack Pro.
--
-- You need to have "atomicparsley" installed on your system. You can install the application with
@hectormethod
hectormethod / Asset.sh
Created September 12, 2017 13:38
macos sierra does not automatically mount network drives
`sudo defaults write /Library/Preferences/com.apple.NetworkAuthorization AllowUnknownServers -bool YES`
To disable this command and return to the previous more secure behaviour, enter this command in Terminal:
`sudo defaults delete write /Library/Preferences/com.apple.NetworkAuthorization AllowUnknownServers`
@hectormethod
hectormethod / Code.sh
Last active September 12, 2017 15:14
[Mount Window SMB CIFS share in Linux server] #bash
mount -t cifs -o username=admin,password='<pass>',domain=WORKGROUP //192.168.1.10/Multimedia /work
@hectormethod
hectormethod / Asset.txt
Created September 12, 2017 13:38
Unix FIND and DELETE files or directories with spaces matching pattern
find / -type d -name .wdmc -print0 | xargs -0 rm -rf
find . -type f -name 'College Football*' -delete
@hectormethod
hectormethod / Asset.txt
Created September 12, 2017 13:38
start and stop hdhomerun record silicon dust
However, is use the Synology boxes a lot at work and expect the Manual install to be easy. The following should work.
1. Create a Share Folder with the name HDHomeRun in the Synology Control Panel
2. Give permissions so that you can see it on you Mac or Windows Desktop (which are you using?)
3. From you desktop copy the download NAS/Linux Binary to the HDHomeRun Folder
4. Create a TEXT File with the name hdhomerun.conf if you want to change the location of the recording folder but you can leave it the default of the HDHomeRun Share Folder
5. Enable SSH in Synology Control Panel Terminal Settings
6. ssh root@your_synology_ipaddress_or_dns (use Terminal on Mac or install Putty in Windows)
7. cd until you are in the HDHomeRun Folder on the NAS
@hectormethod
hectormethod / Asset.scpt
Created September 12, 2017 13:38
Spotify to AudioHijack
property update_delay : 0.1 tell application "AppleScript Utility" activate
-- Create a new session "Spotify" if it doesn't already exist try set spotify_session to first «class Sess» whose name is "Spotify" if «class pOnf» of spotify_session is not "%tag_artist - %tag_title" then display dialog "The existing profile for \"Spotify\" does not utilize %tag_artist and %tag_title in the output name format option. Please add this if you want your files to be named automatically or delete/rename your existing \"Spotify\" session." end if on error number -1719 tell application "Finder" set spotify_path to POSIX path of (application file id "spty" as alias) end tell set spotify_session to make new «class ASes» at end of every «class Sess» set «class pPth» of spotify_session to spotify_path set «class pFld» of spotify_session to "~/Desktop" set «class pOnf» of spotify_session to "%tag_artist - %tag_title" set «class pRec» of spotify_session to {«class pEnc»:«constant AEncMP3 », «class
@hectormethod
hectormethod / Asset.txt
Created September 12, 2017 13:38
FFMpeg demux AVI to MP4 lossless
ffmpeg -i input.avi -vcodec copy -acodec copy output.mp4
@hectormethod
hectormethod / Asset.txt
Created September 12, 2017 13:38
adding constraints syntax
ALTER TABLE bookof
ADD CONSTRAINT price_less_5000 CHECK (purchaseprice < '5000');
@hectormethod
hectormethod / Asset.txt
Created September 12, 2017 13:38
Solver.java working 3:58 PM 05-Dec-2013
import java.util.ArrayList;
public class Solver {
private static boolean VERBOSE=true;
private static boolean SOLUTION_FOUND=false;
public Solver(){
}