Aug 8 2020

Mount partition and chroot in rescue mode

Run linux from Linux Live (debian.ubuntu, slackware tec.)

Determine what is your main partition

fdisk -l

Example output:

Disk /dev/md2: 9.77 GiB, 10495328256 bytes, 20498688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/md3: 221.88 GiB, 238236860416 bytes, 465306368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/md1: 9.77 GiB, 10495328256 bytes, 20498688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/md0: 3.91 GiB, 4203020288 bytes, 8209024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

create mount point and mount root partition

mkdir /mnt/md0

mount /dev/md0 /mnt/md0

Mount the necessary file system directories by running the following commands:

mount -t proc /proc /mnt/md0/proc

mount –rbind /sys /mnt/md0/sys

mount –rbind /dev /mnt/md0/dev

Mount /usr and /var partition if necessary

mount /dev/md1 /mnt/md0/usr

mount /dev/md2 /mnt/md0/var

Chroot to md0

chroot /mnt/md0

Dec 21 2018

Wrong time when booting Linux Mint and Windows 10

timedatectl set-local-rtc 1
Dec 20 2018

Windows 8 – Instalacja bez klucza

Otwieramy pendrive instalacyjny z systemem ,wchodzimy do katalogu Sources i tworzymy plik ei.cfg

W plik ei.cfg wpisujemy:

(dla wersji Windows 8 Pro)

[EditionID]
Professional
[Channel]
Retail
[VL]

Dla zwykłego Windows 8 wpisujemy:

[EditionID]
Core
[Channel]
Retail
[VL]

Nov 16 2018

nvidia on linux – new kernel

If you installed a new kernel, it is possible to even reconfigure the kernel module with the new driver. To do this, run the following command in the terminal:

sudo dpkg-reconfigure nvidia-390

Sep 14 2018

force debug on CakePHP

add forceEnable config into your config/bootstrap.php

if (Configure::read('debug')) {
    Configure::write('DebugKit', ['forceEnable' => true]);
    Plugin::load('DebugKit', ['bootstrap' => true]);
}

in config/app.php
in option "Datasources": create new sub option like this:
'debug_kit' => [
        'className' => 'Cake\Database\Connection',
        'driver' => 'Cake\Database\Driver\Mysql',
        'persistent' => false,
        'host' => DB_HOST,
        'port' => DB_PORT,
        //'port' => 'non_standard_port_number',
        'username' => DB_ACC,
        'password' => DB_PASS,
        'database' => DB_NAME,
        //'encoding' => 'utf8mb4',
        'timezone' => 'UTC',
        'flags' => [],
        'cacheMetadata' => true,
        'log' => false,'quoteIdentifiers' => false,
        'url' => env('DATABASE_URL', null),
    ]
upgrading debugKit
composer require --dev cakephp/debug_kit "~3.16.6"

loading debugKit
bin/cake plugin load DebugKit

Jul 19 2018

Certbot free SSL certs

For apache

sudo certbot –authenticator webroot –installer apache –webroot-path <path to served directory> -d <domain>

0 0,12 * * * /opt/certbot/bin/python -c ‘import random; import time; time.sleep(random.random() * 3600)’ && /usr/bin/certbot renew -q

just get a certificate with apache running

sudo certbot certonly --apache

just get a certificate (stop apache first)

sudo certbot certonly --standalone

just get a certificate on Slackware

sudo certbot certonly --apache --apache-server-root /etc/httpd --apache-vhost-root /etc/httpd/sites-enabled --apache-challenge-location /etc/httpd -d rotmanka.pl,www.rotmanka.pl

revoke a cetificate

sudo certbot revoke --cert-path /etc/letsencrypt/live/rotmanka.pl/fullchain.pem

Saving debug log to /var/log/letsencrypt/letsencrypt.log

Would you like to delete the certificate(s) you just revoked, along with all
earlier and later versions of the certificate?

(Y)es (recommended)/(N)o:

Sep 30 2017

Raspberry

  • sudo aptitude install debian-keyring debian-archive-keyring
  • Modify the file /etc/apt/sources.list – change “wheezy” to “jessie” in the first line, so it reads “deb
  • http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi”

  • Modify the file /etc/apt/sources.list.d/raspi.list – change “wheezy” to “jessie” in the first line and add “ ui” to the end of that line, so it reads “deb http://archive.raspberrypi.org/debian jessie main ui”
  • Create the directory /home/pi/.config/autostart by typing “mkdir /home/pi/.config/autostart” in a terminal. (Note the . in front of config.)
  • Type “sudo apt-get update” in a terminal to update the apt index files.
  • Type “sudo apt-get dist-upgrade” to start the upgrade process – this will take a couple of hours. Whenever prompted to update a file during this process, choose the Y option to accept the new file; if you don’t want to be bothered with these prompts, then call apt-get with the -y option – “sudo apt-get -y dist-upgrade”.
Jul 22 2016

postfixadmin – zmiana hasła administratora

doveadm pw -s MD5-CRYPT -p password | sed 's/{MD5-CRYPT}//'
update admin set password=’CRYPTED PASSWORD’ where username=’USERNAME’;

Sep 4 2015

Bitdefender Security for Virtualized Enviroments

Bitdefender Security for Virtualized Enviroments
default login: root
default password: sve
setup command: sva-setup
communication server: ip address:8443
update server configuration: ip:7076

Feb 26 2015

gammu sending sms

gammu sendsms TEXT 048123456789 -text "Halooo .."