Skip to content

Instantly share code, notes, and snippets.

View EdwardNavarro's full-sized avatar
🎯
Focusing

Edward Navarro EdwardNavarro

🎯
Focusing
View GitHub Profile
@HighMacGuy
HighMacGuy / first_run.ini
Last active August 18, 2022 16:52 — forked from andyspicer/install.sh
OpenVPN Access Server Letsencrypt
# OpenVPN Let's Encrypt first run config file
#https://loige.co/using-lets-encrypt-and-certbot-to-automate-the-creation-of-certificates-for-openvpn/
cert-name=
authenticator = standalone
standalone-supported-challenges = tls-sni-01
non-interactive = True
rsa-key-size = 4096
email = "user@server.com"
domains = "vpn.server.com"
@sanjeevsiva17
sanjeevsiva17 / server.py
Last active December 29, 2022 03:13
Python server for zpl
from flask import Flask, request, jsonify
import json
from printToPrinter import printToPrnter
import textwrap
app = Flask(__name__)
@app.route('/')
@sanjeevsiva17
sanjeevsiva17 / printToPrinter.py
Created May 4, 2021 10:55
Create and send zpl file to printer
import os, sys
import subprocess
def printToPrnter(name, city):
data = "^XA" \
"^FO200,30^ADN,30,20^FB400,3,0,C^FD"+name+"^FS" \
"^FO200,80^ADN,30,20^FB400,3,0,C^FD"+city+"^FS" \
"^XZ"
try:
@rodrigobdz
rodrigobdz / ping.js
Last active February 13, 2023 14:46
Ping IP Address in React Native
fetch('http://localhost')
.then((response) => {
console.log('response ', response)
if (response.status === 200) {
console.log('success')
} else {
console.warn('error')
}
})
.catch((error) => {
@TrimIdeas
TrimIdeas / Audit changed or deleted files in Windows Server 2008 R2 or newer.ps1
Last active March 27, 2023 04:45
Audit changed and deleted files on Server 2008 R2, 2012, and 2012 R2
# Version 1.2 :: This script reads offline event logs, oldest to newest, bottom to top.
# See http://www.trimideas.com/2015/04/auditing-changed-deleted-files.html for instructions.
$LogPath = "C:\Event_Logs\"
$ReportPath = "C:\Audit\File-Audit-Reports\"
$Formatted_Date = (Get-Date -UFormat %A-%B-%d-at-%I-%M-%S%p)
$ZipName = "Security-Events-for-" + (Get-Date -UFormat %A-%B-%d) + ".zip"
$Report_in_CSV = $ReportPath + "Audit of changed files on " + $Formatted_Date + ".csv"
$Truncated_Log_Path = $LogPath + "Archive-Security_on_" + $Formatted_Date + ".evtx"
$Today_Midnight = (Get-Date -Hour 0 -Minute 0 -Second 0)
@kosinix
kosinix / custom-nav-walker-usage.php
Last active April 25, 2023 09:32
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>
@ragingwind
ragingwind / nginx.conf
Created August 5, 2019 09:19
Redirect old-classic browser including IE 11
worker_processes 1;
events {
worker_connections 1024;
}
http {
map $http_user_agent $outdated {
default 0;
"~MSIE [1-10]\." 1;
@navjotdhanawat
navjotdhanawat / json-to-s3.js
Created July 3, 2018 07:17
Create json and upload to s3 bucket using nodejs.
var AWS = require('aws-sdk');
AWS.config.update({ region: 'us-east-1' });
var s3 = new AWS.S3();
var obj = {
firstname: "Navjot",
lastname: "Dhanawat"
};
var buf = Buffer.from(JSON.stringify(obj));
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@petrleocompel
petrleocompel / README.md
Last active August 25, 2023 22:08
Huawei - modes

AT Mode E3131

usb_modeswitch -v 0x12d1 -p 0x14fe -V 0x12d1 -P 0x1506 -M "55534243123456780000000000000011062000000100000000000000000000"

AT Mode E3372

usb_modeswitch -v 0x12d1 -p 0x14fe -V 0x12d1 -P 0x1506 -J