Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
linux:start [2020/04/03 15:52] – [Alias] mh | linux:start [2022/02/22 10:46] – [Useful shell] mh | ||
---|---|---|---|
Line 88: | Line 88: | ||
---- | ---- | ||
+ | ===== AppImages ===== | ||
+ | |||
+ | Extract the content of an AppImage : | ||
+ | |||
+ | ./ | ||
+ | |||
+ | This is useful if you want to get the Icon. | ||
+ | |||
+ | [[https:// | ||
+ | ---- | ||
+ | |||
+ | ===== Grub ===== | ||
+ | |||
+ | Config file is located at ''/ | ||
+ | |||
+ | The line for a splash image is '' | ||
+ | |||
+ | ---- | ||
===== Limit CPU usage ===== | ===== Limit CPU usage ===== | ||
- | There are various ways to limit the CPU usage of a process. One simple way is using ' | + | There are various ways to limit the CPU usage of a process. One simple way is using '' |
<code bash> | <code bash> | ||
Line 97: | Line 115: | ||
[[https:// | [[https:// | ||
+ | ---- | ||
===== Fonts install (bash) ===== | ===== Fonts install (bash) ===== | ||
Line 122: | Line 140: | ||
===== Manipulate pdf ===== | ===== Manipulate pdf ===== | ||
+ | |||
+ | ==== Modifying page order ==== | ||
Use (< | Use (< | ||
Line 131: | Line 151: | ||
Old syntax with pdftk : < | Old syntax with pdftk : < | ||
- | === Ubuntu === | + | === Ubuntu |
pdfshuffler is a front end for python-pyPdf and a great tool for merging or splitting pdf files with a GUI. | pdfshuffler is a front end for python-pyPdf and a great tool for merging or splitting pdf files with a GUI. | ||
+ | |||
+ | ==== Reducing PDF size ==== | ||
+ | |||
+ | Found from [[https:// | ||
+ | this answer]] on AskUbuntu : | ||
+ | |||
+ | <code bash> | ||
+ | gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | *''/ | ||
+ | *''/ | ||
+ | *''/ | ||
+ | *''/ | ||
+ | *''/ | ||
+ | |||
Line 284: | Line 322: | ||
//Note to self : Added " | //Note to self : Added " | ||
+ | ==== Fixing python on youtube-dl ==== | ||
+ | |||
+ | If following error occurs while using '' | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | === If python3 is not installed === | ||
+ | |||
+ | <code bash> | ||
+ | $sudo apt install python3 | ||
+ | </ | ||
+ | |||
+ | |||
+ | === If python3 is installed === | ||
+ | |||
+ | <code bash> | ||
+ | $whereis python3 | ||
+ | $sudo ln -s / | ||
+ | </ | ||
+ | |||
+ | Change first argument according to where python3 is installed. | ||
===== Linux Screencast tools ===== | ===== Linux Screencast tools ===== | ||
Line 292: | Line 353: | ||
*add-apt-repository ppa: | *add-apt-repository ppa: | ||
+ | ===== Open VPN ===== | ||
+ | |||
+ | === Connecting a client to a remote server === | ||
+ | //This requires a valid .ovpn file// | ||
+ | |||
+ | |||
+ | < | ||
+ | openvpn --config / | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | === Connecting to shared folders through openvpn === | ||
+ | //This requires the ip of the shared folders location// | ||
+ | |||
+ | ===== Samba tips ===== | ||
+ | |||
+ | === List available shares on a given host === | ||
+ | Replace host with the hostname or IP address of the server running samba shares | ||
+ | <code bash> | ||
+ | $ smbclient -L host | ||
+ | </ | ||
+ | |||
+ | Output will be something like this | ||
+ | < | ||
+ | Sharename | ||
+ | --------- | ||
+ | home Disk | ||
+ | shares | ||
+ | users | ||
+ | IPC$ IPC IPC Service () | ||
+ | |||
+ | Reconnecting with SMB1 for workgroup listing. | ||
+ | |||
+ | Server | ||
+ | --------- | ||
+ | |||
+ | Workgroup | ||
+ | --------- | ||
+ | MY_WORK | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | === Locate mount points === | ||
+ | |||
+ | Most of the time they are located at ''/ | ||
===== Alias ===== | ===== Alias ===== | ||
Create an alias using command | Create an alias using command | ||
Line 297: | Line 405: | ||
alias name=' | alias name=' | ||
</ | </ | ||
- | The alias is only in place while the user session is active. To make it permanent, write it in the .bashrc file in the home directory of the user. ([[http:// | + | The alias is only in place while the user session is active. To make it permanent, write it in the '' |
You can reload the .bashrc file using : | You can reload the .bashrc file using : | ||
<code bash> | <code bash> | ||
- | source ~/.bashrc | + | $ source |
+ | #or | ||
+ | $ . ~/.bashrc | ||
</ | </ | ||
- | or | + | |
+ | ===== Programming Mouse Buttons ===== | ||
<code bash> | <code bash> | ||
- | . ~/.bashrc | + | $ sudo apt install xbindkeys xvkbd |
+ | $ xev | grep ', button' | ||
+ | $ touch ~/.xbindkeysrc | ||
+ | $ nano ~/.xbindkeysrc | ||
</ | </ | ||
+ | |||
+ | // Sample File :// | ||
+ | |||
+ | < | ||
+ | # Send enter on thumb mouse button | ||
+ | "xvkbd -text ' | ||
+ | b:8 | ||
+ | </ | ||
+ | |||
+ | // Ccheck xvkbd for more syntax // | ||
+ | |||
===== Useful shell ===== | ===== Useful shell ===== | ||
Line 315: | Line 441: | ||
You can use for commands in the shell or use the ' | You can use for commands in the shell or use the ' | ||
- | < | + | < |
skx@lappy: | skx@lappy: | ||
a.JPG b.JPG c.JPG d.JPG | a.JPG b.JPG c.JPG d.JPG | ||
Line 333: | Line 459: | ||
08:21:02 | 08:21:02 | ||
</ | </ | ||
+ | ---- | ||
+ | |||
+ | === Mount === | ||
+ | List mounts | ||
+ | <code bash> | ||
+ | $ findmnt | ||
+ | </ | ||
+ | Target disk | ||
+ | <code bash> | ||
+ | $ sudo fdisk -l | ||
+ | Disk /dev/sda | ||
+ | [...] | ||
+ | Disk /dev/sdb | ||
+ | [...] | ||
+ | </ | ||
+ | Create mount point | ||
+ | <code bash> | ||
+ | $ sudo mkdir / | ||
+ | </ | ||
+ | Mount device | ||
+ | <code bash> | ||
+ | $ sudo mount /dev/sda1 / | ||
+ | </ | ||
+ | Unmount | ||
+ | <code bash> | ||
+ | $ sudo umount / | ||
+ | </ | ||
+ | [[https:// | ||
---- | ---- | ||
Line 348: | Line 502: | ||
<code bash> | <code bash> | ||
- | #All the following commands are verbose (-v) | + | #All the following commands are verbose (-v) and target a file archive (-f) |
- | $ tar -xvf file.tar #Unpack tar | + | $ tar -xvf file.tar #Unpack tar (-x : extract) |
- | $ tar -xvzf file.tar.gz #Unpack compressed (gzip) tar | + | $ tar -xvzf file.tar.gz #Unpack compressed (gzip) tar (-z : filter through gzip) |
- | $ tar -cvf file.tar / | + | $ tar -cvf file.tar / |
- | $ tar -cvzf file.tar / | + | $ tar -cvzf file.tar / |
</ | </ | ||
Line 361: | Line 515: | ||
===== List info ===== | ===== List info ===== | ||
+ | |||
+ | === Display all information === | ||
+ | |||
+ | <code bash> | ||
+ | $ inxi -F | ||
+ | </ | ||
+ | //Read the manual, inxi is a very powerful tool to quickly get an overview of a full hardware setup// | ||
=== Distrib === | === Distrib === | ||
- | < | + | < |
$ lsb_release -d | $ lsb_release -d | ||
</ | </ | ||
Line 369: | Line 530: | ||
=== CPU === | === CPU === | ||
Basic | Basic | ||
- | < | + | < |
$ lscpu | $ lscpu | ||
</ | </ | ||
Detailed, core-specific information, | Detailed, core-specific information, | ||
- | < | + | < |
$ cat / | $ cat / | ||
+ | </ | ||
+ | |||
+ | On Macs : | ||
+ | <code bash> | ||
+ | $ sysctl -n machdep.cpu.brand_string | ||
</ | </ | ||
=== Mounted devices === | === Mounted devices === | ||
- | < | + | < |
$ df -h | $ df -h | ||
</ | </ | ||
=== Kernel === | === Kernel === | ||
- | < | + | < |
$ uname -snrm | $ uname -snrm | ||
</ | </ | ||
Line 394: | Line 560: | ||
=== Kernel modules === | === Kernel modules === | ||
- | < | + | < |
$ lsmod | $ lsmod | ||
</ | </ | ||
=== Bash history === | === Bash history === | ||
- | < | + | < |
- | history | + | $ history |
</ | </ | ||
=== D-Bus/ | === D-Bus/ | ||
- | < | + | < |
- | gdbus | + | $ gdbus |
- | g-feet //gui history | + | $ g-feet //gui history |
</ | </ | ||
+ | === Motherboard information === | ||
+ | <code bash> | ||
+ | $ sudo dmidecode | grep -A3 ‘^System Information’ | ||
+ | </ | ||
+ | //dmidecode spurns out a lot of information if you want to query your system// | ||
+ | |||
+ | === Diagnostics & Tools === | ||
+ | |||
+ | <code bash> | ||
+ | $ uptime [load Average] | ||
+ | $ dmesg -T | tail [Kernel errors] | ||
+ | $ vmstat 1 [Virtual memory and detailed information] | ||
+ | $ mpstat -P ALL 1 [CPU state] | ||
+ | $ pidstat [processes] | ||
+ | $ free -m [memory] | ||
+ | $ atop [main overview] | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Debug & Logs ===== | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | Check in ''/ | ||
+ | |||
+ | <code bash> | ||
+ | $ls -lart //inverted sorted by time. Last entry is latest modified | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Misc Ressources ===== | ||
+ | |||
+ | *[[https:// | ||
+ | *[[https:// |