Remove weight, add doh
This commit is contained in:
		
							parent
							
								
									64be233740
								
							
						
					
					
						commit
						bb1e28fcb1
					
				@ -1,5 +1,6 @@
 | 
			
		||||
# General
 | 
			
		||||
alias ll="ls -lAFh --color"
 | 
			
		||||
alias duh="du -hs * | sort -rh"
 | 
			
		||||
alias dedup="awk '!visited[$0]++'"
 | 
			
		||||
alias dfh="df -h | grep -v '/var/lib/docker\|/snap/\|tmpfs'"
 | 
			
		||||
alias ,ssh-agent-forwarding="eval \`ssh-agent\` && ssh-add ~/.ssh/id_rsa"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										16
									
								
								bin/weight
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								bin/weight
									
									
									
									
									
								
							@ -1,16 +0,0 @@
 | 
			
		||||
#!/usr/bin/env ruby
 | 
			
		||||
 | 
			
		||||
files = `du -k -d 1`.scan(/(\d+).*\.\/(.*)/)
 | 
			
		||||
maxlen = files.max_by{ |f| f[1].length }[1].length
 | 
			
		||||
 | 
			
		||||
files.sort_by{ |f| f[0].to_i }.reverse.each do |f|
 | 
			
		||||
  name = f[1]
 | 
			
		||||
  size = f[0].to_i
 | 
			
		||||
 | 
			
		||||
  print "%-#{maxlen+1}s" % name
 | 
			
		||||
  if size < 1024
 | 
			
		||||
    puts "#{size}K"
 | 
			
		||||
  else
 | 
			
		||||
    puts "#{size / 1024}M"
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user