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/01/06 22:08] – [Manipulate pdf] mh | linux:start [2021/05/19 14:52] – [List info] mh | ||
---|---|---|---|
Line 14: | Line 14: | ||
#print user PATH | #print user PATH | ||
$ printenv PATH | $ printenv PATH | ||
+ | / | ||
+ | $ echo " | ||
/ | / | ||
Line 23: | Line 25: | ||
| | ||
| | ||
+ | |||
+ | #Add a folder to path for current shell session | ||
+ | $ PATH=$PATH:/ | ||
</ | </ | ||
Line 83: | 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 92: | Line 115: | ||
[[https:// | [[https:// | ||
+ | ---- | ||
===== Fonts install (bash) ===== | ===== Fonts install (bash) ===== | ||
Line 117: | Line 140: | ||
===== Manipulate pdf ===== | ===== Manipulate pdf ===== | ||
+ | |||
+ | ==== Modifying page order ==== | ||
Use (< | Use (< | ||
Line 126: | 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 139: | Line 182: | ||
Run **dmesg** to check. If you see lines such as : | Run **dmesg** to check. If you see lines such as : | ||
- | < | + | < |
[54259.098330] FAT-fs (sdb1): error, corrupted directory (invalid entries) | [54259.098330] FAT-fs (sdb1): error, corrupted directory (invalid entries) | ||
[54259.098338] FAT-fs (sdb1): Filesystem has been set read-only | [54259.098338] FAT-fs (sdb1): Filesystem has been set read-only | ||
Line 150: | Line 193: | ||
Run the following command : | Run the following command : | ||
- | < | + | < |
- | sudo umount /dev/sdX# | + | $ sudo umount /dev/sdX# |
- | sudo fsck.msdos -aw /dev/sdX# | + | $ sudo fsck.msdos -aw /dev/sdX# |
</ | </ | ||
Line 183: | Line 226: | ||
If a NTFS volume mounts in read-only, remount using : | If a NTFS volume mounts in read-only, remount using : | ||
- | < | + | < |
- | su | + | $ su |
- | mkdir /mnt/ntfs | + | $ mkdir /mnt/ntfs |
- | mount -t ntfs /dev/sd[X] /mnt/ntfs | + | $ mount -t ntfs /dev/sd[X] /mnt/ntfs |
</ | </ | ||
Line 287: | Line 330: | ||
*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 | ||
- | < | + | < |
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 : | ||
+ | |||
+ | <code bash> | ||
+ | $ source ~/.bashrc | ||
+ | #or | ||
+ | $ . ~/.bashrc | ||
+ | </ | ||
+ | |||
+ | ===== Programming Mouse Buttons ===== | ||
+ | |||
+ | <code bash> | ||
+ | $ sudo apt install xbindkeys xvkbd | ||
+ | $ xev | grep ', button' | ||
+ | $ touch ~/ | ||
+ | $ nano ~/ | ||
+ | </ | ||
+ | |||
+ | // Sample File :// | ||
+ | |||
+ | < | ||
+ | # Send enter on thumb mouse button | ||
+ | "xvkbd -text ' | ||
+ | b:8 | ||
+ | </ | ||
+ | |||
+ | // Ccheck xvkbd for more syntax // | ||
===== Useful shell ===== | ===== Useful shell ===== | ||
Line 301: | Line 418: | ||
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 319: | Line 436: | ||
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 330: | Line 475: | ||
---- | ---- | ||
+ | === tar === | ||
+ | Pack/Unpack tarball | ||
+ | |||
+ | <code bash> | ||
+ | #All the following commands are verbose (-v) | ||
+ | $ tar -xvf file.tar #Unpack tar | ||
+ | $ tar -xvzf file.tar.gz #Unpack compressed (gzip) tar | ||
+ | $ tar -cvf file.tar / | ||
+ | $ tar -cvzf file.tar / | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | ---- | ||
===== 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 342: | Line 507: | ||
=== 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 367: | Line 537: | ||
=== 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:// |