Skip to content

Instantly share code, notes, and snippets.

View maietta's full-sized avatar

Nick Maietta maietta

View GitHub Profile
@xon52
xon52 / xon-GridCanvas.vue
Last active March 5, 2024 09:23
Medium - Flexible Canvas Grid (without blurred lines)
<template>
<canvas class="gridCanvas"
:width="width"
:height="height"
></canvas>
</template>
<script>
export default {
name: 'xon-GridCanvas',
@adisheshsm
adisheshsm / multipart_upload.go
Created December 27, 2017 10:07 — forked from mattetti/multipart_upload.go
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
#!/bin/bash
# 用于创建macOS安装ISO的脚本文件
# 初始脚本来源:http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
set -x
SCRIPT_PATH=`pwd`/$0
DMG_PATH="/Applications/Install macOS High Sierra.app/Contents/SharedSupport"
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@ssalonen
ssalonen / OpenWrt SSH tunnel.md
Last active February 13, 2024 21:29
OpenWrt SSH tunnel

Short how-to for creating a reverse ssh tunnel to a remote server. Useful for breaking NATted connection for example.

  1. At OpenWrt:
opkg update
opkg install sshtunnel
  1. At remote server: create client ssh keys
@steveheinsch
steveheinsch / gist:287edd5ce26e608b06b20af384f4cc1e
Last active September 26, 2022 21:53
Function to retrieve all lookup key/values for a Resource/Class in PHRETS 2+
<?php
// Note: $this->server is a "logged in" PHRETS $session
public function getLookupValues($resourceName, $className)
{
$results = array();
// Get Table Metadata for this resource/class
$tableMeta = $this->server->GetTableMetadata($resourceName, $className);
@cyrusboadway
cyrusboadway / google-domains-dynamic-dns-update.sh
Created February 20, 2016 17:21
Script to update a Google Domains DNS record
#!/bin/bash
### Google Domains provides an API to update a DNS "Syntheitc record". This script
### updates a record with the script-runner's public IP, as resolved using a DNS
### lookup.
###
### Google Dynamic DNS: https://support.google.com/domains/answer/6147083
### Synthetic Records: https://support.google.com/domains/answer/6069273
USERNAME=""
#!/bin/sh
# Author: Nicolas Schneider
# Mounts all volumes that are mounted in a Docker container
# under a given root relative to their mount point in the container.
# Usage: bindMountDockerData.sh container /mnt/path
#
# Example: Docker container 'demo' which has a volume mounted at /somedata and
# another at /home/userdata.
# Running 'bindMountDockerData.sh demo /mnt/dockerdemo'
# will result in:
@ecapuano
ecapuano / getTORnodes.sh
Created August 25, 2015 17:44
Simple script for getting the latest list of TOR exit nodes and outputting them into a blocklist format, 1 exit node per line. Easily used as Dynamic Blocklist on Palo Alto Firewalls.
#!/bin/bash
#
# Use 'crontab -e' to create a scheduled job for this. Every 6 hours or so should be good.
# Make sure your blocking software/hardware can access the tor_nodes.txt file via HTTP / FTP / SCP / etc...
#
curl https://check.torproject.org/exit-addresses | grep ExitAddress | cut -d' ' -f2 > /var/www/html/blocklists/tor_nodes.txt
@Juul
Juul / ssh-copy-id-openwrt
Last active August 23, 2023 11:10
ssh-copy-id but for openwrt / dropbear
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Example: ${0} root@192.168.1.1"
exit 1
fi
cat ~/.ssh/id_rsa.pub | ssh ${1} "cat >> /etc/dropbear/authorized_keys && chmod 0600 /etc/dropbear/authorized_keys && chmod 0700 /etc/dropbear"