Skip to content

Instantly share code, notes, and snippets.

View strugee's full-sized avatar

AJ Jordan strugee

View GitHub Profile
@AndrewKvalheim
AndrewKvalheim / README.md
Last active February 14, 2024 04:32
Simple Dokku virtual machine

Create the Dokku instance:

vagrant up

Configure SSH (see how to enable ~/.ssh/config.d):

vagrant ssh-config --host 'dokku' > ~/.ssh/config.d/dokku
@sanghviharshit
sanghviharshit / mila_api_scratchpad.py
Last active January 8, 2024 06:41
Scratch pad for working with Milacares API for monitoring and controlling Mila air purifier. Read my blog post for more details - https://blog.sanghviharshit.com/reverse-engineering-private-api-ssl-pinning/
# Scratch pad for working with Milacares API for monitoring and controlling their air purifier devices.
# Based on the code from https://www.stefaanlippens.net/oauth-code-flow-pkce.html for PKCE code verifier and challenge.
import base64
import hashlib
import html
import json
import os
import re
import urllib.parse
@ssokolow
ssokolow / update_flatpak_cli.py
Last active February 22, 2024 18:31
Utility for making Flatpak-installed apps available in the terminal through their normal command names
#!/usr/bin/env python3
"""Flatpak CLI Shortcut Generator
A simple no-argument tool that generates launchers with traditional non-flatpak
command names for your installed Flatpak applications in ~/.local/bin/flatpak.
Does full collision detection and warns you if you forgot to add its output
directory to your PATH. Also overrules the command-line specified in the
``.desktop`` file if the Flatpak maintainer didn't include support for
command-line arguments.
@thestinger
thestinger / Android_Q_Privacy.md
Last active January 31, 2024 22:25
Android Q privacy features in the context of the AndroidHardening / GrapheneOS work

Some of the privacy features that I developed in the past are now going to be standard Android features in the next major release. In some cases, the implementation that I worked on ended up being a direct inspiration for the upstream work. I also pushed them to enable permissions review by default, which may have had some influence on it finally shipping as enabled. It was seemingly implemented for some niche scenario and most of their privacy / security team didn't know about the feature existing when I talked to them about it in the past.

Most of my work has focused on improving security, and that focus will be somewhat increased in Android Q due to many of the privacy improvements being part of the baseline OS.

Android P had previously replaced some of the privacy features developed as part of the AndroidHardening project such as restricting access to the camera, microphone and sensors in the background.

Features that were not implemented by my past work:

@jpmens
jpmens / hare.c
Last active February 27, 2024 01:08
hare / hared
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <memory.h>
#include <sys/socket.h>
/*
@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
@mafintosh
mafintosh / npm-classic-config.sh
Last active June 21, 2018 17:40
Resets the npm defaults to how they used to be
npm config set loglevel http
npm config set progress false
npm config set package-lock false
npm config set save false
mkdir -p ~/.config/configstore/
printf '{"optOut": true,"lastUpdateCheck": 0}' > ~/.config/configstore/update-notifier-npm.json
@aberke
aberke / xaero_and_palindromic_strings.py
Created March 1, 2017 15:42
Solution to Hacker Rank Challenge: Xaero And Palindromic Strings -- Finds probability of palindromic substrings when a given string
"""
Alex Berke (aberke)
Problem:
--------
https://www.hackerrank.com/contests/101hack29/challenges/xaero-and-palindromic-strings/copy-from/1300744544
A string is called a palindromic string if it can be read the same going forward as well as backwards.
What is the probability of choosing a substring of such that the letters of the chosen substring can be
shuffled to make it a palindromic string?
@DarrenN
DarrenN / get-npm-package-version
Last active April 17, 2024 16:57 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION