Commands using fc-cache (3)

  • Refresh the cache of font directory , usefull after you download font (.ttf or other) from various website and you don't want to reboot or relogin . Close your word processor before using the command , after the refresh reopen your word processor , new fonts is avaible ! Show Sample Output

    sudo fc-cache -f -v
    eastwind · 2009-10-07 11:01:29 0
  • First you have to create a directory in your system, where the fonts will be stored, and copy them. sudo mkdir /usr/share/fonts/miscttf; sudo cp *.ttf /usr/share/fonts/miscttf After recharge cache with the command

    ttmkfdir mkfontdir fc-cache /usr/share/fonts/miscttf
    starchox · 2009-03-06 21:28:17 1
  • 1) Find true type fonts; 2) Copy them to /usr/share/fonts/truetype; 3) Reload font information.

    find ~ -name "*.ttf" -exec cp {} /usr/share/fonts/truetype \; & fc-cache -f
    scripteles · 2011-05-25 20:18:33 0

What's this? 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

put current directory in LAN quickly

remove recursively all txt files with number of lines less than 10

Apply fade effect to a audio
fade [type] fade-in-length [stop-time [fade-out-length]] Apply a fade effect to the beginning, end, or both of the audio. An optional type can be specified to select the shape of the fade curve: q for quarter of a sine wave, h for half a sine wave, t for linear (`triangular') slope, l for logarithmic, and p for inverted parabola. The default is logarithmic. A fade-in starts from the first sample and ramps the signal level from 0 to full volume over fade-in-length sec? onds. Specify 0 seconds if no fade-in is wanted. For fade-outs, the audio will be truncated at stop-time and the signal level will be ramped from full volume down to 0 starting at fade-out-length seconds before the stop-time. If fade-out-length is not specified, it defaults to the same value as fade-in-length. No fade-out is performed if stop-time is not specified. If the file length can be determined from the input file header and length-changing effects are not in effect, then 0 may be specified for stop-time to indicate the usual case of a fade-out that ends at the end of the input audio stream. All times can be specified in either periods of time or sample counts. To specify time periods use the format hh:mm:ss.frac format. To specify using sample counts, specify the number of samples and append the letter `s' to the sample count (for example `8000s').

Retry the previous command until it exits successfully
Repeat the previously used command (!!) until it exits with a success code (0). To put a delay between attempts you could do something like $ until !!; do sleep 5; done to wait 5 seconds after each attempt.

a function to find the fastest free DNS server
Evoke from the command like as: $ timeDNS . This isn't too terribly practical, but it is a good code example of using subshells to run the queries in parallel and the use of an "anonymous function" (a/k/a "inline group") to group i/o. . I'm assuming you have already defined your local DNS cache as ${local_DNS}, (here, it's . You do need to install `moreutils` to get `sponge`. . If you're willing to wait, a slower version w/o sponge, (and w/o sorting), is this: . DNS () { for x in "" "" "" "" "" "" "" "" ""; do (echo -n "$x "; dig @"$x" "$*"|grep Query) ; done ; }

List only executables installed by a debian package
Safe for whitespaces in names.

Encrypted chat with netcat and openssl (one-liner)
client$ while true; do read -n30 ui; echo $ui |openssl enc -aes-256-ctr -a -k PaSSw ; done | nc localhost 8877 | while read so; do decoded_so=`echo "$so"| openssl enc -d -a -aes-256-ctr -k PaSSw`; echo -e "Incoming: $decoded_so"; done This will establish a simple encrypted chat with AES-256-CTR using netcat and openssl only. More info here

Text graphing ping output filter
Nasty perl one-liner that provides a sparkline of ping times. If you want a different history than the last 30, just put that value in. It (ab)uses unicode to draw the bars, inspired by . It's not the most bug-free piece of code, but what it lacks in robustness it makes up for in capability. :) If anyone has any ideas on how to make it more compact or better, I'd love to hear them. I included a ping to google in the command just as an example (and burned up 10 chars doing it!). You should use it with: $ ping | $SPARKLINE_PING_COMMAND

Run a bash script in debug mode, show output and save it on a file
Sends both stdout and stderr to the pipe which captures the data in the file 'out.test' and sends to stdout of tee (likely /dev/tty unless redirected). Works on Bourne, Korn and Bash shells.

File rotation without rename command
Rotates log files with "gz"-extension in a directory for 7 days and enumerates the number in file name. i.e.: logfile.1.gz > logfile.2.gz I needed this line due to the limitations on AIX Unix systems which do not ship with the rename command.

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.


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: