documentation refactoring
This commit is contained in:
17
docs/desktop-environments/free-desktop.md
Normal file
17
docs/desktop-environments/free-desktop.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Free desktop
|
||||
|
||||
<https://www.freedesktop.org/wiki/>
|
||||
|
||||
**🛠️ Create a .desktop file so the UI recognizes it as an application:**
|
||||
|
||||
*Example:*
|
||||
|
||||
```bash
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=gĩt.limbosolutions.com
|
||||
Comment=git.limbosolutions.com
|
||||
Exec=flatpak run com.microsoft.Edge --app=https://git.limbosolutions.com # Yes !!! using edge as an example :)
|
||||
Terminal=false
|
||||
X-Desktop-File-Install-Version=0.27
|
||||
```
|
||||
8
docs/desktop-environments/gnome.md
Normal file
8
docs/desktop-environments/gnome.md
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
# Gnome
|
||||
|
||||
- [desktop shortcuts](#desktop-shortcuts)
|
||||
|
||||
## desktop shortcuts
|
||||
|
||||
GNOME and KDE both support .desktop files via the FreeDesktop.org standards. [Check for more information](./free-desktop.md).
|
||||
7
docs/desktop-environments/kde.md
Normal file
7
docs/desktop-environments/kde.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# KDE
|
||||
|
||||
- [desktop shortcuts](#desktop-shortcuts)
|
||||
|
||||
## desktop shortcuts
|
||||
|
||||
GNOME and KDE both support .desktop files via the FreeDesktop.org standards. [Check for more information](./free-desktop.md).
|
||||
33
docs/display-managers/lightdm.md
Normal file
33
docs/display-managers/lightdm.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# lightdm
|
||||
|
||||
LightDM is a lightweight, cross-desktop display manager used to handle graphical logins on Linux systems. It provides the login screen (called a greeter) and manages user sessions, including authentication and session launching.
|
||||
|
||||
**🧭 Key Features of LightDM:**
|
||||
|
||||
- Lightweight and fast: Designed to use minimal system resources compared to heavier alternatives like GDM (GNOME Display Manager).
|
||||
- Cross-desktop compatibility: Works with GNOME, KDE, Xfce, LXDE, and other desktop environments.
|
||||
- Greeter flexibility: Supports multiple greeter front-ends, such as:
|
||||
- LightDM GTK Greeter (default for many distros)
|
||||
- Slick Greeter (used by Linux Mint)
|
||||
- Webkit Greeter (HTML/CSS-based)
|
||||
- Remote login support: Includes protocols like XDMCP and VNC for remote graphical sessions.
|
||||
- Guest sessions and autologin: Can be configured for temporary guest accounts or automatic login.
|
||||
|
||||
**Disable suspend black screen:**
|
||||
|
||||
```bash
|
||||
# /etc/lightdm/lightdm.conf
|
||||
[Seat:*]
|
||||
xserver-command=X -s 0 dpms
|
||||
```
|
||||
|
||||
**Lightdm auto login:**
|
||||
|
||||
```bash
|
||||
# /etc/lightdm/lightdm.conf
|
||||
[SeatDefaults]
|
||||
autologin-user=public
|
||||
autologin-user-timeout=5
|
||||
# Uncomment the following, if running Unity
|
||||
#greeter-session=unity-greeter
|
||||
```
|
||||
18
docs/distros/debian.md
Normal file
18
docs/distros/debian.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Debian
|
||||
|
||||
Debian is a free, open-source Linux distribution known for its stability, security, and foundational role in the Linux ecosystem. It’s developed by a global community and serves as the base for many other popular distros, including Ubuntu and proxmox pve.
|
||||
|
||||
**🧱 Core Features:**
|
||||
|
||||
- Package management: Uses APT and dpkg for installing and updating software.
|
||||
- Supported architectures: Includes x86 (amd64), ARM, PowerPC, RISC-V, and more.
|
||||
- Kernel: Primarily uses the Linux kernel, but also supports alternatives like Hurd and kFreeBSD in experimental branches.
|
||||
- User interface: Default is GNOME, but supports KDE, Xfce, LXDE, Cinnamon, MATE, and others.
|
||||
|
||||
## Package Manager
|
||||
|
||||
```bash
|
||||
apt update -y
|
||||
apt upgrade -y
|
||||
apt autoremove -y
|
||||
```
|
||||
15
docs/distros/fedora.md
Normal file
15
docs/distros/fedora.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Fedora
|
||||
|
||||
Fedora is a cutting-edge, community-driven Linux distribution sponsored by Red Hat, known for its rapid release cycle, modern technologies, and strong developer focus. It’s often used as a testbed for innovations that later appear in Red Hat Enterprise Linux (RHEL).
|
||||
|
||||
**🧱 Core Features:**
|
||||
|
||||
- Package management: Uses RPM packages with dnf as the default package manager.
|
||||
- Desktop environments:
|
||||
- Fedora Workstation: GNOME by default.
|
||||
- Fedora KDE Plasma Desktop: For KDE users.
|
||||
- Fedora Silverblue: Immutable desktop OS with OSTree.
|
||||
- Editions:
|
||||
- Fedora Server: For datacenter and enterprise use.
|
||||
- Fedora IoT: Tailored for embedded and edge devices.
|
||||
- Fedora CoreOS: Minimal, container-focused OS.
|
||||
140
docs/file-systems.md
Normal file
140
docs/file-systems.md
Normal file
@@ -0,0 +1,140 @@
|
||||
# File Systems
|
||||
|
||||
## ext4
|
||||
|
||||
Ext4 (Fourth Extended File System) is a modern journaling file system used by most Linux distributions. It offers high performance, reliability, and support for large volumes and files.
|
||||
|
||||
mkfs.ext4 _filesys_
|
||||
|
||||
Example
|
||||
|
||||
```bash
|
||||
mkfs.ext4 /dev/sdb1
|
||||
```
|
||||
|
||||
## ext3
|
||||
|
||||
mkfs.ext3 _filesys_
|
||||
|
||||
Example
|
||||
|
||||
``` bash
|
||||
mkfs.ext3 /dev/sdb1
|
||||
#exFat
|
||||
mkfs.exfat /dev/sdc1
|
||||
|
||||
```
|
||||
|
||||
## exFat
|
||||
|
||||
mkfs.exfat _filesys_
|
||||
|
||||
``` bash
|
||||
mkfs.exfat /dev/sdc1
|
||||
```
|
||||
|
||||
## ntfs
|
||||
|
||||
``` bash
|
||||
apt-get install ntfs-3g
|
||||
mkntfs --fast --label Backups /dev/sdc1
|
||||
```
|
||||
|
||||
## Manutenção de discos
|
||||
|
||||
Bad Sectors
|
||||
sudo e2fsck -cfpv /dev/sda1
|
||||
O Exemplo foi com o disco sda1 mas deverá ser substituído pelo disco desejado
|
||||
|
||||
Os parâmetros têm os seguintes significados:
|
||||
|
||||
“c” procura por blocos defeituosos e os adiciona à lista
|
||||
|
||||
“f” força uma verificação no sistema de arquivos
|
||||
|
||||
“p” repara qualquer coisa que possa ser reparada com segurança
|
||||
|
||||
“v” está no modo detalhado. você pode ver o progresso do comando
|
||||
|
||||
Esse comando pode levar muito tempo para ser executado, até várias horas em uma unidade particularmente grande.
|
||||
|
||||
## Disks
|
||||
|
||||
File System & Space Usage
|
||||
|
||||
``` bash
|
||||
df -h
|
||||
```
|
||||
|
||||
List physical disks and partition size
|
||||
|
||||
``` bash
|
||||
lsblk
|
||||
```
|
||||
|
||||
List partition ids
|
||||
|
||||
``` bash
|
||||
blkid /dev/sdc1
|
||||
```
|
||||
|
||||
Partition Manager
|
||||
|
||||
``` bash
|
||||
fdisk /dev/<DISK NAME>
|
||||
#Example:
|
||||
fdisk /dev/sdc
|
||||
|
||||
#Partições como mais de 2 TB
|
||||
sudo parted /dev/sdc
|
||||
#(parted) mklabel gpt
|
||||
#alterar para a unidade de medida que desejar
|
||||
#(parted) unit TB
|
||||
#ver espaço livre
|
||||
(parted) print free
|
||||
#criar partição com espaço livre (exemplo:4 Teras)
|
||||
mkpart primary ext4 0 4
|
||||
#Formatar uma partição
|
||||
```
|
||||
|
||||
## mount
|
||||
|
||||
Mount partition on boot fstab
|
||||
|
||||
``` bash
|
||||
nano /etc/fstabexemplo de alias
|
||||
```
|
||||
|
||||
ext4 example
|
||||
|
||||
``` bash
|
||||
#add line
|
||||
PARTUUID=<PARTUUID GIVEN blksid> <FOLDER WHERE TO MOUNT> ext4 defaults,nofail 0 02
|
||||
```
|
||||
|
||||
Mount fstab partions without reboot
|
||||
|
||||
``` bash
|
||||
mount -a
|
||||
```
|
||||
|
||||
gvfs-mount 'ftp://user@www.your-server.com/folder'
|
||||
[source](https://9to5answer.com/how-to-automount-a-gvfs-file-system-on-logon)
|
||||
|
||||
## gio
|
||||
|
||||
### mount samba share
|
||||
|
||||
```bash
|
||||
#/home/username/.credentials
|
||||
#username
|
||||
#SAMBA
|
||||
#password
|
||||
gio mount smb://server/share < /home/username/.credentials
|
||||
```
|
||||
|
||||
### unmount
|
||||
|
||||
```bash
|
||||
gio mount -u smb://server/share
|
||||
```
|
||||
70
docs/shells/bash.md
Normal file
70
docs/shells/bash.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Bash
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
script_directory="$(dirname "$(readlink -f "$0")")"
|
||||
#simbolo para comentário
|
||||
if <condition>; then
|
||||
<commands>
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $variavel -eq 3; then
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
if [ $variavel -eq 3 ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ ! $variavel -eq 3 ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ $variavel -eq 3 -a $variavel -eq 2 -o $variavel -eq 1]; then
|
||||
echo
|
||||
fi
|
||||
``
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
function echoArguments(){
|
||||
echo "printing ($#) arguments"
|
||||
for ARGUMENT in "$@"
|
||||
do
|
||||
echo $ARGUMENT
|
||||
done
|
||||
}
|
||||
echoArguments $@
|
||||
Também é possível aceder por índice
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
function echoArguments(){
|
||||
echo "$0"
|
||||
echo "$1"
|
||||
}
|
||||
echoArguments $@
|
||||
Testar se um programa está a correr
|
||||
if pgrep jivelite>/dev/null
|
||||
then echo "a correr"
|
||||
else echo "nao esta correr"
|
||||
fi
|
||||
verifica o numero de parametros
|
||||
cuidado tem que ter mesmo os espaços nos parenteses rectos
|
||||
|
||||
if [ "$#" -ne 2 ]
|
||||
then
|
||||
echo "wrong number of parameters($#)"
|
||||
echo "0 - name of processo to search"
|
||||
echo "1 - commando to start"
|
||||
exit 1
|
||||
fi
|
||||
``
|
||||
|
||||
61
docs/shells/zsh.md
Normal file
61
docs/shells/zsh.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# zsh / ohmyzsh
|
||||
|
||||
## Install
|
||||
|
||||
**Sources**
|
||||
https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
|
||||
|
||||
### Debian/Ubuntu
|
||||
|
||||
``` bash
|
||||
sudo apt install zsh
|
||||
```
|
||||
|
||||
### Fedora
|
||||
|
||||
``` bash
|
||||
dnf install zsh
|
||||
|
||||
# Make it default shell
|
||||
sudo lchsh $USER
|
||||
```
|
||||
|
||||
### ohmyzsh
|
||||
|
||||
#### Install
|
||||
|
||||
``` bash
|
||||
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
Currenty testing
|
||||
|
||||
* git
|
||||
* web-search
|
||||
* timer
|
||||
|
||||
|
||||
## themes
|
||||
|
||||
- <https://github.com/EliverLara/Nordic>
|
||||
|
||||
### shell
|
||||
|
||||
- zsh
|
||||
|
||||
```bash
|
||||
sudo apt install zsh
|
||||
chsh -s /bin/zsh $whoami
|
||||
sudo apt-get install fonts-powerline
|
||||
|
||||
#source https://ohmyz.sh/#install
|
||||
ssh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
|
||||
#~/home/.zshrc
|
||||
#ZSH_THEME="agnoster"
|
||||
|
||||
```
|
||||
43
docs/ssh.md
Normal file
43
docs/ssh.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# SSH
|
||||
|
||||
## Create key
|
||||
|
||||
```bash
|
||||
ssh-keygen -t ecdsa -b 521
|
||||
#or
|
||||
ssh-keygen -t ecdsa -b 521 -f ~/.ssh/key-ecdsa
|
||||
|
||||
```
|
||||
|
||||
## Copy public key
|
||||
|
||||
```bash
|
||||
ssh-add ~/.ssh/id_ed25519
|
||||
ssh-copy-id -i ~/.ssh//ey-ecdsa.pub example_user@192.0.2.4
|
||||
```
|
||||
|
||||
## Add existing Key
|
||||
|
||||
```bash
|
||||
ssh-add ~/.ssh/key-ecdsa
|
||||
```
|
||||
|
||||
## Alias
|
||||
|
||||
```bash
|
||||
Host srv01
|
||||
HostName srv01.lan
|
||||
User john
|
||||
RemoteCommand cd ~/; exec bash --login
|
||||
RequestTTY yes
|
||||
```
|
||||
|
||||
## Port Binding
|
||||
|
||||
Bind local port 8001 to target-server port 80 using jump-machine.local.
|
||||
_(local machine without direct access to target-server)_
|
||||
|
||||
```bash
|
||||
ssh -f -N -L localhost:8001:target-server:80 usr@jump-machine.local
|
||||
```
|
||||
|
||||
28
docs/systemd.md
Normal file
28
docs/systemd.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# systemd
|
||||
|
||||
## Services
|
||||
|
||||
**Creating an sevice:**
|
||||
|
||||
``` bash
|
||||
#/etc/systemd/system/myservice.service
|
||||
[Unit]
|
||||
Description=My Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
ExecStart=/usr/local/bin/myservice
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/var/www/netcore/hellomvc
|
||||
ExecStart=/usr/local/bin/dotnet /var/www/netcore/hellomvc/hellomvc2.dll --urls="http://*:5049"
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
SyslogIdentifier=dotnet-example
|
||||
User=www-data
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
17
docs/terminals/guake.md
Normal file
17
docs/terminals/guake.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# guake
|
||||
|
||||
```bash
|
||||
apt install guake
|
||||
```
|
||||
|
||||
```bash
|
||||
# ~/.config/autostart/guake.desktop
|
||||
[Desktop Entry]
|
||||
Name=guake
|
||||
GenericName=guake auto start
|
||||
Comment=
|
||||
Exec=guake --hide
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-GNOME-Autostart-enabled=true
|
||||
```
|
||||
5
docs/terminals/terminator.md
Normal file
5
docs/terminals/terminator.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Terminator
|
||||
|
||||
```bash
|
||||
apt install terminator
|
||||
```
|
||||
Reference in New Issue
Block a user