Commands by seabre (1)

  • Extract a color palette from a image useful for designers. Example usage: extract-palette myawesomeimage.jpg 4 Where the first argument is the image you want to extract a palette from. The second argument is the number of colors you want. It may be the case where you want to change the search space. In that case, change the -resize argument to a bigger or smaller result. See the ImageMagick documentation for the -resize argument. Show Sample Output


    1
    extract-palette() { convert "$1" -resize 300x -dither None -colors "$2" txt: | tail -n +2 | tr -s ' ' | cut -d ' ' -f 3 | sort | uniq -c | sort -rn | tr -s ' ' | cut -d ' ' -f 3;}
    seabre · 2017-06-21 22:07:26 51

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Append a pub key from pem file and save in remote server accessing with another key
Useful if you need to add another key and you using pem files (typical in AWS EC2 Instances). If you use it in EC2 instances, remember that password authentication is disabled, so you have to use the first key generated when you generated the instance

check the status of 'dd' in progress

Edit 2 or more files in vim using vim -d
Is this not the same

unbuffered tcpdump
Sometimes the question comes up: How to get unbuffered tcpdump output into the next program in the pipe? i.e. if your OS forces you to wait for the buffer to fill before the next program sees any of the output If you use -Uw- then you can't use -A (or -X or -XX) at the same time. When the question comes up, I've never seen anyone suggest this simple solution: chaining 2 tcpdump instances.

prints line numbers

Don't like the cut command? Tired of typing awk '{print $xxx}', try this

Show latest changed files

list block devices
Shows all block devices in a tree with descruptions of what they are.

Download all images from a 4chan thread
first grep all href images then sed the url part then wget

phpinfo from the command line
php -i seems to show default not real


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: