linux commands and information i find useful.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
permissions : information about getting file permissions | |
flaskdrive : flashdrive commands | |
pipeline : redirecting stdout and stderr | |
wget : wget to save a site offline | |
openssl : openssl options | |
certificates : types of certs and their purpose | |
commands : general useful commands | |
ssh : Useful SSH configurations | |
torrent : Torrent client | |
audio : Audio configuration help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Record Audio (10 seconds) | |
arecord -f cd -d 10 test-mic.wav | |
# Play audio | |
aplay test-mic.wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Filename || Needed By || Purpose || Secret | |
===============++============================++================================++=========== | |
ca.crt || Server + Clients || Root CA certificate || NO | |
ca.key || Key Signing Machine only || Root CA key || YES | |
dh.pem || Server only || Diffie Hellman parameters || NO | |
server.crt || Server only || Server Certificate || NO | |
server.key || Server only || Server Key || YES | |
client.crt || Client only || Client Certificate || NO | |
client.key || Client only || Client Key || YES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xinput --list --short | |
xinput --list-props <device> | |
xinput set-prop <device> <property> <value> | |
xrandr -q # Show all display options | |
xrandr -s 1366x768 -r 40 # Set display refresh rate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LuksFormat | |
sudo cryptsetup --key-size 512 --hash sha512 -v luksFormat /dev/<drive> --verify-passphrase | |
sudo cryptsetup config /dev/<drive> --label <LABEL> | |
# LuksOpen | |
sudo cryptsetup luksOpen /dev/<drive> <LABEL> | |
# LuksFormat (w/ header) | |
sudo cryptsetup --key-size 512 --hash sha512 -v luksFormat /dev/<drive> --verify-passphrase --header ~/<header-name> | |
sudo cryptsetup config /dev/<drive> --label <LABEL> | |
# LuksOpen (w/ header) | |
sudo cryptsetup luksOpen /dev/<drive> <LABEL> --header ~/<header-name> | |
# Mount & Format | |
sudo mkfs.ext4 /dev/mapper/<drive> | |
sudo mkdir -p /media/<drive> | |
sudo mount /dev/mapper/<drive> /media/<drive> | |
sudo chown -R <user>:<user> /media/<drive> | |
# LuksClose & umount | |
sudo umount /dev/mapper/<drive> | |
sudo cryptsetup luksClose /dev/mapper/<drive> | |
sudo rm -rf /media/<drive> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests \ | |
--no-conflicts --no-breaks --no-replaces --no-enhances \ | |
--no-pre-depends network-manager | grep "^\w") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo fdisk -l | |
sudo umount /dev/sdb1 | |
sudo wipefs --all /dev/sdb1 | |
sudo cfdisk /dev/sdb1 | |
sudo dd bs=4M if=/path/to/iso of=/dev/sdb status=progress && sync | |
# Running unetbootin | |
sudo QT_X11_NO_MITSHM=1 unetbootin | |
# Recover Corrupt GPT | |
sudo gdisk /dev/sdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenSSL 1.1.1d 10 Sep 2019 | |
Encrypt Large Files: openssl enc -aes-256-cbc -salt -pbkdf2 -in file.txt -out file.txt.enc | |
Options Description | |
openssl OpenSSL command line tool | |
enc Encoding with Ciphers | |
-aes-256-cbc The encryption cipher to be used | |
-salt Adds strength to the encryption | |
-in Specifies the input file | |
-out Specifies the output file. | |
Decrypt Large Files: openssl enc -aes-256-cbc -d -pbkdf2 -in file.txt.enc -out file.txt | |
Options Description: | |
-d Decrypts data | |
-in Specifies the data to decrypt | |
-out Specifies the file to put the decrypted data in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 – no permission | |
1 – execute | |
2 – write | |
3 – write and execute | |
4 – read | |
5 – read and execute | |
6 – read and write | |
7 – read, write, and execute | |
owner group other | |
read (r) 4 4 4 | |
write (w) 2 2 2 | |
execute (x) 1 1 1 | |
----------- ----- ----- ----- | |
total value 7 7 7 | |
stat FILE_NAME | |
stat -c %a FILE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|| visible in terminal || visible in file || existing | |
Syntax || StdOut | StdErr || StdOut | StdErr || file | |
==========++==========+==========++==========+==========++=========== | |
> || no | yes || yes | no || overwrite | |
>> || no | yes || yes | no || append | |
|| | || | || | |
2> || yes | no || no | yes || overwrite | |
2>> || yes | no || no | yes || append | |
|| | || | || | |
&> || no | no || yes | yes || overwrite | |
&>> || no | no || yes | yes || append | |
|| | || | || | |
| tee || yes | yes || yes | no || overwrite | |
| tee -a || yes | yes || yes | no || append | |
|| | || | || | |
n.e. (*) || yes | yes || no | yes || overwrite | |
n.e. (*) || yes | yes || no | yes || append | |
|| | || | || | |
|& tee || yes | yes || yes | yes || overwrite | |
|& tee -a || yes | yes || yes | yes || append |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exit automatically on network interruptions. In your .ssh/config, add: | |
ServerAliveInterval 5 | |
ServerAliveCountMax 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d \ | |
--name=rutorrent \ | |
-e PUID=1000 \ | |
-e PGID=1000 \ | |
-p 8090:80 \ | |
-p 5000:5000 \ | |
-p 51413:51413 \ | |
-p 6881:6881/udp \ | |
-v /<path>/config:/config \ | |
-v /<path>/downloads:/downloads \ | |
ghcr.io/linuxserver/rutorrent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--domains example.com \ | |
--no-parent \ | |
example.com/section/topic/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment