Skip to content

Instantly share code, notes, and snippets.

@ubergoober
ubergoober / SCCMLastStateValues.txt
Created May 7, 2014 18:27
SCCM Last State values in v_ClientAdvertisementStatus
SCCM Last State values in v_ClientAdvertisementStatus in the Database
-1 - Accepted - No Further Status
0 - No Status
1 - Accepted
8 - Waiting
9 - Running
11 - Failed
13 - Succeeded
"Accepted - No Further Status" means that the client(s) received the advertisment but not yet started the installation. The clients may have to start the installation manually or in the case of an App-V app, will need to be executed manually. (this comment was added by me (Paul) based on information found online.
@ubergoober
ubergoober / ADAccountTypes.bat
Created May 7, 2014 18:28
AD Account Types
@echo off
if {%2}=={} @echo Syntax: call sAMAccountType sat satDescription&goto :EOF
if "%1" EQU "0" set %2=SAM_DOMAIN_OBJECT&goto :EOF
setlocal
set /a sat=%1
set desc=UNKNOWN
if %sat% EQU 268435456 set desc=SAM_GROUP_OBJECT&goto finish
if %sat% EQU 268435457 set desc=SAM_NON_SECURITY_GROUP_OBJECT&goto finish
if %sat% EQU 536870912 set desc=SAM_ALIAS_OBJECT&goto finish
if %sat% EQU 536870913 set desc=SAM_NON_SECURITY_ALIAS_OBJECT&goto finish
@ubergoober
ubergoober / .bash_profile.sh
Last active May 6, 2019 16:50
Bash profile (created for mac terminal) which I use. To keep this updated without impacting your additions, edit the file ~/.bash_adds which is added after restarting your terminal or doing a "source ~/.bash_profile"
# advise not editing this file for copy/paste drop in updating (not that I update this gist that often).
# when you source this file (or restart term), a ~/.bash_adds file is created which get's sourced from this file.
# Feel free to edit this file in your ~/.bash_profile file, but don't blame me if you overwrite some cool addtions :)
# -- old -- export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[32m\]\$(parse_git_branch)\[\033[00m\]\$ "
export PS1="\n\[\033[48;5;235m\]\[\033[36m\]\u\[\033[m\]\[\033[48;5;235m\]@\[\033[32m\]\h\[\033[38;5;245m\] | \[\033[38;5;99m\]Node: \$(parse_node_version)\[\033[38;5;245m\] | \[\033[38;5;204m\]\$(parse_date_time)\[\033[00m\]\n\[\033[33;1m\]\w\[\033[32m\]\$(parse_git_branch)\[\033[00m\]$ "
export CLICOLOR=1
export LSCOLORS=DxFxBxDxCxegedabagacad
@ubergoober
ubergoober / full_path_finder.sh
Created November 11, 2014 08:40
Show full path in OS X finder title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
@ubergoober
ubergoober / ExpressNodeCORS
Created December 30, 2014 11:32
Express Node Server CORS
var app = express();
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
next();
});
@ubergoober
ubergoober / cors.js
Created January 16, 2015 18:39
Disable CORS on Express.js
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
@ubergoober
ubergoober / imageReplace
Created April 16, 2015 12:44
Cleanly replace missing images in web page
/*
The below img error snippet will instantly hide any broken image placeholders
although it appears there's extra steps happening here (hidding and unhiding),
The reason is that the split second delay of reloading a new placeholder image
can cause the ugly missing image placeholder to flash if we don't hide it instantly on err.
*/
$("img").error(function () {
$(this).css({visibility:"hidden"});
$(this).attr({src:'/images/theme/no_logo_placeholder.png'});
@ubergoober
ubergoober / nodeUpdateMac
Last active August 29, 2015 14:21
Simple nodejs updating on Mac
#clear you npm cache
sudo npm cache clean -f
#install "n" (this might take a while)
sudo npm install -g n
#upgrade to lastest version
sudo n stable
@ubergoober
ubergoober / InstalledNodeModules
Created June 3, 2015 18:35
Get current node modules and their versions that are installed.
#run command from root of node project after npm install has been run.
ls node_modules | xargs -I % grep \"_id\" node_modules/%/package.json
@ubergoober
ubergoober / shia
Last active August 29, 2015 14:22
Shia Do It web embedding without Chrome extension.
// Shia Do-It motivational overlay
// Found @ https://github.com/etaheri/do-it-chrome-extension
// Forked here https://github.com/ubergoob/do-it-chrome-extension
// assets can be gotten from either.
// Edit path to the video and the selector to hook.
<div class="shia-do-it"><div class="container"><video width="960" height="540" name="media" src="http://HOST/PATH/output.webm" style="visibility: hidden;"><source type="video/webm"></video></div></div>
<script type="application/javascript">
$(document).ready(function() {