Skip to content

Latest commit

 

History

History
506 lines (295 loc) · 13.6 KB

File metadata and controls

506 lines (295 loc) · 13.6 KB

Linux Directory Structure

https://www.howtogeek.com/117435/htg-explains-the-linux-directory-structure-explained/

Tips

Anbox (Android VM)

Install Anbox on Fedora: https://www.linuxadictos.com/en/instala-y-ejecutar-aplicaciones-de-android-con-anbox-en-fedora-30.html

apt

When it’s not possible to install a deb file directly with apt (apt install ./file.deb), create this:

 #!/bin/bash
 
# Save this script as "inst" and make it executable. 
# Then copy it into /usr/local/bin/

if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <path-to-deb-file>"
    exit 1
fi

sudo apt install ./"$1"

Arch Linux

Aureport:

https://linux.die.net/man/8/aureport)

  • Successful logins: ausearch --message USER_LOGIN --success yes --interpret

  • Failed logins: ausearch --message USER_LOGIN --success no --interpret

    • -message is followed by the message we are interested in searching for. Examples include USER_LOGINDEL_USERADD_GROUPUSER_CHAUTHTOKDEL_GROUPCHGRP_IDROLE_ASSIGN, and ROLE_REMOVE.
    • -success is followed by yes or no depending on whether you are searching for successful or unsuccessful attempts, respectively.
    • -interpret converts numeric entities, such as UID (User ID), into text.

    Successful logins: ausearch --message USER_LOGIN --success yes --interpret | grep ct=root

    Failed logins: ausearch --message USER_LOGIN --success no --interpret | grep ct=root

Brightness Controller

Fedora install

Cache

  • Clear cache:

    1. Clear PageCache only. sync; echo 1 > /proc/sys/vm/drop_caches

    2. Clear dentries and inodes. sync; echo 2 > /proc/sys/vm/drop_caches

    3. Clear pagecache, dentries, and inodes. sync; echo 3 > /proc/sys/vm/drop_caches

Cisco Packet Tracer

Arch and Ubuntu 24.04 installation

ClamAV

ClamAV installation and setup on Debian/Ubuntu

CRON

Disk quota

Configuration

DNS

Firewalld

  • Add an open port
firewall-cmd --zone=public --add-port=2237/tcp

Flameshot

  • Command for shortcut: /usr/bin/flameshot gui

Files

Find

SUID vs SGID

Gnome

GNS3

Hostname

Disable hostname broadcasting

i3

  • Touchpad “Tap to click” + “Natural screen”:

    • Copy/paste all of this in the terminal:
    sudo mkdir -p /etc/X11/xorg.conf.d && sudo tee <<'EOF' /etc/X11/xorg.conf.d/90-touchpad.conf 1> /dev/null
    Section "InputClass"
            Identifier "touchpad"
            MatchIsTouchpad "on"
            Driver "libinput"
            Option "Tapping" "on"
    EndSection
    
    EOF

ip

iptables

John Jumbo

  • Manual install:
    • Before following this steps, install this:
    • sudo apt install build-essential libssl-dev yasm libgmp-dev libpcap-dev libnss3-dev libkrb5-dev pkg-config libbz2-dev zlib1g-dev
    • For NVIDIA support: sudo apt install nvidia-cuda-toolkit nvidia-opencl-dev
    • For AMD support: sudo apt install fglrx-updates-dev

Jq (Command-line Json processor)

Keyboard

  • CLI layout command (exemple for US International Dead Keys):

    setxkbmap -layout us -variant intl

Kali Linux

KVM

  • Enable copy-paste on guest (already enabled automatically on host):

    • sudo apt install spice-guest-tools spice-vdagent
    • Check if network is active: sudo virsh net-start default
    • If network is not active: sudo virsh net-start default
    • Enable network auto-start: sudo virsh net-autostart default
  • Import OVA:

    • Extract the files: tar xvf <image_name>.ova
    • Coonvert System.vmdk to qcow2: qemu-img convert -O qcow2 <image_name>.vmdk /path/to/folder/OL7U2.qcow2
  • Enable Bridge Adapter:

  • Convert .ova to qcow2:

    1. tar xvf MyAppliance.ova
    2. qemu-img convert -O qcow2 extractedFile.vmdk newFile.qcow2

Loopback

Definition

LUKS

Install LUKS manually

Mail

From localhost to external

Memory

  • To empty the memory buffer and cache, execute the following command,
free && sync && echo 3 > /proc/sys/vm/drop_caches && free

Modprobe

MSFVenom

Cheat Sheet

NVIDIA drivers on Debian

NTP update

sudo ntpdate [pool.ntp.org](http://pool.ntp.org/)

OpenNebula

Sunstone: GUI

Port 2616/tcp if not proxied

Default user: oneadmin

Deploy miniONE frontend and KVM node Cloud

wget'https://github.com/OpenNebula/minione/releases/latest/download/minione'

sudo bash minione

source: https://github.com/OpenNebula/minione

OpenNMS

OpenNMS and SNMP installation

OpenVAS

Install OpenVAS on Ubuntu/Debian

Ports

  • Check open ports: sudo netstat -tulpn | grep LISTEN

Python

  • Manual install:

    • sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl
    • tar -xf Python-3.?.?.tar.xz
    • cd Python-3.*
    • ./configure
    • sudo make install
  • Externally Managed Environment error

    • pip3 install XXXXX **--break-system-packages**

Raspberry Pi OS

  • Under voltage alert:

    • sudo vim /boot/config.txt and add this: avoid_warnings=1
  • WiFi manual settings:

    • Create the file wpa_supplicant.conf in the root of the /boot partition (adapt ssid and psk):
country=RO
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid=**<NETWORK NAME>**
scan_ssid=1
psk=**<PASSWORD>**
key-mgmt=WPA-PSK
}

RedShift

config

rpm command

Rustdesk

Install Rustdesk on Debian/Ubuntu

Sandboxing

SELinux

  • Change default port (example for SSH from 22 to 2237)
semanage port -a -t ssh_port_t -p tcp 2237
semanage port -l | grep ssh
systemctl restart sshd.service

Sonic Pi

Linux Mint install

SPICE agent installation for UTM

sudo apt update
sudo apt install spice-vdagent spice-webdavd qemu-guest-agent
sudo reboot

SSH

SSH permissions

sudo

Terminal

Tor unofficial downloads (multiple architectures)

Tor Website

TOR:

sudo apt install tor

sudo nano /etc/tor/torrc

Uncomment this 2 lines:

HiddenServiceDir /var/lib/tor/hidden_service/

HiddenServicePort 80 127.0.0.1:80

RPi OS:

sudo service tor stop

sudo service tor start

sudo service tor status

Fedora:

sudo systemctl start tor

sudo systemctl status tor

Check the website URL:

sudo cat /var/lib/tor/hidden_service/hostname (RPi OS)

sudo cat /var/lib/tor/other_hidden_service/hostname (Fedora)

NGINX:

RPi OS:

sudo apt install nginx

sudo service nginx start

sudo service nginx status

Fedora:

sudo systemctl start nginx

sudo systemctl status nginx

  • ------------------------------------(RPi OS only)----------------------------

    sudo nano /etc/nginx/nginx.conf

    Uncomment:

    server_tokens off;

    server_name_in_redirect off;

    Add this line:

    port_in_redirect off;

    sudo service nginx restart (RPi OS)

    sudo systemctl restart nginx


cd /var/www/html/ (RPi)

cd /usr/share/nginx/html/ (Fedora)

sudo rm index.nginx-debian.html (RPi)

sudo rm index.html (Fedora)

sudo nano index.php

Add some HTML code, a "hello world" or something: (...)

sudo service restart nginx

Copy/paste the onion URL in Tor browser and check the website

PHP install: How to Install PHP on Raspberry Pi with NGINX (themoderncoder.com)

TLP for Fedora

URL encode

sudo apt-get install gridsite-clients

Example: urlencode "http://example.com/?param=linux+url+encoder"

Output: http%3A%2F%2Fexample.com%2F%3Fparam%3Dlinux%2Burl%2Bencoder

Users

VirtualBox

VNC

Kali and Ubuntu/Mint

WiFi

Command-line connexion:

  • Find the networkds around: nmcli dev wifi
  • Connect to a network: nmcli dev wifi connect <SSID>

Driver install for AC1300 USB adapter (option 2, works for Kali/Debian-based and Fedora):

Driver install for AC1300 USB adapter (option 3):

Driver install for AWUS1900 on Kali:

Driver install for AC600 USB adapter:

Wine

Double-click .exe files

WoeUSB

WSL