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:
//01// File Upload using FormData Object in Javascript
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 /
Created Apr 9, 2021 — forked from xphere/
Bash script skeleton
settings() {
SCRIPT_DIR="$(dirname "$0")"
main() {
request $@
weisk /
Created Apr 1, 2021 — forked from aptgetupgrade/
code to poll emails from an IMAP email server and post these to wallabag
# 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 /
Created Mar 24, 2021 — forked from mdp/
Clone/Sync all gists

Clone all your gists

Stolen from mbostok and improved upon

node cloneAllGists.js username token [outputDir]

weisk /
Created Mar 24, 2021 — forked from routeback/
SEC487 Notes
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 /
Created Mar 15, 2021 — forked from myusuf3/
How effectively delete a git submodule.

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 /
Created Feb 24, 2021 — forked from Juul/
How to use Let's Encrypt / certbot with a reverse proxy

apache config

The secret sauce is:

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

##Perks of Microsoft


####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 /
Created Feb 24, 2021 — forked from Juul/
How to use 4G LTE modems like the MC7455 on both Debian/Ubuntu and OpenWRT using MBIM

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