Skip to content

Instantly share code, notes, and snippets.

View FormData Object
->Setting processData to false lets you prevent jQuery from automatically transforming the data into a query string.
And Setting the contentType to false is imperative.
Refference link: https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
//01// File Upload using FormData Object in Javascript
Syntax:
var formData = new FormData(); // Currently empty
formData.append(name, value); // custom text field where key/value pair
formData.append(name, value, filename); // Custom file uploading
@weisk
weisk / script.sh
Created Apr 9, 2021 — forked from xphere/script.sh
Bash script skeleton
View script.sh
#!/bin/bash
settings() {
SCRIPT_DIR="$(dirname "$0")"
}
main() {
request $@
settings
run
@weisk
weisk / email_parse_url.py
Created Apr 1, 2021 — forked from aptgetupgrade/email_parse_url.py
code to poll emails from an IMAP email server and post these to wallabag
View email_parse_url.py
# Read email in inbox, look for any URLs and update them to wallabag, delete email if URLs found in it.
# Built from various internet sources. Final code donated under GPL v3 by Github user aptgetupgrade
# Tested using python 2. Could be run as part of a crontab, e.g. every 5 mins.
#
import sys
import imaplib
import getpass
import email
import email.header
import datetime
@weisk
weisk / README.md
Created Mar 24, 2021 — forked from mdp/README.md
Clone/Sync all gists
View README.md

Clone all your gists

Stolen from mbostok and improved upon

node cloneAllGists.js username token [outputDir]

@weisk
weisk / notes.md
Created Mar 24, 2021 — forked from routeback/notes.md
SEC487 Notes
View notes.md
View web server log analysis cheat sheet
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
@weisk
weisk / delete_git_submodule.md
Created Mar 15, 2021 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.
View delete_git_submodule.md

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@weisk
weisk / certbot_reverse_proxy_guide.md
Created Feb 24, 2021 — forked from Juul/certbot_reverse_proxy_guide.md
How to use Let's Encrypt / certbot with a reverse proxy
View certbot_reverse_proxy_guide.md

apache config

The secret sauce is:

<Location /.well-known>
    ProxyPass !
</Location>
@weisk
weisk / MS Perks & Benefits.md
Created Feb 24, 2021 — forked from Teino1978-Corp/MS Perks & Benefits.md
Summary of any and all perks when working with Microsoft.
View MS Perks & Benefits.md

##Perks of Microsoft

####Salary

####Health and Wellness Care

  • Medical and hospitalization: Two choices for medical insurance. Both with no premium but different deductibles.
    • The two choices on medical plans are a high-deductible health plan (Microsoft puts a chunk of money into the Health Savings Account for you, which covers most of the deductible) and an HMO.
    • With the HMO, you pay basically nothing as long as you only go to Group Health doctors. With the high-deductible plan, you're covered under the local Blue Cross provider which means you can go to just about any doctor in the country. For
@weisk
weisk / lte_mbim_from_scratch.md
Created Feb 24, 2021 — forked from Juul/lte_mbim_from_scratch.md
How to use 4G LTE modems like the MC7455 on both Debian/Ubuntu and OpenWRT using MBIM
View lte_mbim_from_scratch.md

The purpose of this document is to get you familiar with the concepts and command line tools involved with connecting to the internet using modern 4G LTE modems on both Debian/Ubuntu and OpenWRT.

This writeup is based on my experiences with the Sierra Wireless AirPrime MC7455 modem and a Calyx (Sprint) SIM card, but it should apply to most modern 4G LTE modems.

High level overview

These are the steps required:

  • Physically connect antennas