Skip to content

Instantly share code, notes, and snippets.

View daerich's full-sized avatar
👁️
Carefully watching

DaErich daerich

👁️
Carefully watching
  • Lucent Division
  • leaq %rax, Germany(%rip),
View GitHub Profile
@daerich
daerich / autoexec.cfg
Last active July 13, 2019 13:31
My autoexec
//launchoptions: -console -novid -language bananagaming/english -tickrate 128 -nojoy +exec autoexec.cfg
//by DaErich
//viewmodel
viewmodel_fov "70"
viewmodel_offset_x "1"
viewmodel_offset_y "2"
viewmodel_offset_z "-1.5"
viewmodel_presetpos "4"
cl_viewmodel_shift_left_amt 0
cl_viewmodel_shift_right_amt 0
@daerich
daerich / concat.sh
Last active January 14, 2021 12:47
Useful pdf concat using ghostscript
#!/bin/bash
#from https://stackoverflow.com/questions/48136770/merge-pdf-files-by-string-in-filename-using-ubuntu-terminal
#append '-q' switch to silence gs
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out.pdf input*.pdf
@daerich
daerich / daerichs.theme
Created January 18, 2021 15:55
My ZSH theme
#Load promptinit (thanks archers :D)
autoload -Uz promptinit && promptinit
prompt_daerichstheme_setup(){
PS1="%B%F{green}%n%f%F{red}::%f%F{green}%m%f %F{cyan}%~ %#%f%b :"
RPS1="[%F{yellow}%N%f]"
}
# promptsys_init
prompt_themes+=( daerichstheme )
@daerich
daerich / bash_prompt.txt
Created April 11, 2021 00:45
My bash_prompt
\[\033[0;32m\]<\u\[\033[0;31m\]::\[\033[0;32m\]\h\[\033[1;34m\] \W \$\[\033[0;32m\] > \[\033[0m\]
@daerich
daerich / stdin.c
Last active May 20, 2021 15:54
read from stdin(my own template)(may be horrible)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static char* addread(char* buf,char r, int length){
char * res=malloc((length+1) * sizeof(char));
if(res == NULL){
fprintf(stderr,"Malloc Error\n"); /* Quit on malloc*/
exit(1);
@daerich
daerich / procparse.c
Last active June 28, 2021 11:17
Parse proc directory
/* BEGIN Cue */
#include <std{io,lib}.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <unistd.h>
static int in_numbers(char *);
static int check_by_slsh(char*,char*);
static void check_proc(char*,char*,char*);
@daerich
daerich / .vimrc
Last active August 6, 2021 20:33
Vim RunCommands
source $VIMRUNTIME/defaults.vim
:function PythonEnt(isnf,lang)
:let l:filen = expand("%:p")
:if a:lang == "Py"
:if len(glob("*.py",0,1)) <= 1 && !a:isnf
\&& filewritable(filen)
\&& getfsize(filen) == 0
:call setline(1,"#!/usr/bin/env python")
@daerich
daerich / binarycalc.py
Created October 30, 2021 16:19
rough impl or base10 to any base calculation ignoring sign
#!/usr/bin/env python
import sys
# Can't do 2 complement :C
res=None
quot=int(sys.argv[1])
base=int(sys.argv[2])
resstr=""
while quot != 0:
res = quot % base

DaErich's OpenBSD checklist

  • Add user to network group(wireless networking)
  • Configure tapping and brightness with wsconsctl
  • wpa_supplicant for EAP
  • Set apmd to -A
  • pkg_add -l
  • mount_mfs and chmod /tmp 1777 (tmpfs is bugged/disable on OpenBSD)
@daerich
daerich / .config
Created December 5, 2021 23:00
Kernel dotconfig
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.15.6 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (GCC) 10.2.1 20201203"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=100201
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23501