Skip to content

Instantly share code, notes, and snippets.

View timkofu's full-sized avatar
💭
💭

Timothy Makobu timkofu

💭
💭
View GitHub Profile
@timkofu
timkofu / check_mail.py
Last active August 19, 2024 10:16
Do I have mail?
https://makobu.name/posts/check_mail/
@timkofu
timkofu / install_facetimehd_driver.sh
Last active April 19, 2024 12:38
Linux FacetimeHD Driver Install.
#!/bin/bash
# Ref: https://gist.github.com/johnjeffers/3006011ec7767a4101cdd118e8d64290
# status: working
WORKING_DIRECTORY=$HOME/Downloads/facetimehd_driver
if [ ! -d "$WORKING_DIRECTORY" ]; then
mkdir "$WORKING_DIRECTORY"
fi
@timkofu
timkofu / test_coverage_elif_branching.py
Created September 23, 2022 10:42
Test coverage.py elif branching.
## requirements.pip
# pytest
# pytest-cov
# black
## .coveragerc
# [run]
# branch = True
# [report]
# skip_covered = True
@timkofu
timkofu / pf.conf
Last active March 1, 2022 12:34
FreeBSD transparent proxy with PF + Squid
# Squid should be intercepting on port 2600
# A cachaing dns server should be running on this box, with squid and clients all resolving through it.
# FreeBSD 9.2 RELEASE + Squid 3.3.9 from ports
# Timothy Makobu, 2013
# Variables
admin_if = "igb0"
external_if = "igb1"
intraservices = "{ 22, 2600, 53 }"
forward_ports = "{ 443, 465, 6667, 22, 587, 5938, 2083, 2082, 2095, 2096, 5242, 4244, 5243, 9785 }"
@timkofu
timkofu / pom.xml
Created August 11, 2021 10:11
Minimal Maven configuration that will generate a working Jar.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>name.makobu.project</groupId>
<artifactId>project</artifactId>
<version>0.1.0</version>
<name>project</name>
# Date: 13/07/2021
# Author: @timkofu
# Description: GitHib Copilot test drive
from typing import Callable
import big_o # https://pypi.org/project/big-O/
def sorter(sorter: Callable[[list[int]], list[int]], range: int) -> str:
import os
import time
import json
from typing import Union
from datetime import datetime
from argparse import ArgumentParser, Namespace
import tweepy
class UniqueItems(list):
def append(self, item):
if item not in self:
super(UniqueItems, self).append(item)
import random
from wordcloud import WordCloud
import matplotlib.pyplot as plt
word_cloud_text = []
for word in ['Rust','Go','Java','C++', 'Erlang','D', 'Python']:
for _ in range(random.randint(1000, 10000)):
word_cloud_text.append(word)
#!/bin/bash
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U