Skip to content

Instantly share code, notes, and snippets.

@ellisgeek
ellisgeek / Elevate.ps1
Last active October 7, 2024 00:54
Automatically relaunch Powershell script as Administrator
#region Elevate
function Elevate {
<#
.SYNOPSIS
Automatically (re)launch Powershell script as Administrator including parameters
.PARAMETER ScriptPath
Path to the script that should be launched. Defaults to the current script
.PARAMETER Parameters
A Hashtable of parameters that should be passed to the elevated script, where the "key" is the
parameter name and the "value" is the parameter value
@ellisgeek
ellisgeek / Import-Excel.ps1
Last active September 7, 2023 13:19
Import Excel file into powershell in a manner compatible with Import-Csv
function Import-Excel {
<#
.SYNOPSIS
Creates table-like custom objects from the items in a Excel file.
Requires Excel be installed!
.DESCRIPTION
The Import-Excel cmdlet creates table-like custom objects from the items in Excel
Worksheets.
Each column in the Excel Worksheet becomes a property of the custom object and the items in
rows become the property values. Import-Excel works on any file supported by Excel.
@ellisgeek
ellisgeek / btsync.sh
Last active August 8, 2022 20:57 — forked from mendelgusmao/btsync
Proper init.d script for btsync. Comes with complete install instructions!
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: daemonized version of btsync.
@ellisgeek
ellisgeek / gist:1006469
Created June 3, 2011 14:55
eggdrop config
#!/usr/bin/eggdrop
# ^- This should contain a fully qualified path to your Eggdrop executable.
#
# $Id: eggdrop.conf,v 1.51 2008-02-16 20:15:30 guppy Exp $
#
# This is a sample Eggdrop configuration file which includes all possible
# settings that can be used to configure your bot.
#
# The pound signs (#) that you see at the beginning of some lines mean that
# the remainder of that line is a comment, or just for your information. By
@ellisgeek
ellisgeek / ampache.cfg.php
Created October 1, 2011 20:49
Ampache configuration.
;#<?php exit(); ?>##
;###################
; General Config #
;###################
; This value is used to detect quickly
; if this config file is up to date
; this is compared against a value hard-coded
; into the init script
config_version = 10
@ellisgeek
ellisgeek / conn.go
Created October 18, 2012 15:35
Go WebSocket Example
package main
import (
"code.google.com/p/go.net/websocket"
)
type connection struct {
// The websocket connection.
ws *websocket.Conn
@ellisgeek
ellisgeek / CompileAvatarWindow.cs
Created April 15, 2020 03:56
Custom Avatar Exporter fix for 5.0.0 beta 7
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using CustomAvatar;
public class CompileAvatarWindow : EditorWindow
{
@ellisgeek
ellisgeek / PKGBUILD
Last active May 20, 2019 18:22
wpgtk.desktop
# Maintainer: Fernando Vasquez <fmorataya.04@gmail.com>
_gitname=wpgtk
pkgname="${_gitname}-git"
_gitbranch=master
_gitauthor=deviantfero # deviantfero
pkgver=r751.9145e4f
pkgrel=1
pkgdesc="A gui wallpaper chooser that changes your Openbox theme, GTK theme and Tint2 theme"
url="https://github.com/${_gitauthor}/${_gitname}"
@ellisgeek
ellisgeek / koopabot.py
Created March 8, 2019 03:59
basic bot for people to guess koopa freerunning times.
import logging
import irc.bot
import requests
import toml
import re
from copy import deepcopy
from time import time, strftime, localtime
class TwitchBot(irc.bot.SingleServerIRCBot):
@ellisgeek
ellisgeek / getpcinfo.ps1
Last active November 9, 2018 02:58
YASIS - Yet Another System Info Script
# YASIC - Yet Another System Info Script
# Gets various information about the computer that it's run on
# Returned information:
# * Hostname
# * Manufacturer
# * Model
# * Serial Number
# * Asset Tag
# * Processor
# * Memory