Skip to content

Instantly share code, notes, and snippets.

View RC1140's full-sized avatar
🎿
NOP Sledding

Jameel RC1140

🎿
NOP Sledding
View GitHub Profile
@RC1140
RC1140 / gist:d0008fab2ed0d01859ef
Created September 16, 2014 17:09
splitDocument.py
from PyPDF2 import PdfFileWriter, PdfFileReader
input1 = PdfFileReader(open("fileToSplit.pdf", "rb"))
for i in range(input1.numPages):
output = PdfFileWriter()
output.addPage(input1.getPage(i))
outputStream = file('review'+i.__str__()+'.pdf', "wb")
output.write(outputStream)
outputStream.close()
eval(function(p, a, c, k, e, r) {
e = function(c) {
return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
};
if (!''.replace(/^/, String)) {
while (c--) r[e(c)] = k[c] || e(c);
k = [function(e) {
return r[e]
}];
e = function() {
du -s * |awk '{if ($1/1024 > 2000 ) print $1/1024 " " $2 " " $3 " " $4}'
Param($Param1,$Param2)
switch ($Param2)
{
"dev" {$searchPath = "C:\Development\"}
"prod" {$searchPath = "C:\Development\Prod"}
"test" {$searchPath = "C:\Development\Testing"}
default {$searchPath = "C:\Development\"}
}
#!/usr/bin/env python
import socket
import struct
def wake_on_lan(macaddress):
""" Switches on remote computers using WOL. """
# Check macaddress format and try to compensate.
if len(macaddress) == 12:
[Reflection.Assembly]::LoadFile("c:\temp\agsXMPP.dll")
$clientConnection = new-object agsXMPP.XmppClientConnection
$clientConnection.Server = "gmail.com"
$clientConnection.ConnectServer = "talk.google.com"
$clientConnection.Open("EnterYourUserNameHere","EnterYourPasswordHere")
$message = new-object agsXMPP.protocol.client.Message("Who do you want to send the message to ","Errr is this thing on")
$clientConnection.Send($message)
$app = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match "Software Name"
}
$app.Uninstall()
gwmi -query "select * from win32_pingstatus where Address='192.168.0.1'"
#{1..254 | %{ gwmi -query ("select * from win32_pingstatus where Address='192.168.0."+ $_+ "'") }}
[string](new-object System.Net.WebClient).DownloadString("http://api.stackoverflow.com/0.8/Users/42069?type=jsontext")
([adsisearcher]"objectcategory=computer").findall() | %{([adsi]$_.path).cn + $_.properties.operatingsystemversion}