Skip to content

Instantly share code, notes, and snippets.

View ncrmro's full-sized avatar
🦁

Nicholas Romero ncrmro

🦁
View GitHub Profile
{
name: "Find My Towed Vehicle (U)",
todoData: [
{
todoName: "Find My Towed Vehicle",
todoUrl: "http://findmytowedcar.com/tvrmscitizen/mainpage.aspx"
}
],
owner: "ncrmro"
},
@ncrmro
ncrmro / mongo-dockerfile
Created December 14, 2015 10:47
A file for deploying a development mongoDB
FROM debian:wheezy
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl \
numactl \
&& rm -rf /var/lib/apt/lists/*
import React from 'react';
import { graphql, QueryRenderer } from 'react-relay';
function withRelayContainer(WrappedComponent, selectData) {
return ({environment, variables, router}) =>
<QueryRenderer
environment={environment}
query={graphql`
query PollsContainerQuery($id: ID!) {
question(id: $id) {
@ncrmro
ncrmro / dantes_infrastructure.md
Last active June 16, 2018 13:23
A minimum and recommended requirements for Dantes Infra.

You will need at the minimum one dediticated 64x bit server.

Minimum Requirements

Server

  • Dual core 64bit procetter with VT-D support
  • 32GB Storage
  • 2GB RAM
@ncrmro
ncrmro / missingParathenasis.js
Created June 20, 2018 04:12
AI/AA Example Errors
function expandSheet(e) {
# Missing ) bellow
const expanded = e.getAttribute("style";
console.log(expanded)
if (!expanded){
}
e = document.getElementById(`${e.id}-expandable`)
console.log('EXAPND', e)
from django.contrib.postgres.search import TrigramSimilarity
from parts.models import Part
def trigram_similarity_search(similarity=0.3, search_string=""):
parts = Part.objects
parts = parts.annotate(similarity=TrigramSimilarity('name', search_string))
parts = parts.filter(similarity__gt=similarity).order_by('-similarity')
@ncrmro
ncrmro / deploy.sh
Created June 15, 2020 17:49
A script to build and copy binary to remote host (pi in this case) only if src is changed and then run said binary.
#!/bin/sh
set -e
## Current folder name
PROJECT_NAME=${PWD##*/}
DEPLOY_HOST=pi
DEPLOY_USER=pi
CHECKSUM_FILE=target/checksum
@ncrmro
ncrmro / gist:57af8b1e361660af618a3fb968eac0ba
Created June 26, 2020 23:20
Unlock Encrypted Root Disk using dropper with auto find IP on MAC address
artul() {
MAC_ADDRESS=94:c6:91:ae:53:fc
NETWORK=192.168.1
echo Attempting to find IP address of host to unlock with MAC address $MAC_ADDRESS on $NETWORK.0
IP_ADDRESS=`for ((i=1; i<=255; i++));do arp $NETWORK.$i; done | grep $MAC_ADDRESS | awk '{print $2}' | sed -e 's/(//' -e 's/)//'`
echo Found IP address: $IP_ADDRESS
ssh root@$IP_ADDRESS -p 22 -i ~/.ssh/id_rsa
}
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILz8pN4JIWGXt2zZlj4qIrxgXtF6Nc2O06MAazcSj3hm ncrmro-workstation-22-07-2020
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA4cFS7p6Dkh1Aj60scG7qrTAJufD65b5YYGLabgpnEX ncrmro-laptop