This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Usage: var convertedGrid = gridToLatLng("3542A8115A"); | |
Returns: | |
{ sw: [ 35.7125, -81.2625 ], | |
se: [ 35.7125, -81.26666666666667 ], | |
ne: [ 35.71666666666667, -81.26666666666667 ], | |
nw: [ 35.71666666666667, -81.2625 ] } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ping = New-Object System.Net.Networkinformation.Ping | |
1..254 | % { | |
$test = $ping.Send("192.168.1.$_", 50); | |
If($test.status -eq "Success"){ | |
Write-output $test.address.IPAddressToString | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#the busybox on my QNAP TS-420U does not have the watch command so....... | |
while sleep 5; do | |
cls; #clear the screen in the loop incase the string length changes dramatically. | |
TM=`date`; | |
STATUS=`grep finish /proc/mdstat`; | |
echo -ne "$TM$STATUS"\\r; #-ne and \\r(escape the escape char) will make it update in place. http://stackoverflow.com/a/12628482 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var switchport = function(vlan){ | |
this.vlan = vlan; | |
this.attach = function(device){ | |
this.device = device.mac; | |
} | |
} | |
var vlan = function(vlanid, ipaddress){ | |
this.vlanid = vlanid; | |
this.ipaddress = ipaddress || null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "" | |
echo "" | |
read -e -p "Enter new username: " NEW_USER | |
read -e -p "Enter new password: " NEW_PASS | |
echo "----To stop MySQL and restart in safe mode" | |
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.json.JSONArray; | |
import org.json.JSONObject; | |
import java.sql.*; | |
/** | |
* Created by Mitchell on 6/26/2015. | |
*/ | |
public class DatabaseGet { | |
private Connection connection = null; | |
public DatabaseGet(String host, String username, String password, String database){ | |
String HOST = "jdbc:mysql://" + host + "/" + database; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FGS648P Switch>en | |
No password has been assigned yet... | |
FGS648P Switch#sh flash | |
Stack unit 1: | |
Compressed Pri Code size = 2878713, Version 07.2.02mT7e1 (FGS07202m.bin) | |
Compressed Sec Code size = 3183489, Version 07.2.02mT7e1 (FGSL07202m.bin) | |
Compressed Boot-Monitor Image size = 416213, Version 05.0.00T7e5 | |
Code Flash Free Space = 2088960 | |
FGS648P Switch#configure terminal | |
FGS648P Switch(config)#boot system flash secondary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <winsock.h> | |
#include <time.h> | |
#define BUFFER_SIZE 4096 | |
void usage(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//To create a bookmarklet just append javascript: to this code and set as the URL in a new bookmark | |
var el = document.getElementById('board'); | |
el.className += " trello-scroll"; | |
document.addEventListener("wheel", function(e){ | |
var under = document.elementFromPoint(e.clientX, e.clientY); | |
if(hasClass(under, "list-wrapper") || hasClass(under, "trello-scroll")){ | |
if((e.wheelDelta>0?"left":"right") == "right"){ | |
el.scrollLeft += 10; | |
} else { | |
el.scrollLeft -= 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
""" | |
python report.py | sendmail user@domain.com | |
""" | |
import yum, platform | |
import os | |
from collections import namedtuple | |
DiskUsage = namedtuple('DiskUsage', 'total used free') |