Tips and Tricks: Difference between revisions
No edit summary |
|||
| Line 132: | Line 132: | ||
=== Disable IPv6 until the next reboot === | === Disable IPv6 until the next reboot === | ||
{{Root|echo 1 > /proc/sys/net/ipv6/conf/<iface>/disable_ipv6}} | {{Root|echo 1 > /proc/sys/net/ipv6/conf/<iface>/disable_ipv6}} | ||
=== Stream a video via VLC to Chromecast === | |||
{{Command|vlc --sout="#chromecast{ip=xxx.xxx.xxx.xxx}" ~/video.mkv}} | |||
== Package management (Portage) == | == Package management (Portage) == | ||
Revision as of 17:16, 6 January 2017
Useful commands
Recursively set directory permissions to 755
Recursively rename directory and files from ISO-8859-15 to UTF-8
Recursively search for files of a specitic type, e.g. documents and list them
User: Change a users home directory
Strip comments from config file
rsync file transfer
Synchronise a directory or whole partition:
Upload a file to a remote server via rsync over ssh:
SCP file transfer
File transfer via commandline.
Upload file:
Download file:
Upload directory:
Download directory:
SSH tunnel
Very useful if the server you want to connect to has only the SSH port open and/or a firewall infront and you want to access for example a tomcat server running on port 8080.
After establishing the tunnel you can access the tomcat server of the remote machine port 8080 at your localhost port 7777.
Generate SSH Host Keys
SSL: Remove passphrase from a SSL key
SSL: Add/change passphrase to/from a SSL key
Perl: List included perl core modules with their versions
Postfix: Show mailqueue
Postfix: Attempt to deliver all queued mail
Postfix: Delete a single mail from queue
Postfix: Delete all mails with a specific sender from queue
ImageMagick: Combine images side by side
Safely spin down external USB drive AFTER unmounting using sg3_utils
Delete content in the underlying directory of a mounted filesystem without having to unmount first
Bind mount root to a temporary mount point, e.g. /mnt/temp. Useful to fix. e.g. following systemd informational notice:
tmp.mount: Directory /tmp to mount over is not empty, mounting anyway.
Browse to /mnt/temp/yourmountpoint and be able to delete the files, afterwards unmount /mnt/temp again.
eyeD3: Remove a specific ID3 tag frame
Ghostscript: Split a PDF file in single files per page using a python script
#!/usr/bin/python3
import os
number_of_pages = 10
input_pdf = "file.pdf"
for i in range(1, number_of_pages +1):
os.system("gs -q -dBATCH -dNOPAUSE -sOutputFile=page{page:04d}.pdf -dFirstPage={page} -dLastPage={page} -sDEVICE=pdfwrite {input_pdf}".format(page=i, input_pdf=input_pdf) )
Ghostscript: Merge multiple PDF files
Alternativly use poppler (which removes metadata)
Change the Dolphin standard view to detailed view for ALL folders =
Open Dolphin -> Settings > Configure Dolphin -> Views -> Common Tab -> and mark -> Use the same view for all folders
Disable IPv6 until the next reboot
Stream a video via VLC to Chromecast
Package management (Portage)
To which package belongs file X
Which installed packages have USE-Flag X
Backup an installed package
After this you can install the package on another machine or do a fast downgrade if something went bad after an update. You can find the file under /usr/portage/packages/All and in this example a symlink to the apache file in /usr/portage/packages/net-www. To install the now precompiled binary use: