Skip to content

Instantly share code, notes, and snippets.

View DanielJDufour's full-sized avatar

Daniel J. Dufour DanielJDufour

View GitHub Profile
const fs = require("fs");
const https = require('https');
@DanielJDufour
DanielJDufour / pwifi.sh
Last active November 13, 2019 21:52
Get the Password for the Wi-Fi network you are currently connected to
# Run this script to get the password for the Wi-Fi network you are currently connected to
echo "Running pwifi.sh"
path_to_shill_profile=$(sudo find /home/root -name "shill.profile")
echo "path_to_shill_profile: $path_to_shill_profile"
service_id=$(cat /var/log/net.log | grep "Connected -> Online" | grep -e '[0-9]*' --only-matching | tail -1)
echo "service_id: $service_id"
network_name=$(cat /var/log/net.log | grep "Rep ep updated for $service_id" | tail -1 | grep "SSID=[A-Za-z0-9]*" --only-matching | cut -c 6-)
from collections import Counter
import numpy as np
import rasterio as rio
from sys import argv
_, filepath = argv
def pad(string):
length = len(string)
padding = 10 - length
@DanielJDufour
DanielJDufour / hist
Created November 30, 2018 21:20
hist.py
# get counts for raster using rio
from collections import Counter
import numpy as np
import rasterio as rio
from sys import argv
_, filepath = argv
with rio.open(filepath) as src:
ц Russian
б Russian
а Russian
г Russian
в Russian
作 Mandarin
员 Mandarin
年 Mandarin
国 Mandarin
权 Mandarin