Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / loopit.sh
Last active April 2, 2022 20:14
utilities for printf vulnerability cs647
#!/usr/bin/env bash
for i in {1..220}; do
echo | ./vulnFileCopy2 "'%$i\$x..'"
printf "\nLast offset was: ${i}\n"
done
@cicorias
cicorias / pytorch-bit.ipynb
Created December 19, 2020 21:20
PyTorch BiT
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sixeyed
sixeyed / profile.ps1
Created November 1, 2018 11:25
PowerShell profile with a Linux-style prompt and aliases for common Docker commands
function Prompt(){
$W = Split-Path -leaf -path (Get-Location)
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green
$prompt += Write-Prompt $W -ForegroundColor DarkCyan
$prompt += Write-Prompt '>'
return ' '
}
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
@kauffmanes
kauffmanes / install_anaconda.md
Last active April 19, 2024 03:30
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@mnguyenngo
mnguyenngo / zscore.py
Last active April 12, 2022 04:55
Code to calculate and plot the z-score
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as scs
def z_val(sig_level=0.05, two_tailed=True):
"""Returns the z value for a given significance level"""
z_dist = scs.norm()
if two_tailed:
sig_level = sig_level/2
area = 1 - sig_level
@gramidt
gramidt / build-aad-b2c-combined-policy-jwk.py
Last active November 19, 2018 15:56
Download and combine the Json Web Keys (JWKs) into a single JWK for all of the specified Azure Active Directory B2C (AAD B2C) policies on a tenant.
"""Download and combine Azure Active Directory B2C JWKs.
Download and combine the Json Web Keys (JWKs) into a single JWK for all of the specified Azure Active Directory B2C (AAD B2C) policies on a tenant.
Example:
$python build-aad-b2c-combined-policy-jwk.py --tenant_url https://login.microsoftonline.com/fabrikamb2c.onmicrosoft.com --policies b2c_1_sign_in,b2c_1a_another_policy
"""
import sys
import argparse
@SunnyJohal
SunnyJohal / settings.json
Created April 29, 2018 15:22
My VS Code Settings
{
"auto-close-tag.fullMode": true,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.syntaxProfiles": {
"javascript": "jsx"
},
"editor.tabSize": 2,
"workbench.activityBar.visible": false,
@cicorias
cicorias / get_coursera_videos.sh
Created January 15, 2018 04:13
Download Coursera Videos
git clone https://github.com/coursera-dl/coursera-dl
cd coursera-dl
pip3 install -r requirements.txt
./coursera-dl -u <Email-id> -p <Password> --subtitle-language en raspberry-pi-interface
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@westmark
westmark / auth0-verify.js
Last active August 18, 2022 07:45
Auth0 JWT Verification
/**
The MIT License (MIT)
Copyright (c) 2017 Fredrik Westmark
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