Skip to content

Instantly share code, notes, and snippets.

@n3st0r
n3st0r / dllogin
Created October 19, 2021 02:46 — forked from lauer/dllogin
DLink rancid module Remember to add the following line to rancid-fe (and a , on the line before) 'dlink' => 'dlrancid', This is tested on a DGS-3427
#! /usr/bin/expect --
##
## patched to accomplish fortinet from nlogin
## in turn patched to accomplish D-Link from fnlogin
## by: Daniel G. Epstein <dan at rootlike.com>
## adapted by: Diego Ercolani <diego.ercolani at ssis.sm>
## further adapted by: Gavin McCullagh <gavin.mccullagh at gcd.ie>
##
## rancid 2.3.6
## Copyright (c) 1997-2009 by Terrapin Communications, Inc.

Install brew

Install minikube

brew install minikube

Configure minikube

If you set the driver to hyperkit, when creating a new cluster (--start), the minikube will check and possibly install the necessary driver for hyperkit.

@n3st0r
n3st0r / gist:aa6b2ef8db92bd216a69d621d5c85df7
Created December 8, 2017 13:52 — forked from bortzmeyer/gist:1284249
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@n3st0r
n3st0r / ResizeFs.md
Created June 22, 2017 09:05
Zmiana rozmiaru partycji w Linux

ZRÓB KOPIĘ BEZPIECZEŃSTWA PRZED!!!!!!!!!!!!!!!!!!

To jest poradnik dla mnie, jeśli z tego korzystasz, robisz to na własną odpowiedzialność!

Zmiana rozmiaru partycji extended z wolumenem logicznym

Polecenie fdisk domyślnie wyświetla jednostki w sektorach, wolę to jasno wpisać, aby nie mieć problemy w przypadku alternatywnego wuświetlania w cylindrach.

fdisk -u=sectors /dev/vda
@n3st0r
n3st0r / ceph-mini-handbook.md
Last active May 6, 2019 18:53
Podręczny spis komend do administracji ceph w Proxmox

Status klastra ceph

Szybki podgląd stanu klastra ceph.

ceph status
# lub
ceph -s

W przypadku clock skew detected on mon.X zacznij od prawidlowej konfiguracji ntp!

Online status

Ponizsze polecenia wyswietla status klastra cepf, a nastepnie "wykonuje" tail -f na logach

Użyj xz zamiast gz

Zainstaluj pakiet xz-utils:

apt install xz-utils

Nastepnie, do pliku /etc/logrotate.conf należy dodać poniższe linie, aby uzyskać kompresję xz zamiast gzip:

compress
compresscmd /usr/bin/xz
@n3st0r
n3st0r / debian-pakiety.md
Last active June 20, 2017 16:04
Obsługa pakietow w systemach Debian

Polecenie dpkg

Wylistowanie wszystkich pakietów

dpkg -l
dpkg -l | grep *nazwa*

Sprawdzenie do którego pakietu należy dany plik.

dpkg -S plik

Moja ściąga dla postgreSQL'a

Tworzenie użytkownika z wieloma uprawnieniami:

CREATE ROLE użytkownik WITH LOGIN ENCRYPTED PASSWORD 'hasło' CREATEDB CREATEROLE REPLICATION SUPERUSER;

Kasowanie użytkownika/roli

DROP ROLE użytkownik;

Programy pomocnicze postgres'a: psql i inne

Łączenie do bazy danych

Podłączenie administracyjne z poziomu odpowiednio (su|sudo) uprzywilejowanego użytkownika

sudo -u postgres psql postgres
# lub
su -l postgres -c psql postgres

Podłaczanie do bazy

smartmontools

Install

apt install smartmontools

Drive Status

smartctl -a /dev/sda