Skip to content

Instantly share code, notes, and snippets.

@mephir
mephir / gentoo
Created July 27, 2025 12:09
OrcaSlicer Gentoo distribution script
FOUND_GTK3=$(emerge -p x11-libs/gtk+:3 > /dev/null 2>&1 && echo "1" || echo '')
export REQUIRED_DEV_PACKAGES=(
dev-build/cmake
net-misc/curl
sys-apps/dbus
gui-libs/eglexternalplatform
kde-frameworks/extra-cmake-modules
sys-devel/gettext
dev-vcs/git
@mephir
mephir / Makefile
Last active April 25, 2025 14:31
Fib calc times
default: build
build: clean build-deps build-go build-c
clean: clean-deps clean-go clean-c
build-deps:
gcc -c fibAsm.S -o fibAsm.o
gcc -c fib.c -o fib.o
ar rcs libfib.a fib.o fibAsm.o
@mephir
mephir / traefik.yaml
Last active March 24, 2020 15:50
Traefik v2 default config file
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
traefik:
address: ":8080"
api:
dashboard: true

Change subent VMWare Player

vnetlib.exe -- stop nat
vnetlib.exe -- stop dhcp
vnetlib.exe -- set vnet vmnet8 mask 255.255.255.0
vnetlib.exe -- set vnet vmnet8 addr 10.10.0.0
vnetlib.exe -- set adapter vmnet8 addr 10.10.0.1
vnetlib.exe -- set nat vmnet8 internalipaddr 10.10.0.254
vnetlib.exe -- update dhcp vmnet8
vnetlib.exe -- update nat vmnet8
@mephir
mephir / aga.c
Created November 25, 2018 21:21
#include<stdio.h>
int wczytaj_float(float * liczba);
void idioto_ochrona_dla_D1(float * liczba);
int main() {
float lic;
idioto_ochrona_dla_D1(&lic);
printf("Liczba: %f\n", lic);
@mephir
mephir / aga.c
Last active October 21, 2018 21:18
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void wczytaj_wspolczynniki(int *tab);
void wczytaj_zakres_dziedziny(int *D1, int *D2);
void wczytaj_liczbe_wynikow(int *N);
void przebieg_funkcji(int *wspolczynniki, int D1, int D2, float *wyniki, int N);
int main () {
#include<stdio.h>
int * wczytaj_wspolczynniki() {
static int tab[4];
int i;
for (i = 0; i < 4; i++) {
printf("Podaj wspolczynnik %d: ", i + 1);
scanf("%d", &tab[i]);
}
#!/bin/bash
set -e
function clone {
if [ ! -z "$3" ]; then
cmd="git clone --depth=50 --branch=$3 git@github.com:$1.git $2"
else
cmd="git clone --depth=50 git@github.com:$1.git $2"
fi;
@mephir
mephir / git.md
Last active August 27, 2017 09:45
Working with GIT

Basic commands

  • git clone git@github.com:mephir/sf.git - cloning repository (create local repository)- svn equivalent: svn co/svn checkout
  • git fetch remote [[name of a branch 1] [name of a branch 2] ...] - command will download index from remote(fetch all changes) - no svn equicalent
  • git pull remote [[name of a branch 1] [name of a branch 2] ...] - command will download all changes from remote and merge them to our local branch(in our case github, name of the branch(es) is optional argument) branches separated with spaces - no svn equivalent
  • git push origin [[name of a branch 1] [name of a branch 2] ...] - command will send all changes to remote called origin (name of the branch(es) is optional argument, used only when we want send specify branch(es)) - no svn equivalent
  • git commit -a -m "message" - commit changes to local repository(message is mandatory) - svn equivalent: svn ci -m "message"
  • git branch - show all branches which exist in to local repository, the star i
@mephir
mephir / docker-aliases.sh
Created June 4, 2017 07:58
Docker bash aliases to ckeep it tidy
alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
alias docker_clean_ps='docker rm $(docker ps --filter=status=exited --filter=status=created -q)'
alias docker_clean_volumes='docker volume rm $(docker volume ls -qf dangling=true)'