Skip to content

Instantly share code, notes, and snippets.

View JustinMcNamara74's full-sized avatar

Justin McNamara JustinMcNamara74

View GitHub Profile
@ernsheong
ernsheong / access-mac-localhost-from-parallels-desktop-ie-edge.md
Last active November 7, 2024 12:31
Accessing macOS localhost from Parallels Desktop IE or Edge

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

@JosiahSiegel
JosiahSiegel / grafana_prometheus.md
Last active October 5, 2021 15:44
#Grafana #Prometheus Linux & MySQL monitoring

Grafana MySQL & Linux Monitoring - No Docker

Server Install

Install Prometheus

wget https://github.com/prometheus/prometheus/releases/download/v1.3.1/prometheus-1.3.1.linux-amd64.tar.gz

tar xvfz prometheus-1.3.1.linux-amd64.tar.gz
sudo mv prometheus-1.3.1.linux-amd64 prometheus
@JosiahSiegel
JosiahSiegel / file_path.sql
Created November 1, 2016 15:32
#MSSQL #Research List database file locations
SELECT DB_NAME(database_id), name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
GO
@mattantonelli
mattantonelli / good_commit_messages.md
Last active May 31, 2024 14:20
A Guide to Good Commit Messages

Good Commit Messages

A good commit message helps both you and your collaborators better understand your code. A series of good messages will create a well-documented history as your code evolves. This also makes it easier for someone to pick up where you left off.

Jump to:

  1. Summary
  2. Description
  3. Full message
  4. Branch
@mattantonelli
mattantonelli / ssh_keys.sh
Last active May 2, 2017 17:55
Generate SSH keys and copy public key to remote host with ssh-agent.
# Generate your SSH key pair with the RSA algorithm
ssh-keygen -t rsa -C [email protected]
# Add the key pair to ssh-agent, if you are using it (optional)
ssh-add
# Copy public key to SSH destination
ssh-copy-id login@destination
# Show your public key
@shark0der
shark0der / ubuntu14.04-command-line-install-android-sdk
Last active March 7, 2021 15:09 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk (platform & platform-tools only, no emulator)
# install java
apt-get install -y software-properties-common
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# download latest android sdk
# http://developer.android.com/sdk/index.html#Other
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
@JosiahSiegel
JosiahSiegel / latest_full_backups.sql
Last active October 15, 2015 18:33
#MSSQL #Research #Backup Latest full backup for each database
SELECT
A.[Server],
B.user_name,
A.last_db_backup_date,
B.backup_start_date,
B.expiration_date,
B.backup_size,
B.logical_device_name,
B.physical_device_name,
B.backupset_name,
@JosiahSiegel
JosiahSiegel / backups_past_week.sql
Last active January 6, 2017 20:04
#MSSQL #Research #Backup Full Backups for all databases For Previous Week
SELECT
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
msdb.dbo.backupset.user_name,
msdb.dbo.backupset.database_name,
cast(msdb.dbo.backupset.backup_start_date as datetime2(0)) as 'backup_start_date',
cast(msdb.dbo.backupset.backup_finish_date as datetime2(0)) as 'backup_finish_date',
cast(msdb.dbo.backupset.expiration_date as datetime2(0)) as 'expiration_date',
CASE msdb..backupset.type
WHEN 'D' THEN 'Database'
WHEN 'L' THEN 'Log'
@JosiahSiegel
JosiahSiegel / emergency_rollback.bat
Last active April 26, 2017 12:59
#MSSQL #Users Prevent login access to particular applications
REM Required: "-A" for DAC connection. Optional "-E" for trusted connection (instead of "-U -P").
sqlcmd -S 127.0.0.1 -U MyAdmin -P Admin123 -q "exit(DROP TRIGGER [Restrict_Application_Access_Login_Trigger] ON ALL SERVER)" -A
@JosiahSiegel
JosiahSiegel / kill_job_spids.sql
Created September 1, 2015 20:17
#MSSQL Auto KILL SPIDs based upon job name
DECLARE @spid INT
DECLARE @kill_spid NVARCHAR(100)
DECLARE running_jobs CURSOR FOR
SELECT
req.session_id
FROM sys.dm_exec_requests req
LEFT JOIN sys.dm_exec_sessions ses ON ses.session_id = req.session_id
LEFT JOIN msdb.dbo.sysjobs jobs ON SUBSTRING(ISNULL(ses.[program_name],''),CHARINDEX('0x', ISNULL(ses.[program_name],'')) + 18, 16) = SUBSTRING(REPLACE(ISNULL(jobs.[job_id],''), '-',''),17,16)