Skip to content

Instantly share code, notes, and snippets.

@redxef
redxef / create-sublime-project.sh
Created December 21, 2016 12:25
Creates a project folder for developing in C with Sublime Text 3 project file and makefile
#!/bin/sh
##
# @file create-sublime-project.sh
# @version 1.0
# @author redxef
# @brief Creates a project folder for developing a c application using Sublime Text 3 and a makefile
#
# The script automatically generates a makefile with the listed dependencies and the option to manually add compiler flags.
# Secondly a Sublime project file is generated, with all include directories add for easy integration with

Howto, install Arch with EFI boot

1. What you'll need

  • Arch-Linux live Image download
  • VirtualBox + Extension Pack download
  • A USB KEY for Arch Linux This device will be formatted, back up any data left on it
  • The knowledge to use the terminal/command line

*All instructions have been taken form the Arch wiki link

@redxef
redxef / windows-install-instructions.md
Last active September 10, 2017 17:26
This document contains instructions on how to install windows on an external drive, when no other windows version is available. This document is not complete and may contain errors.
CC := gcc
LD := gcc
CFLGS := -g -Wall
LFLGS :=
FILEN := main
# LDIRS ... directories which contain library files
# IDIRS ... include directories (header locations)
# LIBS ... libraries to link against
# PKGS ... include dirs, library dirs and libraries which should be resolved via pkg-config
root = true
[**]
end_of_line = lf
inser_final_newline = true
charset = utf-8
indent_style = space
indent_size = 8
trim_trailing_whitespace = true
max_line_length = 72
@redxef
redxef / makefile
Created April 12, 2018 06:05
A makefile for single file libraries in c. The filename is the name of the library and its c source file without any extensions or prefixes.
BUILDTYPE ?= debug
TARGET ?= linux
FILENAME := FILLTHISIN
LIBNAME := lib$(FILENAME).so
CC := clang
CDFLAGS := -g -Wall -Wpedantic -Wextra
CRFLAGS := -Wall -Wpedantic -Wextra -O3
ifeq ($(BUILDTYPE), debug)
brew install shntool cuetools
shnsplit -o flac -f *.cue *.flac

cuetag .cue split-track.flac

@redxef
redxef / tortoggle.sh
Created July 20, 2018 10:26
Switches between a tor network service in macOS and other services, while simultaniously starting tor.
#!/usr/bin/env python3
import sys
import subprocess
import getopt
import shlex
import time
# known issues:
# Copy this function into your ~/.bashrc file to make the clipboard work in the WSL.
# This is not beautiful or encouraged, but gets the job done.
pass() {
if [[ "$1" = '-c' ]] || [[ "$1" = '--clip' ]]; then
$(which pass) "$2" | head -n1 | clip.exe
[[ -f ~/.pass-clr-pid ]] && kill "$(cat ~/.pass-clr-pid)"
((sleep 45 && echo '' | clip.exe) && rm ~/.pass-clr-pid) &
local pid=$!
echo "$pid" > ~/.pass-clr-pid
else
#!/usr/bin/env python3
##
# @file epub-edit.py
# @author redxef
# @since 2019-01-04
#
# @brief Edit metadata of epubs like i like it.
##