Skip to content

Latest commit

 

History

History
168 lines (107 loc) · 6.85 KB

Tutorials.md

File metadata and controls

168 lines (107 loc) · 6.85 KB

"Tutorials" section

Online sources for doing specific things in Linux

Managing processes

Reataching terminals: deatached, foreground and background processes

  • fg, bg, disown, nohup
  • %1, %2
  • Reatach processes

Read article:

Baeldung - Attach a Terminal to a Detached Process in Linux

Exit siganls when TTY ends

Conclusions: although TTY may send SIGHUP control singal, the program may choose to ignore it. Some processes are worthier as a service.

Traps + signal codes

TutorialsPoint - Signals and Traps

Managing services

Add a program or script as a service

Link to forum

Permissions

Directory permissions explanation

Read here

Symbolic Link Permissions

Baeldung - How Do Permissions Apply to Symbolic Links?

Text processing in bash

Argumentos de programa con getops

Ejemplo de script con getops

Curl test stress script raw

Get the name of the file or the directory

Text processing in bash - basedir and dirnme

ASCII to numbers in shell

Bash script to get ASCII values for alphabet

Multiline in bash: controlling interactive programs, multiline commands, multiline input

Here Documents

Debian

Create custom .deb packages

MakeUseOf - How to Create DEB Packages for Debian/Ubuntu

Fix apt "unsandboxed" issue

Read here

SSH

Create a banner and a MOTD (Message of the Day)

Baeldung Tutorial

Networking

Configure a VPN server

Digital Ocean - How To Set Up and Configure an OpenVPN Server

Configuring a TCP Wrapper (xinetd)

How to configure xinetd RedHat - TCP Wrappers and xinetd RedHat ES - Archivos de configuración de envolturas TCP

Make IPTABLES persistent

Link to forum

Logging in IPTABLES

Link to forum

Local reverse proxy for resolving domains with ports

Baelding - Mapping Hostnames with Ports in /etc/hosts

Docker

Why there is no systemctl in Docker

Docker forums

Services in Docker

Services can be started manually through the systemd. In Docker we should use the service command. Read more

Start Apache (the other way)

sudo /etc/init.d/apache2 start

Vagrant

Fix apt manual install "unsanboxed" error

P

Python

How to handle secrets

Useful when working with secrets such as passwords and tokens. A must not to have passwords hardcoded (even in they are not plaintext, code can be reversed) GitGuardian - How to Handle Secrets in Python

Miscellaneous

What happens if I have an alias (or function) with the same name as a command

IBM - command Command

Follow the end of the file (tail)

Perfect for logging

Read here

Where to put binaries

Read here

Adjust nano tabspace

Read here

Run commands through SSH

Multiline commands

ssh -T $_remote <<'EOL'
	now="$(date)"
	name="$HOSTNAME"
	up="$(uptime)"
	echo "Server name is $name"
	echo "Server date and time is $now"
	echo "Server uptime: $up"
	echo "Bye"
EOL

How to run commands in SSH

Execute function with timeout

Shell function with timeout

Linux show certificate information

How to Check a Certificate with OpenSSL Commands in Linux?

Handling signals in bash

Handling signals in bash

Sort disk usage du by size

Sort du by size

Update alternatives

Read here