Skip to content

Instantly share code, notes, and snippets.

View hackingbutlegal's full-sized avatar
💭
I may be slow to respond.

Jackie Singh hackingbutlegal

💭
I may be slow to respond.
View GitHub Profile
@hackingbutlegal
hackingbutlegal / gist:4752007
Created February 11, 2013 02:17
AppleScript to run through a folder, and for any loose files, create a folder for each and name it same as the file. Paste into AppleScript editor, highlight folder in Finder, and click 'Run'.
tell application "Finder"
set selected to selection
set current_folder to item 1 of selected
set mlist to every file of current_folder
repeat with this_file in mlist
set cur_ext to name extension of this_file
set new_name to text 1 thru -((length of cur_ext) + 2) of (name of this_file as text)
set new_folder to make new folder with properties {name:new_name} at current_folder
move this_file to new_folder
end repeat
@hackingbutlegal
hackingbutlegal / gist:4760041
Created February 12, 2013 03:33
Windows: Remotely unlock RDP.
strComputer = InputBox ("Enter Machine Name")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colTSSettings = objWMIService.InstancesOf("Win32_TerminalServiceSetting")
For Each colTS in colTSSettings
colTS.SetAllowTSConnections(1)
Wscript.Echo UCase(strComputer) & "Remote Desktop Is Now Enabled"
Next
@hackingbutlegal
hackingbutlegal / gist:4760042
Created February 12, 2013 03:34
Windows: Fix Active Desktop errors
HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components"
strValue = "0"
ValueName = "DeskHtmlVersion"
objReg.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue
msgbox "Please Log Off & Log Back In!!!!!!"
#!/bin/bash
#
# SCRIPT: log_keystrokes.bash
#
# PURPOSE: This shell script is used to monitor a login session by
# capturing all of the terminal data in a log file using
# the script command. This shell script name should be
# the last entry in the user's $HOME/.profile. The log file
# is both kept locally and e-mailed to a log file administrative
# user either locally or on a remote machine.
#!/bin/bash
#
# List the group(s) associated with each user defined in /etc/passwd
#
#
###########################################
# DECLARE FILES AND VARIABLES HERE
###########################################
case $(uname) in
function ping_nodes
{
# set -x # Uncomment to debug this function
# set -n # Uncomment to check command syntax without any execution
if [ $PINGNODES = "TRUE" ]
then
echo # Add a single line to the output
#!/bin/bash
#
# PLATFORMS: AIX, HP-UX, Linux, OpenBSD, and Solaris
#
# PURPOSE: Uses "uptime" to extract most current load average data, (avg num of jobs in the run queue)
#
# set -x # Uncomment to debug this shell script
# set -n # Uncomment to check script syntax without any execution
#
###################################################
#!/bin/bash
#
# PURPOSE: Highlight text in a file.
# Given a text string and a file the script will search
# the file for the specified string pattern and highlight
# each occurrence. For standard input the script pages a
# temporary file which has the string text highlighted.
#
# set -x # Uncomment to debug
# set -n # Uncomment to check script syntax without execution
#!/bin/bash
#
# PURPOSE: Use the 'select' command to create a menu to show system information
# Clear the screen
clear
# Display the menu title header
echo -e "\n\tSYSTEM INFORMATION MENU\n"
#!/usr/bin/python
#
# Description: Bypass clouflare and find the real IP
#
import urllib2
import socket
import string
import re
import subprocess