Skip to content

Instantly share code, notes, and snippets.

@0xjams
0xjams / blackboard_to_uees_converter.py
Created November 25, 2024 20:28
Convert grades from BlackBoard's gradebook to UEES internal format
import csv
import pandas as pd
import sys
import codecs
import re
def find_column(columns, pattern):
for col in columns:
if re.search(pattern, col):
return col
@0xjams
0xjams / student-score-filter.py
Created October 15, 2024 01:16
Get students with grades ge 40 and below 70
import csv
import sys
import re
def print_csv_info(file_path):
try:
with open(file_path, 'r', encoding='utf-8-sig') as csvfile:
dialect = csv.Sniffer().sniff(csvfile.read(1024))
csvfile.seek(0)
reader = csv.reader(csvfile, dialect)
@0xjams
0xjams / postman-deb.sh
Last active April 2, 2024 21:20 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2022 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
curlExists=$(command -v curl)
echo "Testing Postman version"
blueprint:
name: Door activated light (at night)
description: Turn the light on to brightness when door is open (depending on time interval)
domain: automation
input:
motion_entity:
name: Door Sensor
selector:
entity:
domain: binary_sensor
blueprint:
name: Motion activated (switches)
description: Turn the light on to brightness when motion is detected, depending on the selected time period, different brightness and turn-on time.
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
@0xjams
0xjams / namecheap_ddns_updater_pfsense.sh
Created October 29, 2019 16:01
Namecheap DDNS updater for pfsense, this one had to be updated for tcsh. Most public ones are written for bash
#!/bin/tcsh
# Shell script to update namecheap.com dynamic dns
# from a pfsense Firewall, had to be adapted from other bash solutions
set DOMAIN=''
set PASSWORD=''
set HOSTNAME=''
set EMAIL=''
set CACHED_IP_FILE='./namecheap_ddns_ip.txt'
@0xjams
0xjams / fix_wordpress.sql
Created August 29, 2018 12:23
Queries to update the base path after migrating Wordpress
UPDATE wp_options SET option_value = replace(option_value, 'http://old.domain/path', 'http://www.new.domain') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://old.domain/path','http://www.new.domain');
UPDATE wp_posts SET post_content = replace(post_content, 'http://old.domain/path', 'http://www.new.domain');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://old.domain/path','http://www.new.domain');
@0xjams
0xjams / unilink_times_highfield.py
Last active July 9, 2018 14:37
Queries the unilink website to get the schedule and to check when a specific bus will arrive.
adb -d shell pm grant com.nolanlawson.logcat android.permission.READ_LOGS
@0xjams
0xjams / disable_voicemail.sh
Created May 10, 2016 23:20
Kill voicemail notification
adb shell am force-stop com.android.phone