Skip to content

Instantly share code, notes, and snippets.

View winsanitize.ps1
# Remove Cortana
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\' -Name 'Windows Search' | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' -Name 'AllowCortana' -PropertyType DWORD -Value '0' | Out-Null
get-appxpackage *BingWeather* | remove-appxpackage
get-appxpackage *Xbox* | remove-appxpackage
get-appxpackage *Messaging* | remove-appxpackage
get-appxpackage *OneNote* | remove-appxpackage
get-appxpackage *People* | remove-appxpackage
get-appxpackage *Photos* | remove-appxpackage
View 20220305_grey_dots_colored_dot
// grey dots colored dot p5.js
let canvasedge = 600;
// how much to increment each for loop by
let inc = 30;
let ra_x = 0;
let ra_y = 0;
let lastX=0;
@empireshades
empireshades / print_unicode_chars
Created Oct 8, 2021
Loop to preview unicode chars
View print_unicode_chars
for i in range(1200,2900):
print((b'\\u%d' % i).decode('raw_unicode_escape'),end='')
@empireshades
empireshades / block_goog.sh
Last active Sep 2, 2021
Block access to google for younger kid when logged in on mac but make sure it works for everyone else. Run on root's crontab every minute and make sure common_hosts contains what you want as baseline hosts file.
View block_goog.sh
cd "${0%/*}"
# Check which user is logged in
user=$(stat -f '%Su' /dev/console)
# Check if hosts file contains 'google'
if $(grep -q google /etc/hosts);then
GOOGLE=true
else
GOOGLE=false
@empireshades
empireshades / restore_functionality.sh
Last active Aug 25, 2021 — forked from lcarsos/restore_functionality.sh
Repeatedly kill sentinelone so you can actually use the processor and ram on your mac
View restore_functionality.sh
#!/usr/bin/env bash
# Usage: sudo ./restore_functionality.sh
#ps aux | grep sentinel | awk -F " +" '{print $2}' | xargs kill
while true; do
launchctl kill SIGKILL system/com.sentinelone.sentineld
launchctl kill SIGKILL system/com.sentinelone.sentineld-helper
launchctl kill SIGKILL system/com.sentinelone.sentineld-guard
launchctl kill SIGKILL system/com.sentinelone.sentineld-updater
@empireshades
empireshades / split_wav.py
Created Nov 7, 2020 — forked from vireshas/split_wav.py
Split WAV files at silence
View split_wav.py
#!/usr/bin/env python
from scipy.io import wavfile
import os
import numpy as np
import argparse
from tqdm import tqdm
# Utility functions
View circling_spheres.pde
float x, y, z;
void setup() {
size(800, 800, P3D);
// setup translate amounts to center screen
x = width / 2;
y = height / 2;
// gonna have the z-axis 'pulsate' as per the last line (sin)
View CIS Controls
# CIS Controls
from: https://www.cisecurity.org/controls/
## Basic CIS Controls
1. Inventory and Control of Hardware Assets
2. Inventory and Control of Software Assets
3. Continuous Vulnerability Management
4. Controlled Use of Administrative Privileges
5. Secure Configuration for Hardware and Software on Mobile Devices, Laptops, Workstations and Servers
View newsphrases.py
from textblob import TextBlob, Word
import sys
import random
from newspaper import Article
from fuzzywuzzy import fuzz
from nltk.stem import WordNetLemmatizer
def nphra(text):
# Extract Noun Phrases from text input
blob = TextBlob(text)
View how to auth python flickr-api
Hi,
Just a snippet of code to demonstrate the solution to people who arrive here and are still scratching their heads:
import flickr_api
flickr_api.set_keys(api_key = 'my_api_key', api_secret = 'my_secret')
a = flickr_api.auth.AuthHandler()
url = a.get_authorization_url("read")
print url