Skip to content

Instantly share code, notes, and snippets.

@cstrahan
cstrahan / SolarInfo.cs
Created January 6, 2011 05:06
A sunrise/sunset calculator.
using System;
using System.Diagnostics;
namespace SunriseCalculator
{
public class SolarInfo
{
public double SolarDeclination { get; private set; }
public TimeSpan EquationOfTime { get; private set; }
public DateTime Sunrise { get; private set; }
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 25, 2024 10:55
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@breunigs
breunigs / ingress_intel_chat_improvements.user.js
Last active June 30, 2017 21:27
Small improvements to the Ingress Chat at ingress.com/intel. 1. Better distinction between public/faction chat. Prevents accidentally posting to public. 2. Switch to faction chat by default. 3. Ability to hide automated messages (will consume a LOT of CPU though, so beware). 4. Scrolling up in chat issmoother (less “Loading…”) 5. Bits and pieces.
// ==UserScript==
// @name ingress.com/intel chat improvements
// @description Small improvements to the Ingress Chat at ingress.com/intel. 1. Better distinction between public/faction chat. Prevents accidentally posting to public. 2. Switch to faction chat by default. 3. Ability to hide automated messages (will consume a LOT of CPU though, so beware). 4. Scrolling up in chat issmoother (less “Loading…”) 5. Bits and pieces.
// @namespace https://gist.github.com/4415985
// @updateURL https://gist.github.com/raw/4415985/ingress_intel_chat_improvements.user.js
// @downloadURL https://gist.github.com/raw/4415985/ingress_intel_chat_improvements.user.js
// @include http://www.ingress.com/intel*
// @version 8
// ==/UserScript==
@breunigs
breunigs / ingress-classic-gmaps-laf.user.js
Last active December 10, 2015 13:09
Restore Google Maps Classic For Ingress Intel
// ==UserScript==
// @id www.ingress.com-f4dbd255-58ee-4873-988a-b2265a876000@scriptish
// @name Restore Google Maps Classic For Ingress Intel
// @version 3
// @namespace https://gist.github.com/4439073
// @updateURL https://gist.github.com/raw/4439073/ingress-classic-gmaps-laf.user.js
// @downloadURL https://gist.github.com/raw/4439073/ingress-classic-gmaps-laf.user.js
// @description Restores the classical Google Maps style to the Ingress intel map
// @include http://www.ingress.com/intel*
// @run-at document-end
// ==UserScript==
// @name Ingress Player Locations
// @description Shows player locations on the Ingress Intel Map
// @version 1.2
// @match http://www.ingress.com/intel
// @run-at document-start
// ==/UserScript==
function override() {
// ==UserScript==
// @name Ingress Intel: Notify UI
// @namespace https://arantius.com/misc/greasemonkey/
// @description Annotate the Ingress Intel Dashboard with links to control the Ingress Notify app.
// @match http://www.ingress.com/intel*
// @version 1
// @grant none
// ==/UserScript==
//const NOTIFY_SERVER = 'http://localhost:8080/'
Rem run as administrator
@echo on & @setlocal enableextensions
@echo =========================
@echo Turn off the time service
net stop w32time
@echo ======================================================================
@echo Set the SNTP (Simple Network Time Protocol) source for the time server
w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"
@echo =============================================
@echo ... and then turn on the time service back on
@justincjahn
justincjahn / README.md
Last active January 16, 2024 20:15
Minecraft server(s) using systemd and screen.

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances

sudo su --shell /bin/bash minecraft

@alber70g
alber70g / README.md
Last active November 3, 2023 19:33 — forked from ikus060/smx8fancontrol
Python script to edit the X8DTL-iF Registry to control fan speed.

smx8fancontrol on unraid

To change the fan speeds on a SuperMicro X8 board (I have X8DTL-iF) there's a tool smx8fancontrol

Now there's a few deps that are needed and it's a pain to install them on UnRaid. So far this has been my script to get it to run:

# https://www.ikus-soft.com/en/blog/2017-10-01-supermicro-x8-controle-ventilateur/
# install smx8fancontrol on unraid
# install nerd-pack and enable `python3` and `pip`