Skip to content

Instantly share code, notes, and snippets.

View vagelim's full-sized avatar

vagelim vagelim

View GitHub Profile
@vagelim
vagelim / ut2004-key-gen.py
Created October 16, 2024 22:30 — forked from computerquip/ut2004-key-gen.py
UT2004 Key Generator Bottle App
from bottle import default_app, route
import hashlib
import ctypes
import secrets
# Copyright (c) 2005-2023, NumPy Developers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@vagelim
vagelim / add-team-to-repos.sh
Created May 23, 2024 18:19
add team to all repos in a github org
export ORG=<organization-name>
export PERMISSION=<admin|push|pull>
export TEAM_SLUG=<team-name-in-url>
gh repo list ${ORG} --limit 1000 | awk '{print $1}' | while read -r OWNED_REPO
do
gh api --method PUT \
-H "Accept: application/vnd.github.v3.repository+json" -H "X-GitHub-Api-Version: 2022-11-28" \
/orgs/${ORG}/teams/${TEAM_SLUG}/repos/${OWNED_REPO} -f permission=${PERMISSION}
done
@vagelim
vagelim / wol.sh
Created January 10, 2023 17:39
nc for wol
#!/bin/bash
#replace MAC value with NIC MAC
MAC=11:22:33:44:55:66
echo -e $(echo $(printf 'f%.0s' {1..12}; printf "$(echo $MAC | sed 's/://g')%.0s" {1..16}) | sed -e 's/../\\x&/g') | nc -w1 -u -b 255.255.255.255 4000
# from https://stackoverflow.com/questions/31588035/bash-one-line-command-to-send-wake-on-lan-magic-packet-without-specific-tool
@vagelim
vagelim / PythonSimpleWebsocket
Created January 12, 2021 08:06 — forked from rich20bb/PythonSimpleWebsocket
Simple websocket server in Python. Echos back whatever is received. Works with Chome, Firefox 16, IE 10.
import time
import struct
import socket
import hashlib
import base64
import sys
from select import select
import re
import logging
from threading import Thread
@vagelim
vagelim / export_google_music.js
Created August 10, 2020 15:07 — forked from dcalacci/export_google_music.js
Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Jeremie Miserez <[email protected]>, 2015
//
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
//
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music
//
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist)
//
// 2. Open a developer console (F12 for Chrome). Paste
// code below into the console.
@vagelim
vagelim / deploy_to_s3.yaml
Created July 15, 2020 15:09
github action to deploy to s3 static site and flush cf
name: Deploy and flush cache
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
@vagelim
vagelim / TrueColour.md
Created June 23, 2020 14:52 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@vagelim
vagelim / Makefile
Created May 15, 2020 20:19 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@vagelim
vagelim / smc_read.c
Created April 19, 2020 19:20
returns secret osk needed to run macos hackintosh
/*
* smc_read.c: Written for Mac OS X 10.5. Compile as follows:
*
* gcc -Wall -o smc_read smc_read.c -framework IOKit
*/
#include <stdio.h>
#include <IOKit/IOKitLib.h>
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({