Wiki

A universe of ideas

User Tools

Site Tools


computer:bash_snippets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computer:bash_snippets [2020-01-09 07:47] – [Play YouTube Playlists] skrupelloscomputer:bash_snippets [2020-11-18 18:11] (current) – external edit 127.0.0.1
Line 33: Line 33:
 sort -nrs sort -nrs
 </code> </code>
 +
 +<WRAP center round important 60%>
 +Achte auf die Hardware-Beschleunigung (siehe ''vainfo'')
 +</WRAP>
  
 ===== Order files and directories recursive by date ===== ===== Order files and directories recursive by date =====
Line 213: Line 217:
 </FileSpec> </FileSpec>
 </code> </code>
 +
 +====== CUPS ======
 +Delete all learned Network printers:
 +<code bash>
 +lpstat -s | \grep ///dev/null | cut -c 12- | cut -d: -f1 | xargs -n1 -- lpadmin -x 
 +</code>
 +
 ====== Zu schlecht für ein dotfile ====== ====== Zu schlecht für ein dotfile ======
 Hier sind scripte, die zwar eine nette Idee, aber viel zu schlecht für ein dotfile sind. Hier sind scripte, die zwar eine nette Idee, aber viel zu schlecht für ein dotfile sind.
Line 249: Line 260:
 </code> </code>
  
 +<code>
 +smartctl -x /dev/sda
 +</code>
  
  
 +<code python>
 +for i in [2, 1.9, 1.5, 1.1, None, 0, None, -1.1, -1.5, -1.9, -2]:
 +    print('-'*105 if i is None else f'{i: .1f}: ceil = {math.ceil(i): } || round = {round(i): } | int(i+.5) = {int(i+0.5): } || floor = {math.floor(i): } | int = {int(i): } || int(i)+1 = {int(i)+1: } | int(i)-1 = {int(i)-1: }')
 +</code>
 +<code>
 + 2.0: ceil =  2 || round =  2 | int(i+.5) =  2 || floor =  2 | int =  2 || int(i)+1 =  3 | int(i)-1 =  1
 + 1.9: ceil =  2 || round =  2 | int(i+.5) =  2 || floor =  1 | int =  1 || int(i)+1 =  2 | int(i)-1 =  0
 + 1.5: ceil =  2 || round =  2 | int(i+.5) =  2 || floor =  1 | int =  1 || int(i)+1 =  2 | int(i)-1 =  0
 + 1.1: ceil =  2 || round =  1 | int(i+.5) =  1 || floor =  1 | int =  1 || int(i)+1 =  2 | int(i)-1 =  0
 +---------------------------------------------------------------------------------------------------------
 + 0.0: ceil =  0 || round =  0 | int(i+.5) =  0 || floor =  0 | int =  0 || int(i)+1 =  1 | int(i)-1 = -1
 +---------------------------------------------------------------------------------------------------------
 +-1.1: ceil = -1 || round = -1 | int(i+.5) =  0 || floor = -2 | int = -1 || int(i)+1 =  0 | int(i)-1 = -2
 +-1.5: ceil = -1 || round = -2 | int(i+.5) = -1 || floor = -2 | int = -1 || int(i)+1 =  0 | int(i)-1 = -2
 +-1.9: ceil = -1 || round = -2 | int(i+.5) = -1 || floor = -2 | int = -1 || int(i)+1 =  0 | int(i)-1 = -2
 +-2.0: ceil = -2 || round = -2 | int(i+.5) = -1 || floor = -2 | int = -2 || int(i)+1 = -1 | int(i)-1 = -3
 +</code>
computer/bash_snippets.1578552443.txt.gz · Last modified: 2020-11-18 18:10 (external edit)