Articles:
Guides/tutorials from Pufka are auto exported. These are marked with a # prefix.
#Colors in Ncurses:
0. For any color operation Đstart_color()Đ must be called: start_color(); 8-bit: For displaying 8 bit colors, Ncurses works with so called Đcolor-pairsĐ. Color-pairs must be defined/"initialized" before usage a
#How to get the mimetype of a file in C:
// @BAKE gcc $@ -o $*.out -lmagic #include#include // for NULL magic_t my_mimetype_reader; signed main(int argc, char * argv[]) { if (argc != 2) {
#Spring Gateway Hello World:
1. Set up dependencies -gateway is all we need: spring-cloud-starter-gateway -NOTE: in case you missed it during initialization, this is how it would look like under gradlew: { dependencies { implementati
#Resize "Hello World" in NCurses:
>ncurses is very moody about SIGWINCH, more specifically some terminal emulators will not update their terminfo correctly if its handled, while in others interrupting getch causes it to return the error code ERR >NOTE: B
#SDL2 Hello World:
{ // sdl_hw.c // @COMPILECMD gcc $@ -o sdl_hw.out -Wall -Wpedantic $(pkg-config --cflags --libs sdl2) #includesigned main(int argc, char* argv[]) { SDL_Init(SDL_INIT_VIDEO); SDL_Window* window = SDL_Cre
#Renaming partitions under Linux:
>ie. giving the partition a new label >the following commands all rename a specific kind of partition of a device to [name] swaplabel -L "[name]" [partition] : swap e2label [partition] "[name]" : ext2, ext3 or ext4 b
#Managing git conflicts (with Vim):
-git will place a ĐĐconflict markerĐĐ into a conflicting file: { <<<<<<<======= >>>>>>> } {// make sure to set the foll
#Decision tree for combinatorics:
Is order important? ├── yes ── Do I have to use up ever element? │ ├── yes ── "Permutation" │
#Using mysql as a normal user:
>since sql uses an inner system for identifying users a few hoops must be jumped >root is always preregistered 1. Log in as root sudo mysql 2. Create a new user CREATE USER '[your_name]'@'localhost' IDENTIFIED BY '[p
#Guide to Python Venvs:
>"Virtual ENVironment" >a venv is a self contained python installation >they help to avoid system pollution >guarantee a state which has no dependency conflicts >there is a built in "venv" module 1. Creation >the entirety
#Simple example to gdb pretty printer:
1. Assume the following type in C { typedef struct { int i; } hello_world_t; // and an exampolary instance hello_world_t my_hw; } >NOTE: compiling with debugging information is required (-ggdb un
#ACTUALLY simple tensorflow example:
{@begin=python@ #!/bin/python3 import numpy as np from tensorflow import keras # --------------- # --- Dataset --- # --------------- #NOTE: thi
#Wide char support in Ncurses:
//all credits to Ray "Bear" Dillinger 1. Right System Locale: You have to be using a UTF-8 locale (Mine is en_US.UTF-8; I imagine others will have different choices). Type ‘locale’ at a shell prompt to be sure.
#Set up key only auth for SSH:
XXX: >basic knowledge of public key cryptography >the server holds a public key, while the client has a private key which it will use for authentication >this way we both protect from brute forcing attacks and optionall
#Arch instalation guide:
+ this will leave you with a usable system + this guide assumes a cabled internet connection + the real redpill is that arch installation never ends + NOTE: read all the way through before starting 1. In the BIOS enable U
#Site rendering for dummies:
{// examples >the goal is the same with each methodology >we have data.txt >it contains key-value pairs ¤its generated with this script { @begin=sh@ #!/bin/bash # generator.sh OUTPUT="data.txt"
#The most minimalistic JPA||REST example with spring:
{ // --- AnimalRepository.java --- /* By using the Farm package here, * we make the contents of * FarmApplication.java visible */ package com.example.Farm; import org.springframework.data.jpa.repository.Jpa
#Making bootable USBs:
1. Download a bootable .iso image 2. Format the drive with a filesystem that is compatible with your image (should be stated on the download side; FAT is always a safe bet however) 3. Copy the image to the drive >NOT
#Setting up a Virtualbox shared folder:
1. Start up the guest machine 2. Install "guest additions" >lauch the virtual machine click "Devices/Insert Guest Additions CD image..." (on the top bar) >run the contents of the CD 3. Configurate >in the main menu click
#How to Set Up a Hidden (Tor) Service:
>insanely easy, especially compared to conventional web hosting 1. Have a service running >this can be any service >write down what port its running on, this address will be referenced BELOW as>for testing
Tilde_home_is_the_worst_Bash_feature:
Bash defines the sequence "~[user]" to expand to the home directory of [user], where the current one is the default user.
For example:
~ -> your home directory ~root/ -> roots home directory
#Everything wrong with the modern webstack:
// NOTE: this is a WIP draft On one occasion I casually insulted HTML/CSS/Javascript mid sentence, only to be called out to explain my position. Before that moment I thought their poor q
IRC_for_zoomers:
The ultimate IRC guide for zoomers
Listen kid, we don't have much time left. Globohomo is closing up around us, so it's absolutely critical that you listen to me. I know you love your gay mobile messaging apps and I'm sorry that I have to b
#Scanning a string with Flex:
There's the stackoverflow solution, using a conviniently named and easy to discover function: { // Minimalistic lexer reading from a string with yy_scan_string() /* @BAKE flex -o scan_string.yy.c $@ gcc -o scan_string
#Formating under Linux:
1. Making a partition table fdisk : modifies filesystems cfdisk : pseudo graphical version of fdisk 2. Creating a filesystem mkfs.[filesystem] [partition] btf btrfs cranfs ext2 ext3
#How to use GNU Readline with Ncurses:
//@BAKE g++ $@ $(pkg-config --cflags --libs ncurses readline) #include#include #define WINDOW_WIDTH 32 #define WINDOW_HEIGHT 3 int scr_h, scr_w; WINDOW* myWindow; in
#Git fails to clone||push||pull from my hidden (onion) service:
{ @begin=sh@ $ [proxychains|torify] git clone http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.onion/anon/test.git Cloning into 'test'... fatal: unable to access 'http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
#Having a std::string (or any arbitrary type) in Bisons yylval:
>the key is knowing that %code takes an optional location qualifier >"requires" will place our definition providing headers high enough, that they are above the yylval union, unlike standard code blocks and default %code d