Skip to content

Instantly share code, notes, and snippets.

View rocky1138's full-sized avatar

John Rockefeller rocky1138

View GitHub Profile
@rocky1138
rocky1138 / snap
Created November 16, 2018 04:20
Downtown Guelph Webcam Bash Script
#!/bin/bash
# sudo crontab -e
# 0,30 * * * * /root/snap
# https://johnrockefeller.net/guelph-webcam
DATETIME=$(date +%Y%m%d_%H%M%S).jpg
uvcdynctrl -d /dev/video1 -s 'Focus, Auto' 0
uvcdynctrl -d /dev/video1 -s 'Focus (absolute)' 0
uvcdynctrl --device=/dev/video1 -s 'LED1 Mode' 0
fswebcam --device=/dev/video1 -r 1920x1080 --jpeg 90 -D 2 -F 1 -p YUYV -S 75 --no-shadow --no-underlay --line-colour=#FF000000 --banner-colour=#FF000000 --set sharpness=65% --set autofocus=false --set saturation=60% --set white_balance_temperature_auto=true /home/rocky1138/Sync/My\ Pictures/Guelph/Webcam/$DATETIME
scp /home/rocky1138/Sync/My\ Pictures/Guelph/Webcam/$DATETIME kwat.chat:~/sites/johnrockefeller.net/guelph-webcam/downtown-guelph.jpg
@rocky1138
rocky1138 / redshift.sh
Created September 27, 2018 05:32
Daemonize redshift (Guelph)
#!/bin/bash
screen -dmS "redshift"
screen -S "redshift" -p 0 -X stuff "redshift -l 43.5448:-80.2482 -b 1.0:0.5$(printf \\r)"
@rocky1138
rocky1138 / SnapDialogueUIToNPC.cs
Last active July 2, 2018 04:09
Snap Dialogue UI to NPC Game Object (Dialogue System for Unity)
/*
MIT License
Copyright (c) 2018 John Rockefeller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@rocky1138
rocky1138 / .vimrc
Last active June 30, 2018 02:32
.vimrc
set t_Co=256
syntax enable
set completeopt=longest,menuone
set encoding=utf8
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set smarttab
set smartindent
@rocky1138
rocky1138 / dev-tmux.sh
Last active March 27, 2018 17:04
Start tmux with panes already set up
#!/bin/bash
# Thanks to https://stackoverflow.com/a/5752901.
tmux new-session -d
tmux split-window -h
tmux resize-pane -R 28
tmux split-window -v 'cmus'
tmux resize-pane -D 12
tmux -2 attach-session -d
@rocky1138
rocky1138 / gist:709b2bb4d6ff95a8025a649cfdcd51f6
Created August 27, 2017 19:43
256 colour support in screen over ssh in Ubuntu
~/.bashrc
force_color_prompt=yes
export TERM=xterm-256color
~/.bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
@rocky1138
rocky1138 / RadioOnOffSwitch.cs
Created May 14, 2017 03:10
The easy-peasy method of creating a light-switch type button using VRTK
/**
* Copyright 2017 John Rockefeller.
*
* License: "Simplified" BSD, two clause.
*
* Redistribution and use in source and binary forms, with
* or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above
/**
* Transcribed from Persistence - Saving and Loading Data Tutorial video.
* Original code by Mike Geig.
* Transcribed by rocky1138.
* No idea on what the license is. I think it's fairly safe to assume public domain
* since it's part of a tutorial video.
* https://unity3d.com/learn/tutorials/topics/scripting/persistence-saving-and-loading-data
*/
using UnityEngine;
using System.Collections;
@rocky1138
rocky1138 / gist:8172926
Last active January 1, 2016 16:49
CSGO autoexec.cfg
// remove gun bobbing
cl_bob_lower_amt "5" //min value
cl_bobamt_lat "0.1" //min value
cl_bobamt_vert "0.1" //min value
cl_bobcycle "2" //max value = less cycles
// misc
hud_scaling "0.70"
sensitivity "1.25"
net_graph "1"
@rocky1138
rocky1138 / gist:24d673c691d301bada73
Last active August 29, 2015 14:12
Extract Article and Taxonomy URLs from Drupal 7 MySQL Database
Moved to https://github.com/rocky1138/DrupalToWordpress.