Skip to content

Instantly share code, notes, and snippets.

@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)'
....
........ .
. .
. .
......... .......
..............................
Elephant inside ASCII snake
@mephir
mephir / backup.sh
Last active August 29, 2015 14:02
Database backup
#!/bin/bash
usage="Usage `basename $0` [--help] [[-c -u -p -h -o] n] -- script are dumping mysql database via mysqldump
where:
-u database user name (default: "")
-p database user password (default: "")
-h database hostname (default: "localhost")
-o output directory (default: "/var/backup/$dbname/"
-c compress output (default: true)