Skip to content

Instantly share code, notes, and snippets.

View gubiithefish's full-sized avatar
💭
🚀 Keeps pushing the limit and breaking the boundaries

Emil Reinert gubiithefish

💭
🚀 Keeps pushing the limit and breaking the boundaries
View GitHub Profile
@gubiithefish
gubiithefish / unescape_html.py
Last active August 22, 2018 11:37
A small code for escaped html files which unescapes and moves them to another folder.
import html
import io
import os
from_dir_path = 'C:\\Users\\gubii\\Desktop\\testmappe\\txt\\Michael\\' #AlleFilerSkalLiggeHer
to_dir_path = 'C:\\Users\\gubii\\Desktop\\testmappe\\txt\\Michael2\\'
for files in os.listdir(from_dir_path):
file = open(from_dir_path + files, encoding="utf8")
text = file.readlines()
@gubiithefish
gubiithefish / Template - Diagnostics Report.md
Created November 30, 2020 10:59
Template for creating a diagnostics report - I use it every time I have a kernel panic in macOS

Automatic advanced systems diagnostics in Mac OS X.

To run the advanced systems diagnostics in Mac OS X.

  1. launch Terminal
  2. type the following command string: sudo sysdiagnose -f ~/Desktop/

The file generated can range from 5MB to 900MB, and is a tar gzip called “sysdiagnose_(date_).tar.gz”. Extracting the tar ball will reveal many files containing system reports, a system_profiler dump, and the output gathered from tons of different terminal commands, ranging from kextstat, to iotop and fs_usage, to vm_stat, and many others.

Manual less advanced systems diagnostics report

Table of content

@gubiithefish
gubiithefish / twitter_history_search.r
Created April 9, 2021 22:15
Recursive twitter full_search
# Based on: https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/master/Full-Archive-Search/full-archive-search.r
# API reference : https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all#tab1
library(httr)
# SETUP
#################
### Create a function for calling the API, which is cleaner to make as a function, as we will be calling it several times
history_search <- function(){
return(httr::GET(url = 'https://api.twitter.com/2/tweets/search/all', httr::add_headers(.headers=api_headers), query = api_params))
#!/usr/bin/env bash
#
# Inspiration sources:
# - https://gist.github.com/MatthewMueller/e22d9840f9ea2fee4716
# - https://github.com/why-jay/osx-init/blob/master/install.sh
# - https://medium.com/macoclock/automating-your-macos-setup-with-homebrew-and-cask-e2a103b51af1
# - https://gist.github.com/codeinthehole/26b37efa67041e1307db
# - https://installvirtual.com/how-to-install-python-3-10-on-mac-using-brew/
#
#
@gubiithefish
gubiithefish / CreateMontereyISO.sh
Created April 6, 2022 21:03
Create macOS 12.3.1 Monterey ISO for Virtual machines
softwareupdate --fetch-full-installer --full-installer-version 12.3.1
sudo hdiutil create -o /tmp/Monterey -size 16384m -volname Monterey -layout SPUD -fs HFS+J
sudo hdiutil attach /tmp/Monterey.dmg -noverify -mountpoint /Volumes/Monterey
sudo /Applications/Installer\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey --nointeraction
hdiutil detach -force '/Volumes/Install macOS Monterey'
hdiutil convert /tmp/Monterey.dmg -format UDTO -o ~/Desktop/macos-monterey
mv ~/Desktop/macos-monterey.cdr ~/Desktop/macos-monterey.iso
sudo rm -fv /tmp/Monterey.dmg
#source: