Skip to content

Instantly share code, notes, and snippets.

View mjbear's full-sized avatar
💻
Pretty well preoccupied until Nov 2025

Michael Bear mjbear

💻
Pretty well preoccupied until Nov 2025
View GitHub Profile
@hobojoe1848
hobojoe1848 / what-week.py
Created February 17, 2025 00:29
What Week is it Script
from datetime import datetime
def get_current_week():
current_date = datetime.now()
current_week = current_date.isocalendar()[1]
print(f"Current week of the year: {current_week}")
if __name__ == "__main__":
get_current_week()
@xrobau
xrobau / extract.sh
Created April 7, 2024 23:11
Windows 10 SLIC and MSDM into Proxmox KVM
#!/bin/bash
# On the 'donor' machine, boot a live linux ISO (Ubuntu or whatever)
# and connect it to the internet. Then run these commands, which will
# dump the contents to sprunge.us so you can retrieve them easily. Or
# copy them manually, whatever.
mkdir -p /tmp/MSDM
cd /tmp/MSDM
for f in SLIC MSDM; do
@wd5gnr
wd5gnr / hackcurl.c
Created January 30, 2024 02:34
Simple libcurl example (uses autogenerated skeleton)
/********* Sample code generated by the curl command line tool **********
* All curl_easy_setopt() options are documented at:
* https://curl.se/libcurl/c/curl_easy_setopt.html
************************************************************************/
// Pick up Hackaday home page
#include <curl/curl.h>
@cseeman
cseeman / markdown_examples.md
Last active October 7, 2025 14:59
Markdown for info panel/warning box

Examples for how to create your own info panel, warning box and other decent looking notification in GitHub markdown.

All the boxes are single/two cell tables or two row tables.

Warning box

❗ You have to read about this
@arctic-hen7
arctic-hen7 / .dockershell.sh
Last active September 5, 2024 03:21
ZSH configuration for nice Docker shells in Alpine
# Note: for this to do anything, use my starter Dockerfile config (https://gist.github.com/arctic-hen7/10987790b86360820e2790650e289f0b)
# This file contains ZSH configuration for your shell when you interact with a container
# (we wouldn't want any boring `sh` now would we?)
# Please feel free to set up your own ZSH config in here!
# It gets mapped to your `.zshrc` for the root user in the container
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
@stevecondylios
stevecondylios / resize-image-in-github-issue-github-flavored-markdown.md
Last active June 17, 2025 10:15
How to Resize an Image in a Github Issue (e.g. Github flavored Markdown)

How to Resize an Image in Github README.md (i.e. Github Flavored Markdown)

Percentage:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width=50% height=50%>

Pixels:

<img src="https://user-images.githubusercontent.com/16319829/81180309-2b51f000-8fee-11ea-8a78-ddfe8c3412a7.png" width="150" height="280">

<domain type='kvm' id='254'>
<name>PE-1-SR</name>
<uuid>af76b9d5-8bab-4156-b013-ec00968117f9</uuid>
<description>Timos VM</description>
<memory unit='GiB'>6</memory>
<currentMemory unit='GiB'>6</currentMemory>
<vcpu placement='static'>2</vcpu>
<resource>
<partition>/machine</partition>
</resource>
@timothymugayi
timothymugayi / tqdm_threadpool.py
Created December 6, 2019 15:37
How to run tqdm in multiple threads
import time
from random import randrange
from multiprocessing.pool import ThreadPool
from tqdm import tqdm
def func_call(position, total):
text = 'progressbar #{position}'.format(position=position)
@robderickson
robderickson / RunAsExplorer.md
Created October 8, 2019 19:20
How to enable 'Run as a different user' for Explorer.exe
  1. Run regedit.exe elevated.
  2. Take ownership of HKEY_CLASSES_ROOT\AppID{CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}.
  3. Rename the RunAs value to _RunAs.
  4. Create a new shortcut on your Desktop for C:\Windows\System32\runas.exe.
  5. Name it something like Admin-Explorer.
  6. Right-click the new shortcut and click Properties.
  7. Change the target to: C:\Windows\System32\runas.exe /noprofile /user:<domain>\<username> "c:\windows\explorer.exe /separate"
  8. (Optional) Change the icon.
  9. (Optional) Pin to taskbar.
@bitsurgeon
bitsurgeon / youtube.md
Last active October 7, 2025 03:03
Markdown cheatsheet for YouTube

Embed YouTube Video in Markdown File

  1. Markdown style
[![Watch the video](https://img.youtube.com/vi/nTQUwghvy5Q/default.jpg)](https://youtu.be/nTQUwghvy5Q)
  1. HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">