Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Working from home forevah!

Mark Sta Ana booyaa

🏠
Working from home forevah!
View GitHub Profile
#!/bin/bash
# Inspired by this API example: https://docs.microsoft.com/en-us/rest/api/securitycenter/jitnetworkaccesspolicies/initiate#examples
SCRIPT_NAME=$(basename "$0")
echo "$SCRIPT_NAME: Requests JIT (ssh) access to vm via the Security Center API."
if [[ "$#" -lt 1 ]]; then
echo "Error! Usage: $SCRIPT_NAME <vm name> (<justification>) (<iso860 time duration>)"
echo "Example iso860 time durations: PT5M (5 mins - default), PT1H (1 hr)"
$WebAppResourceGroup = '...'
$WebAppName = '...'
$HealthCheckUrl = '/healthcheck'
$Resource = Get-AzResource `
-ResourceType Microsoft.Web/sites `
-ResourceGroupName $WebAppResourceGroup `
-ResourceName $WebAppName
$Resource.Properties.siteConfig.healthCheckPath = $HealthCheckUrl
#!/bin/bash
# Inspired by this API example: https://docs.microsoft.com/en-us/rest/api/securitycenter/jitnetworkaccesspolicies/initiate#examples
SCRIPT_NAME=$(basename "$0")
echo "$SCRIPT_NAME: Requests JIT (ssh) access to vm via the Security Center API."
if [[ "$#" -lt 1 ]]; then
echo "Error! Usage: $SCRIPT_NAME <vm name> (<justification>)"
exit 1
@booyaa
booyaa / wsl2-workarounds.md
Created February 7, 2020 10:39
WSL2 workarounds

WSL2 known issues and their workarounds

WSL2: docker: Error response from daemon: cgroups: cannot find cgroup mount destination: unknown.

issues:

workaround

@booyaa
booyaa / README.md
Last active February 12, 2019 20:05
My iSH bootstrapping script

My iSH bootstrapping script

iSH is a Linux shell for iOS (no rly).

Usage

curl -LsSf http://bit.ly/setupish | sh

maybe turn into a blog post one day

fixed width string to list

briefly appeared on SO before being killed by mods (OP never made an effort to show their progress)

open in repl.it

# source: 00000550000066000007700000880000099
@booyaa
booyaa / 1_meetup_schedule.md
Last active September 20, 2017 12:52
talks

Schedule

  • 6:30PM - We'll try to get the Skillsmatter AV team to do setup their laptop. It's the one they use specially for hangouts. One important thing I learnt from last time, is to have the webcam pointing at at the audience. Should help Niko get some audience feedback. We might be buggered if they need us to turn off the lights though. We'll also try to do a quick hangout test with Niko if possible.
  • 6:50PM - Intro - We need volunteers to help with Rust workshops for the Mozilla Festival Oct 27th-29th (there will be a paper to stick your email address on if interested). https://www.mozillafestival.org/
  • Niko Matsakis (Rust Core Team) - Compiler internals
    • Intro (if you want something to read off here's the bios (from skillsmatter and meetup pages))
    • Niko does his talk
    • 5-10 mins Q & A
  • 5 mins break
  • Amanieu d'Antras (member of Brussels Rust group) - Intrusive collections for Rust
# A gitignore for dotcore development in Visual Studio Code
# inspired by : https://github.com/dotnet/core/blob/master/.gitignore
# miscellany and obsolete artifact
*.swp
*.*~
project.lock.json
.DS_Store
*.pyc
@booyaa
booyaa / main.rs
Created August 23, 2017 15:15
RLS not renaming shadow variables
use std::io;
fn main() {
let mut guess = String::new(); // we're going to rename the `guess` that's a string
io::stdin().read_line(& mut guess).expect("Failed to read line");
println!("string guess: {}", guess);
let guess : u32 = guess.trim().parse().expect("Failed to parse as number");
println!("u32 guess: {}", guess);
}
@booyaa
booyaa / early_return.md
Last active August 20, 2017 11:27
Early Return

Quickest way to cancel insurance renewal

UK

Car

Elephant (Last updated: August 2017)

  • call tel:03332226719
  • option: 1, 2