Skip to content

Instantly share code, notes, and snippets.

View cjohnson496's full-sized avatar

Charles Johnson cjohnson496

View GitHub Profile
@cjohnson496
cjohnson496 / bulk-rename.ps1
Created December 26, 2018 22:29 — forked from ethangardner/bulk-rename.ps1
Powershell script to bulk replace spaces with underscores in a directory of files
Dir | Rename-Item –NewName { $_.name –replace “ “,”_” }
@cjohnson496
cjohnson496 / Get-Weather.ps1
Created October 30, 2018 07:38
My "refactored" version of obs0lete's Get-Weather script https://github.com/obs0lete/Get-Weather
<#
.SYNOPSIS
Shows current weather conditions in PowerShell console.
.DESCRIPTION
This scirpt will show the current weather conditions for your area in your PowerShell console.
While you could use the script on its own, it is highly recommended to add it to your profile.
See https://technet.microsoft.com/en-us/library/ff461033.aspx for more info.
You will need to get an OpenWeather API key from http://openweathermap.org/api - it's free.
@cjohnson496
cjohnson496 / fix-homebrew-npm.md
Created June 11, 2018 18:23 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@cjohnson496
cjohnson496 / logr.bash
Created May 17, 2018 07:29 — forked from ttscoff/logr.bash
Bash logging utility that simplifies use of logger command
#!/bin/bash
# Logging utility that simplifies user of bash logger command
# # First source the script
# source ~/scripts/logr.bash
# # Start the logger, generates log name from scripts filename
# logr start
# # or define your own
# logr start LOG_NAME
@cjohnson496
cjohnson496 / caribe
Created February 6, 2018 16:25 — forked from anonymous/caribe
Unable to deliver message with id: 20161207123147739 type: ADT^A01 source:192.168.0.207:63300 facilityCode: HOSPITAL port:9400 received: 02/06/2018 11:12:34 a. m.
Unable to deliver message with id: 20161207123147739 type: ADT^A01 source:192.168.0.207:63302 facilityCode: HOSPITAL port:9400 received: 02/06/2018 11:15:26 a. m.
@cjohnson496
cjohnson496 / caribe2
Created February 6, 2018 16:24 — forked from anonymous/caribe2
MSH|^~\&|ADT1|HOSPITAL|RISADT|RIS|20161207123147739|ADTMESSAGE|ADT^A01|20161207123147739|P|2.4
EVN|A01|20161207123147739
PID|||8-00-407-694-D|357716|RIVERA GONZALEZ^ABRAHAM CONSTANTINO||19710615|M|||CERRO SILVESTRE ARRAIJAN URB. URB. LA ISABELA CASA 46^^^^||3459739|66747559|||||8-407-694|
NK1||^|||||
PV1|||^||||^^|||||-||
AL1|||||
DG1||I9|||||
PR1||||
NTE
<?php
/**
* Send an message to a Flowdock "flow".
*
* # Initialization:
* <code>
* $fd = new Flowdock();
* $fd->setToken('asdadsads');
* </code>
*
@cjohnson496
cjohnson496 / Flowdock.php
Created January 24, 2018 21:13 — forked from stojg/Flowdock.php
Sending a message via php and curl to a flowdock "flow"
<?php
/**
* Send an message to a Flowdock "flow".
*
* # Initialization:
* <code>
* $fd = new Flowdock();
* $fd->setToken('asdadsads');
* </code>
*
@cjohnson496
cjohnson496 / mycloud-vulnerabilities.md
Created January 20, 2018 17:43 — forked from bmaupin/mycloud-vulnerabilities.md
Investigating My Cloud vulnerabilities

Description of vulnerabilities: WDMyCloud Multiple Vulnerabilities

Update 2018-01-20

Both critical vulnerabilities (the hard-coded backdoor and the file upload vulnerability) have been corrected as of 2018-01-12 with the following firmwares:

My Cloud device Firmware
@cjohnson496
cjohnson496 / guide.text
Created January 20, 2018 17:42 — forked from sled/guide.text
Guid to cross compile transmission 2.82 for Western Digital MyCloud
########################################################
## CROSS COMPILING TRANSMISSION 2.82 FOR WD MY CLOUD ##
########################################################
This is a guide to compile transmission 2.82 for the WD MyCloud 2/3/4 TB.
Because I didn't want to install the build tools and dependencies on my NAS I chose to
setup a cross-compiler toolchain on my x86_64 Ubuntu 12.04 machine and create a .deb package
that can be installed on the NAS. Furthermore the cross compiler can be used to compile anything for the My Cloud (printer drivers, etc.)