Skip to content

Instantly share code, notes, and snippets.

function fitConsole(){
var a = document.getElementById("vmrcObject");
var b = window.getComputedStyle(a);
var c = parseInt(b.height);
var d = parseInt(b.width);
//some XSS
vmrc.setScreenSize(d,c);
}
@gartnera
gartnera / gist:8975a1be6f002233c024
Created September 2, 2014 14:37
VMware force html5 console (paste into console)
function openPopoutConsole(vmName, vmId, vAppName, vmDevicesAvailable, buttonLabels, miscLabels, confirmationLabels, isVmrc) {
if (windowHandles[vmId] != null && !windowHandles[vmId].closed) {
windowHandles[vmId].focus();
return;
}
var defaultConsoleWidth = 720;
var defaultConsoleHeight = 400;
var cssWidth = 0;
@gartnera
gartnera / Fit to guest changes to fit guest
Last active August 29, 2015 14:06
VMware vCloud 5.5 Scripts
// ==UserScript==
// @name vmware console hacks
// @namespace http://agartner.com
// @version 0.1
// @description Changes fit to guest to fit guest
// @match https://vcloud.ialab.us/cloud/VMRCConsole.html
// @copyright 2014, Alex Gartner
// @grant none
// ==/UserScript==
window.addEventListener('load', main, false);
@gartnera
gartnera / starrow.c
Last active October 21, 2015 20:19
Assignment 5 Examples
int i;
for (i = 0; i < 10; ++i)
{
printf(" *");
}
printf("\n");
@gartnera
gartnera / owa_keepalive.user.js
Created April 18, 2015 19:36
OWA Keep Alive
// ==UserScript==
// @name OWA Keep Alive
// @namespace agartner.com
// @include https://webmail.dsu.edu/owa/
// @version 1
// @grant none
// ==/UserScript==
setInterval(function(){onUserActivity()}, 600000)
var irc = require('irc');
var reply = [
"I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.",
"Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called \"Linux\", and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.",
"There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of
@gartnera
gartnera / root_ssh_ban.sh
Last active January 6, 2016 17:35
Ban people trying to login to your server as root
#!/bin/bash
#run to setup
#iptables -N root-ban
#iptables -A root-ban -j RETURN
#iptables -A INPUT -j root-ban
#uncomment if cron
#export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
@gartnera
gartnera / dabblet.css
Last active January 30, 2016 00:23 — forked from anonymous/dabblet.css
Static pie charts
/**
* Static pie charts
*/
span {
z-index:100;
position:fixed;
width: 115px;
left: 0;
text-align:center;
@gartnera
gartnera / lexcc.sh
Created January 30, 2016 20:32
lex tools
#!/bin/bash
lex "$1"
if [[ -n "$2" ]]; then
gcc lex.yy.c -ll -o "$2"
else
gcc lex.yy.c -ll
fi
rm lex.yy.c
@gartnera
gartnera / provisionHttps.sh
Last active February 3, 2016 16:43
A bash script to generate and sign TLS certs with letsencrypt for nginx on freebsd
#!/usr/bin/env bash
NGINX_ROOT='/usr/local/etc/nginx/'
BASE_CONF_NAME='proxy_template.conf'
CERT_DIR='keys/'
CHALLENGE_DIR='/var/letsenc-challenge/.well-known/acme-challenge/'
ACME_TINY_DIR='/opt/acme-tiny/'
ROUTER_IP='138.247.115.10'
RENEW_SCRIPT_PATH='/opt/acme-tiny/renewCerts.sh'