This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Changes headset profile between A2DP and HFP | |
| # | |
| set -x | |
| A2DP_PROFILE=a2dp_sink | |
| HFP_PROFILE=handsfree_head_unit | |
| HEADSET_CARD=<card name you can get by doing pactl list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| from datetime import datetime | |
| from pathlib import Path | |
| import exif | |
| def rename_by_exif(path): | |
| meta = exif.Image(path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Snippet from https://askubuntu.com/questions/730754/how-do-i-show-the-git-branch-with-colours-in-bash-prompt/730758 | |
| # Add git branch if its present to PS1 | |
| parse_git_branch() { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| if [ "$color_prompt" = yes ]; then | |
| PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' | |
| else | |
| PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // To view the default settings, hold "alt" while clicking on the "Settings" button. | |
| // For documentation on these settings, see: https://aka.ms/terminal-documentation | |
| { | |
| "$schema": "https://aka.ms/terminal-profiles-schema", | |
| "defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", | |
| "profiles": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MIT License | |
| Copyright (c) 2018 Noel Bundick | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Python.h> | |
| /***********************************************************/ | |
| /* define logging function and logtypes for python.logging */ | |
| /* by H.Dickten 2014 */ | |
| /***********************************************************/ | |
| enum logtypes {info, warning, error, debug}; | |
| static void log_msg(int type, char *msg) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This instruction is for Unix-like OS users. | |
| # I refered to the following guide when I wrote it. | |
| # https://conda.io/docs/user-guide/tasks/build-packages/recipe.html | |
| # Activate an environment if needed | |
| conda activate myenv | |
| # Install conda-build if you haven't. Ironically, installing conda-build | |
| # includes installing python. This python will be effectively replaced with | |
| # your new python binary so don't worry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| minikube stop; minikube delete && | |
| docker stop $(docker ps -aq) && | |
| rm -rf ~/.kube ~/.minikube && | |
| sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube && | |
| launchctl stop '*kubelet*.mount' && | |
| launchctl stop localkube.service && | |
| launchctl disable localkube.service && | |
| sudo rm -rf /etc/kubernetes/ && | |
| docker system prune -af --volumes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| A utility to extract email attachments | |
| """ | |
| import os | |
| import sys | |
| import email | |
| import argparse | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Run a cli command, and show its io statistics, like so: | |
| $ processio.py cat input.txt | |
| Note that you would usually have to run this with sudo, since in most systems | |
| the ownership of a process /proc after the subprocess dies transfers to root | |
| """ | |
| import sys |
NewerOlder