Skip to content

Instantly share code, notes, and snippets.

@weisk
weisk / PhoneFormat.js
Created February 24, 2021 03:13 — forked from ckoye/PhoneFormat.js
PhoneFormat.js for Titanium Mobile
/*
Modified version of
https://github.com/albeebe/phoneformat.js/blob/master/PhoneFormat.js
Made it Titanium-Mobile-ready by adding the exports for each function here.
http://www.phoneformat.com
*/
@weisk
weisk / lte_mbim_from_scratch.md
Created February 24, 2021 03:14 — 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

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
@weisk
weisk / MS Perks & Benefits.md
Created February 24, 2021 03:38 — forked from Teino1978-Corp/MS Perks & Benefits.md
Summary of any and all perks when working with Microsoft.

##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 / certbot_reverse_proxy_guide.md
Created February 24, 2021 03:56 — forked from Juul/certbot_reverse_proxy_guide.md
How to use Let's Encrypt / certbot with a reverse proxy

apache config

The secret sauce is:

<Location /.well-known>
    ProxyPass !
</Location>
@weisk
weisk / delete_git_submodule.md
Created March 15, 2021 03:05 — forked from myusuf3/delete_git_submodule.md
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
# 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 / notes.md
Created March 24, 2021 01:38 — forked from routeback/notes.md
SEC487 Notes
@weisk
weisk / README.md
Created March 24, 2021 15:26 — forked from mdp/README.md
Clone/Sync all gists

Clone all your gists

Stolen from mbostok and improved upon

node cloneAllGists.js username token [outputDir]

@weisk
weisk / levenshtein.js
Created March 29, 2021 17:09
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@weisk
weisk / get_test.sh
Created March 29, 2021 17:10
Continuously make requests to a server with curl and measure the request frequency with pv
#!/usr/sbin/env bash
while true; do
curl $1 -s > /dev/null
echo .
done | pv -l > /dev/null