Skip to content

Instantly share code, notes, and snippets.

View octokas's full-sized avatar
:electron:
Code Never Sleeps

Kaska Miskolczi octokas

:electron:
Code Never Sleeps
View GitHub Profile
@dmattera
dmattera / man_page_parser.py
Created January 3, 2023 02:31
man_page_parser.py
import os
def parse_man_file(man_filepath):
with open(man_filepath, "r") as man_file:
lines = man_file.read().split("\n")
formatted_lines = []
for line in lines:
# remove Apple developer comments included on the same line and strip off trailing white space
@octokas
octokas / git-pull-all
Created October 9, 2021 12:15 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@dmattera
dmattera / launchctl_man_pages.md
Last active August 22, 2025 16:48
macOS man page entries for launchctl services

This list was auto-generated on macOS 10.15 (Catalina) using a script that did the following:

  1. grabbed the name of all the .plist files located in the 5 folders used by launchctl:
  • ~/Library/LaunchAgents Per-user agents provided by the user.
  • /Library/LaunchAgents Per-user agents provided by the administrator.
  • /Library/LaunchDaemons System wide daemons provided by the administrator.
  • /System/Library/LaunchAgents OS X Per-user agents.
  • /System/Library/LaunchDaemons OS X System wide daemons.
@octokas
octokas / Bash alias
Created April 15, 2021 03:41 — forked from canonw/Bash alias
Bash alias
# curl https://gist.github.com/canonw/d2b8f0a0c10d9a71be3f53f69d3c94b9/raw -o "$HOME/.kwbash_aliases"
case "$OSTYPE" in
linux*) # "Linux / WSL" ;;
THISOS="linux"
if [ -f /etc/redhat-release ] ; then
THISDIST=`cat /etc/redhat-release |sed s/\ release.*// | awk '{print $1;}' | tr '[:upper:]' '[:lower:]'`
# PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
THISOSREV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/SuSE-release ] ; then
@octokas
octokas / git-aliases.md
Created March 21, 2021 21:12 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
version: "3.4"
services:
deconz:
image: marthoc/deconz
container_name: deconz
network_mode: host
restart: always
volumes:
- /home/pirate/.local/share/dresden-elektronik/deCONZ:/root/.local/share/dresden-elektronik/deCONZ
@Jblew
Jblew / Sh
Last active January 24, 2022 11:51
Sh
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${DIR}"
@phaistonian
phaistonian / gpr.sh
Created January 26, 2021 09:04
alias gpr="sh gpr.sh"
#! /bin/bash
set -e
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REMOTE=$(git remote get-url origin)
URL="$REMOTE/compare/$BRANCH?expand=1";
if [ "$BRANCH" = "master" ]
then
echo You must checkout a feature branch first
@jbrown-xentity
jbrown-xentity / full-metadata-link-dcat-us-example.js
Last active July 9, 2021 14:04
full-metadata-link-dcat-us-example.js
@sarkrui
sarkrui / .zshrc
Last active April 15, 2021 03:46
My exclusive zsh alias
#Aliases
#Alias for uPic application
alias upic='/Applications/uPic.app/Contents/MacOS/uPic'
#Check if gif_temp existence and upload if true, and copy generated url link to clipboard
alias ugif='
file=~/Desktop/gif_temp.gif;
if [ -e "$file" ]; then
echo "File exists";