Skip to content

Instantly share code, notes, and snippets.

View J-DubApps's full-sized avatar

Julian West J-DubApps

View GitHub Profile
@idavis
idavis / Use-Impersonation.ps1
Created March 5, 2011 18:52
Impersonate a user and execute a script block as that user
param( [ScriptBlock] $scriptBlock )
<#
.SYNOPSIS
Impersonates a user and executes a script block as that user. This is an interactive script
and a window will open in order to securely capture credentials.
.EXAMPLE
Use-Impersonation.ps1 {Get-ChildItem 'C:\' | Foreach { Write-Host $_.Name }}
This writes the contents of 'C:\' impersonating the user that is entered.
#>
@iband
iband / VPN_AutoConnect_MacOS_X.scpt
Created March 31, 2011 10:45
Apple Script to enable VPN autoconnect on MacOS X
on idle
tell application "System Events"
tell current location of network preferences
set myConnection to the service "VPN" #rename as your VPN connection called
if myConnection is not null then
if current configuration of myConnection is not connected then
connect myConnection
end if
end if
end tell
@koma5
koma5 / backup.bat
Created May 18, 2012 11:39
automated mysql dumps on windows - dumps all dbs which user sees
set MYSQLUSER=username
set MYSQLPASS=password
set BATCHFILE=C:\Temp\auto_built_sql_dump.bat
set DUMPPATH=Z:\
set DRIVE=Z:
net use %DRIVE% \\somehost\some\networkdrive /user:domain\user password
rem building time stamp
set tmp_time=%time:~-11,2%.%time:~-8,2%.%time:~-5,2%
@theagreeablecow
theagreeablecow / MultiRobocopy.vbs
Created June 6, 2012 11:31
Multiple Robocopy Streams
Option Explicit
On Error Resume Next
Dim Source1, Source2, Source3, Destination1, Destination2, Destination3, BatchFile1, BatchFile2, BatchFile3
'******************************************
'Root Source folders to parse
Source1 = "\\server1\c$\folder1"
Source2 = "\\server1\share1"
Source3 = "\\server1\share2"
@Xpktro
Xpktro / prefmask.py
Created November 23, 2012 06:02
Simple decimal subnet mask calculator.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Simple decimal subnet mask calculator.
#
# How to use:
# python prefmask.py <number>
# i.e.: python prefmask.py 17
#
#
@tfl
tfl / gist:5821496
Created June 20, 2013 09:36
Elevate.exe is a small win32 console utility for Windows Vista or Windows 7/8 to help start other utilities with elevated rights but without having to start them from a batchfile
/*
*
* Torsten Flammiger, 2012
* (C) AS IS
*
*/
#include "stdafx.h"
#include "windows.h"
#include <iostream>
Cracking the coding interview, careercup
Data Structures
1. Integer
– find number of 1s
– next largest smaller
– smallest larger number
– determine if is palindrom
– itoa, atoi
@nvgrw
nvgrw / TP_Mac_Setup.markdown
Last active July 27, 2025 02:12
TurboPascal setup tutorial for Mac

TurboPascal on Mac

Note: probably 99% of this tutorial (excluding installation and folder structure) is DOSBox- and not Mac-specific. As long as your computer can run DOSBox you should be able to convert the steps to work on Windows.

1. Downloading & Installing DOSBox

DOS apps don't run natively on OS X, so we use DOSBox to emulate DOS for us.

1a. Downloading DOSBox

Navigate to the official DOSBox download page

@arulrajnet
arulrajnet / ChromeAppDownloader.py
Last active June 14, 2025 15:17
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
# -*- coding: utf-8 -*-
"""
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
Referred from http://chrome-extension-downloader.com/how-does-it-work.php
"""
from __future__ import division
import argparse
import requests
@roachhd
roachhd / README.md
Last active October 27, 2025 12:31
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION